293 lines
8.2 KiB
PHP
Executable File
293 lines
8.2 KiB
PHP
Executable File
<?php
|
|
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
|
$CurrentDate = $dt->format('d-m-Y');
|
|
$count = '';
|
|
if (!empty($enquirycount)) {
|
|
foreach ($enquirycount as $enc) {
|
|
$count = $enc->Countnumber;
|
|
}
|
|
}
|
|
|
|
$actcount = (int)$count + 1;
|
|
//echo $actcount;
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
$(function() {
|
|
//Initialize Select2 Elements
|
|
$("#Customer").select2();
|
|
|
|
|
|
// var MaxDate = '<?php //echo $MaxPoDate; ?>';
|
|
// var d = new Date(MaxDate);
|
|
var t = '<?php echo $CurrentDate; ?>';
|
|
var m = new Date(t);
|
|
|
|
$("#Date").datepicker({
|
|
//minDate: d,
|
|
minDate: 'now',
|
|
//maxDate : 'now',
|
|
dateFormat: 'dd-mm-yy',
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
yearRange: '-100:+0'
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<style>
|
|
.num {
|
|
text-align: right;
|
|
}
|
|
</style>
|
|
<div class="content-wrapper" style="min-height:537">
|
|
<!-- Content Header (Page header) -->
|
|
|
|
|
|
<section class="content">
|
|
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<center><b><h3 class="box-title"> Add Complaint</h3></b></center>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<div class="box-body">
|
|
<div id="content"></div>
|
|
|
|
<?php
|
|
$attributes = array('class' => 'form-label-left advancerequest', 'name' => 'enquiry', 'id' => 'enquiry');
|
|
|
|
// echo form_open(base_url().'purchaseorder/addadvancerequest',$attributes);
|
|
?>
|
|
<div class="row" style="padding:0% 2%">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Customer Name</label>
|
|
|
|
|
|
<?php
|
|
$opt = array("0" => 'Customer Name');
|
|
|
|
if (!empty($Customer)) { //print_r($Currency);
|
|
foreach ($Customer as $Cu) :
|
|
// print_r($Cu['client_id']);
|
|
|
|
$opt[$Cu['client_id']] = $Cu['client_id'] . ' ' . ' - ' . ' ' . $Cu['client_name'];
|
|
|
|
endforeach;
|
|
}
|
|
|
|
|
|
// print_r($opt);
|
|
|
|
echo form_dropdown('Customer', $opt, set_value('Customer'), 'id="Customer"', 'required="true"', 'class="form-control select2');
|
|
?>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Date</label>
|
|
<?php
|
|
$data = array('name' => 'Date', 'value' => set_value('Date', $CurrentDate), 'id' => 'Date', 'class' => 'form-control', 'required' => 'true', 'onkeypress' => 'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Service Details</label>
|
|
<?php
|
|
$data = array('name' => 'Service_Details', 'value' => set_value('Service_Details'), 'id' => 'Service_Details', 'class' => 'form-control', 'rows' => '5', 'cols' => '100', 'maxlength' => '250');
|
|
echo Form_textarea($data);
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<label>Details of Complaint(Reason)</label>
|
|
<?php
|
|
$data = array('name' => 'Reasons', 'value' => set_value('Reasons'), 'id' => 'Reasons', 'class' => 'form-control', 'rows' => '5', 'cols' => '100', 'maxlength' => '250');
|
|
echo Form_textarea($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3" style="display: none">
|
|
<label>Feasible</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$optionsnew = array('0' => 'Select', '1' => 'YES', '2' => 'NO');
|
|
echo form_dropdown('Feasible', $optionsnew, set_value('Feasible'), 'id="Feasible"', 'required="true"', 'class="form-control select2');
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
<label for="selectmonth">Mode Of Communication</label>
|
|
<?php
|
|
$data = array('name' => 'mode', 'value' => set_value('mode'), 'id' => 'mode', 'class' => 'form-control ', 'required' => 'true',);
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Action Taken</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'Action', 'value' => set_value('Action'), 'id' => 'Action', 'class' => 'form-control ', 'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- <div class="col-md-3">
|
|
<label>Supplied Quantity</label>
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
$data = array('name' => 'SupQty', 'value' => set_value('SupQty'), 'id' => 'SupQty', 'class' => 'form-control', 'style' => 'text-align:left;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<div class="col-md-3">
|
|
<label>Remarks</label>
|
|
<div class="form-group">
|
|
|
|
<!-- <?php
|
|
$data = array('name' => 'Remarks', 'value' => set_value('Remarks'), 'id' => 'Remarks', 'class' => 'form-control', 'style' => 'text-align:left;');
|
|
echo form_input($data);
|
|
?> -->
|
|
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Remark', 'value' => set_value('Remark'), 'id' => 'Remark', 'class' => 'form-control', 'rows' => '5', 'cols' => '100', 'maxlength' => '250');
|
|
echo Form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-1 col-md-offset-2"><br><br><br>
|
|
<a class="btn btn-success Save" ID="Save" onclick="Save()"> <span class="bold">Save</span></a>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var today = new Date();
|
|
var dd = today.getDate();
|
|
var mm = today.getMonth() + 1; //January is 0!
|
|
var yyyy = today.getFullYear();
|
|
|
|
if (dd < 10) {
|
|
dd = '0' + dd
|
|
}
|
|
|
|
if (mm < 10) {
|
|
mm = '0' + mm
|
|
}
|
|
|
|
today = yyyy + mm + dd;
|
|
//alert(today);
|
|
var count = <?php echo json_encode($actcount, JSON_PRETTY_PRINT) ?>;
|
|
//alert(count)
|
|
|
|
var customerorderno = today + '/' + count;
|
|
//alert(customerorderno)
|
|
|
|
$('#Corder').val(customerorderno);
|
|
|
|
|
|
|
|
|
|
|
|
function Save() {
|
|
|
|
if (validate()) {
|
|
var client_id = $('#Customer').val();
|
|
var date = $('#Date').val();
|
|
// $createddt = $date->format('Y-m-d');
|
|
|
|
var newdate = date.split("-").reverse().join("-");
|
|
//alert(newdate)
|
|
var Service_Details = $('#Service_Details').val();
|
|
var Reasons = $('#Reasons').val();
|
|
//var feasible = $("#Feasible :selected").text();
|
|
var mode = $('#mode').val();
|
|
var Action = $('#Action').val();
|
|
var Remark = $('#Remark').val();
|
|
//var remarks= $('#Remark').val();
|
|
$('#loader').show();
|
|
$.ajax({
|
|
|
|
data: {
|
|
client_id: client_id,
|
|
date: newdate,
|
|
Service_Details: Service_Details,
|
|
Reasons: Reasons,
|
|
mode: mode,
|
|
Action: Action,
|
|
Remark: Remark
|
|
},
|
|
//dataType:'json',
|
|
type: "POST",
|
|
url: "<?php echo base_url(); ?>purchaseorder/SaveComplaint",
|
|
success: function(data) {
|
|
$('#loader').show();
|
|
if (data) {
|
|
alert(data);
|
|
window.location = "Nonconfirmativelist";
|
|
} else {
|
|
alert("Error");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function validate() {
|
|
|
|
if ($("#Customer").val() == "0") {
|
|
alert('Please Select Customer');
|
|
$("#Customer").focus();
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
|
|
|
|
}
|
|
</script>>
|