File: //home/cafsindia/refimac_cafsjobs_com/op_call_registration_bk02mar2017.php
<div id="contentwrapper">
<div class="main_content">
<div class="page-head">
<div class="container">
<!-- BEGIN PAGE TITLE -->
<div class="page-title">
<h1>Call Registration <small>Manage your Customer/Machine/Service/Complaints.</small></h1>
</div>
</div>
</div>
<div class="page-content">
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class='alert alert-success msgsuccess' style="display:none">
<span>Given information successfully updated !</span>
</div>
<div class='alert alert-warning msgfaild' style="display:none">
<span>sorry, given information not updated, please try again !</span>
</div>
<div class='alert alert-danger msgdelete' style="display:none">
<span>Selected Record successfully deleted !</span>
</div>
</div>
</div>
<div class="page-content-inner">
<div class="portlet light">
<div class="page-content-inner">
<div class="row">
<div class="col-md-12">
<div class="portlet light ">
<div class="portlet-body">
<ul class="nav nav-tabs">
<li class="active">
<a href="#tab_1_1" data-toggle="tab"> Service/Calls Management </a>
</li>
<li>
<a href="#tab_1_2" data-toggle="tab"> Service Management </a>
</li>
<!--<li>
<a href="#tab_1_3" data-toggle="tab"> Option 2 </a>
</li>-->
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="tab_1_1">
<div id="call_serchdiv">
<form name="form1" id="form1" method="post">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label> Search by :</label>
<select name="searchby" class="form-control select2" id="searchby" >
<option value="Select">Select Menu</option>
<option value="SERIALNO">serial no.</option>
<option value="Customer_Name">Customer Name</option>
<option value="Customer_Address">Customer Address</option>
<option value="Customer_Area">Customer Area</option>
<option value="CUSTOMER_SURROUND_AREA">Surround Area</option>
<option value="CUSTOMER_CITY">City</option>
<option value="CUSTOMER_PHONE">Phone</option>
<option value="CUSTOMER_MOBILE">Mobile</option>
</select>
</div>
<div class="col-md-3">
<label> Search Text :</label>
<input name="searchtext" type="text" class="form-control col-md-4" id="searchtext" value="<?php echo $searchtext;?>" />
</div>
<div class="col-md-3"><br />
<input type="button" id="search" class="btn green" value="Search" >
<a class="btn dark btn-outline sbold" data-toggle="modal" id="newcall"> Add New Customer </a>
</div>
</div>
</div>
</br>
</br>
<div class="row">
<div class="col-md-12">
<input type="image" src="assets/global/plugins/jquery-file-upload/img/loading.gif" id="searchloading" style="display:none;"/>
<div id="bookcomplaint" style="display:none">
</div>
</div>
<span id="searchresult">
</span>
</div>
</div>
</form>
</div>
<div class="tab-pane fade" id="tab_1_2">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label> From Date :</label>
<input name="fromdate" type="text" class="form-control col-md-4 date-picker" data-date-format="mm-yyyy" id="fromdate" />
</div>
<div class="col-md-3">
<label> Todate :</label>
<input name="todate" type="text" class="form-control col-md-4 date-picker" data-date-format="mm-yyyy" id="todate" />
</div>
<div class="col-md-3">
<label> </label>
</br>
<input type="button" id="btnsearchservice" class="btn green" value="Search" >
</div>
</br>
</br>
<div class="row">
<div class="col-md-12">
<input type="image" src="assets/global/plugins/jquery-file-upload/img/loading.gif" id="searchloadingnew" style="display:none;"/>
<div id="serviceresult" style="display:none">
</div>
</div>
<span id="searchresult">
</span>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab_1_3">
<p> Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft
beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free,
carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray
yr. </p>
</div>
<div class="tab-pane fade" id="tab_1_4">
<p> Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY,
art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral,
mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan. </p>
</div>
</div>
<div class="clearfix margin-bottom-20"> </div>
</div>
</div>
</div>
</div>
</div>
<!--<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Brand Name<span class="f_req">*</span></label>
<input name="Brand_name" type="text" class="form-control" id="Brand_name" value="<?php echo $MAKE_NAME;?>" />
<span class="help-block">Please enter Brand Name</span>
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<button type="submit" class="btn green">Submit</button>
<button type="button" class="btn grey-salsa btn-outline cancel">Cancel</button>
</div>
</div>
</div>-->
</div>
<!--Add New customer start-->
<div class="modal fade" id="fullmodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Add new Customer</h4>
</div>
<div class="modal-body"><div class="portlet light">
<form id="cust_form" method="post">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Customer Name <span class="f_req">*</span></label>
<input name="CUSTOMER_NAME" type="text" class="form-control uppercase" id="CUSTOMER_NAME" />
<input name="CUSTOMER_CODE" type="hidden" class="form-control uppercase" id="CUSTOMER_CODE" />
<span class="help-block">Enter customer name </span>
</div>
<div class="col-md-3">
<label>Customer Address <span class="f_req">*</span></label>
<!--<input name="CUSTOMER_ADDRESS" type="text" class="form-control uppercase" id="CUSTOMER_ADDRESS" />-->
<textarea name="CUSTOMER_ADDRESS" class="form-control uppercase" id="CUSTOMER_ADDRESS" ></textarea>
<span class="help-block">Enter customer Address </span>
</div>
<div class="col-md-3">
<label>Customer Area <span class="f_req">*</span></label>
<input name="CUSTOMER_AREA" type="text" id="CUSTOMER_AREA" class="form-control uppercase" />
<!--class="form-control date-picker" data-date-format="dd-mm-yyyy"-->
</div>
<div class="col-md-3">
<label>Surround Area <span class="f_req">*</span></label>
<select name="CUSTOMER_SURROUND_AREA" class="form-control select2 uppercase" id="CUSTOMER_SURROUND_AREA" style="max-height:400px;" >
<option value="">Select</option>
<?php if($per=="Super Admin"){?>
<option <?php if($per1=="Super Admin") echo "selected='selected'";?> value="Super Admin">Super Admin</option>
<?php }?>
<?php
$sql="select area_name from area where area_update=1";
$qu=mysql_query($sql);
while($r=mysql_fetch_array($qu))
{
?>
<option <?php if($per1==$r['area_name']) echo "selected='selected'";?> value="<?php echo $r['area_name'];?>"><?php echo $r['area_name'];?></option>
<?php }?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>City<span class="f_req">*</span></label>
<input name="CUSTOMER_CITY" type="text" class="form-control uppercase" id="CUSTOMER_CITY" />
<span class="help-block">Enter city </span>
</div>
<div class="col-md-3">
<label>Customer Pincode <span class="f_req">*</span></label>
<input name="CUSTOMER_PINCODE" type="text" class="form-control uppercase" id="CUSTOMER_PINCODE" />
</div>
<div class="col-md-3">
<label>Phone <span class="f_req">*</span></label>
<input name="CUSTOMER_PHONE" type="text" class="form-control uppercase" id="CUSTOMER_PHONE" />
</div>
<div class="col-md-3">
<label>Mobile<span class="f_req">*</span></label>
<input name="CUSTOMER_MOBILE" type="text" class="form-control uppercase" id="CUSTOMER_MOBILE" />
<!--class="form-control date-picker" data-date-format="dd-mm-yyyy"-->
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Contact Person<span class="f_req">*</span></label>
<input name="CUSTOMER_CONTACT_PERSON" type="text" class="form-control uppercase" id="CUSTOMER_CONTACT_PERSON" />
<input type="checkbox" id="samename" name="samename" /> Same the customer name
</div>
</div>
</div>
</br>
</br>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<button type="submit" class="btn green addnewcustomer">Submit</button>
<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</form>
</div> </div>
<div class="modal-footer">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--Add New Customer End-->
<!--update customer customer start-->
<div class="modal fade" id="updatecustomermodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Update Customer</h4>
</div>
<div class="modal-body" id="updatecustomer"> </div>
<div class="modal-footer">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--update customer End-->
<!--Book New Complaint start-->
<div class="modal fade" id="booknewcoplaintmodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Book New Complaint</h4>
</div>
<div class="modal-body" id="booknewcoplaint">
</div>
<div class="modal-footer">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--Book New complaint End-->
<!--View Machine Details-->
<div class="modal fade" id="viewmachinemodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">View Sales and Service Details</h4>
</div>
<div class="modal-body" id="viewmachine">
</div>
<div class="modal-footer" style="border-top: 0px !important;">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--View machine Details End-->
<!--View Machine Details-->
<div class="modal fade" id="loadingDiv" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-body">
<img src="assets/global/img/loading.gif" />
</div>
<div class="modal-footer" style="border-top: 0px !important;">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--VIEW MAC End-->
<!--VIEW Complaint History start-->
<div class="modal fade" id="viewcomplaintinfomodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content" style="overflow: scroll;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">VIEW /Search Complaint History</h4>
</div>
<div class="modal-body" id="viewcomplaintinfo">
</div>
<div class="modal-footer" style="border-top: 0px !important;">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--VIEW Complaint History END-->
<!--update Existing Complaint start-->
<div class="modal fade" id="updatecomplaintmodel" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-full">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Update Complaint</h4>
</div>
<div class="modal-body" id="updatecomplaint">
</div>
<div class="modal-footer">
<!--<button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
<button type="button" class="btn green">Save changes</button>-->
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!--update Existing complaint End-->
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function()
{
if ( $.fn.dataTable.isDataTable( '#sample' ) ) {
table = $('#sample').DataTable();
}
else {
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
$('#form1').on('keyup keypress', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
return false;
}
});
// calls management search
$( "#search" ).click(function(e) {
//show loading
$('#searchloading').show();
// hide loading
$('#searchresult').hide();
searchby = $('#searchby').val();
searchtext = $('#searchtext').val();
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"1",pageid:"2_1_1",searchby:searchby,searchtext:searchtext},
success: function(msg) {
$('#searchresult').html(msg);
$('#searchloading').hide();
$('#searchresult').show();
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
//
}
});
});
//get search result
// check same name as contact person
$('#samename').on('click',function () {
var customername = $('#CUSTOMER_NAME').val();
var ckbox = $('#samename');
if (ckbox.is(':checked')) {
if(customername=="")
{
$('#CUSTOMER_NAME').focus();
$('#samename').attr('checked', false);
}
else{
$('#CUSTOMER_CONTACT_PERSON').val(customername);
}
} else {
if(customername=="")
{
$('#CUSTOMER_NAME').focus();
$('#CUSTOMER_CONTACT_PERSON').val('');
$('#samename').attr('checked', false);
}
else{
$('#CUSTOMER_CONTACT_PERSON').val('');
}
}
});
// upadte form
/*$('.samename').on('click',function () {
alert(11);
var customername = $('#cust_form_update,#CUSTOMER_NAME').val();
var ckbox = $('#cust_form_update,#samename');
if (ckbox.is(':checked')) {
if(customername=="")
{
$('#cust_form_update,#CUSTOMER_NAME').focus();
$('#cust_form_update,#samename').attr('checked', false);
}
else{
$('#cust_form_update,#CUSTOMER_CONTACT_PERSON').val(customername);
}
} else {
if(customername=="")
{
$('#cust_form_update,#CUSTOMER_NAME').focus();
$('#cust_form_update,#CUSTOMER_CONTACT_PERSON').val('');
$('#cust_form_update,#samename').attr('checked', false);
}
else{
$('#cust_form_update,#CUSTOMER_CONTACT_PERSON').val('');
}
}
});*/
//model show
$( "#newcall" ).click(function(e) {
$('#cust_form').closest('form').find("input[type=text], textarea").val("");
$('#fullmodel').modal('show');
});
//add new customer
$( ".addnewcustomer" ).click(function(e) {
event.preventDefault();
postvalue=($('#cust_form').serialize());
$.ajax({
type: "POST",
url: "add_details.php?type=1&pid=2_1_1",
data: postvalue,
success: function(msg) {
result=msg.split('|');
if(result[0]=="1")
{
$('#fullmodel').modal('hide');
$('.msgsuccess').show();
//alert(result[1]);
//$('.msgsuccess').html('Data Save Scuessfully customer code'.result[0]);
searchcuatomerrecall('cust',result[1]);
}
else
{
alert("please try once again!");
return false;
}
}
});
});
$( "#btnsearchservice" ).click(function(e) {
event.preventDefault();
//show loading
$('#searchloadingnew').show();
// hide loading
$('#serviceresult').hide();
//searchby = $('#searchby').val();
//searchtext = $('#searchtext').val();
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"10",pageid:"2_1_1"},
success: function(msg) {
$('#serviceresult').html(msg);
$('#searchloadingnew').hide();
$('#serviceresult').show();
table = $('#viewservicedetails').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
//
}
});
});
});
function addupdatecustomer()
{
event.preventDefault();
postvalue=($('#cust_form_update').serialize());
$.ajax({
type: "POST",
url: "add_details.php?type=1&pid=2_1_1",
data: postvalue,
success: function(msg) {
result=msg.split('|');
if(result[0]=="1")
{
$('#updatecustomermodel').modal('hide');
$('.msgsuccess').show();
//alert(result[1]);
//$('.msgsuccess').html('Data Save Scuessfully customer code'.result[0]);
searchcuatomerrecall('cust',result[1]);
}
else
{
alert("please try once again!");
return false;
}
}
});
}
// update customer model
function updatecustomer(value)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"9",pageid:"2_1_1",custcode:value},
success: function(msg) {
$('#updatecustomer').html(msg);
$('#updatecustomermodel').modal('show');
}
});
}
//complaint model show
function bookcomplaint(value)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"2",pageid:"2_1_1",custcode:value},
success: function(msg) {
$('#booknewcoplaint').html(msg);
$('#booknewcoplaintmodel').modal('show');
$('#call_type').select2();
$('#brand_name').select2();
$('#cust_product').select2();
$('#cust_area').select2();
$('.select2 .select2-container').css('width', '')
$("#booknewcoplaintmodel").find("[id^=service_req_datetime]").each(function () {
bindDatePicker(this);
});
}
});
}
// bind date picker
var bindDatePicker = function(element) {
$(element).datepicker(
{
startDate: new Date()
});
};
//complaint model show
function bookcomplaintwithservice(value,salesid,serviceno)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"2",pageid:"2_1_1",custcode:value,sales_id:salesid,servicecount:serviceno},
success: function(msg) {
$('#booknewcoplaint').html(msg);
$('#booknewcoplaintmodel').modal('show');
$('#call_type').select2();
$('#brand_name').select2();
$('#cust_product').select2();
$('#cust_area').select2();
$('.select2 .select2-container').css('width', '')
}
});
}
//bookcomplaintwithservice
function bookcomplaintwithservice(custcode,salesid,serviceno)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"2",pageid:"2_1_1",custcode:custcode,salesid:salesid,serviceno:serviceno},
success: function(msg) {
$('#booknewcoplaint').html(msg);
$('#booknewcoplaintmodel').modal('show');
$('#viewmachinemodel').modal('hide');
$('#call_type').select2();
$('#brand_name').select2();
$('#cust_product').select2();
$('#cust_area').select2();
$('.select2 .select2-container').css('width', '')
}
});
}
//viewmachine
function viewmachine(value)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"3",pageid:"2_1_1",custcode:value},
success: function(msg) {
$('#viewmachine').html(msg);
$('#loadingmodel').modal('hide');
$('#viewmachinemodel').modal('show');
table = $('#viewmachineinfo').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
});
}
// view service info
function viewserviceinfo(value,valueone)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"4",pageid:"2_1_1",salesid:value,custcode:valueone},
success: function(msg) {
$('#serviceinfo').html(msg);
$('#serviceinfo').show();
}
});
}
//add new machine
function addnewmachine(value)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"6",pageid:"2_1_1",custcode:value},
success: function(msg) {
$('#addnewmachine').html(msg);
$('#serviceinfo').hide();
$('#addnewmachine').show();
}
});
}
//get model
function getmodel()
{
mac_brand_name=$('#mac_brand_name').val();
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"7",pageid:"2_1_1",macbrandname:mac_brand_name},
success: function(msg) {
$('#mac_model_id').html(msg);
}
});
}
//viewcomplaints
function viewcomplaints(value)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"5",pageid:"2_1_1",custcode:value},
success: function(msg) {
$('#viewcomplaintinfo').html(msg);
$('#viewcomplaintinfomodel').modal('show');
table = $('#viewtablecomplaintinfo').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
});
}
//hideservice
function hideservice()
{
$('#serviceinfo').hide();
}
// hide machine view
function hideaddnewmac()
{
$('#addnewmachine').hide();
}
// save complaint
function addcomplaint()
{
event.preventDefault();
postvalue=($('#comp_form').serialize());
$.ajax({
type: "POST",
url: "add_details.php?type=2&pid=2_1_1",
data: postvalue,
success: function(msg) {
result=msg.split('|');
console.log(result);
if(result[0]=="1")
{
$('#booknewcoplaintmodel').modal('hide');
$('#updatecomplaintmodel').modal('hide');
//alert("Data Save Scuessfully customer code".result[0]);
$('.msgsuccess').show();
if(result[2]=="Installation")
{
$('.msgsuccess').html('Information Submited Successfully! Your Compplaint No.'+result[1]+' <a href="print_call_installation.php?number='+result[1]+'" style="color:red" target="_blank">Click to print service report</a>');
}else
{
$('.msgsuccess').html('Information Submited Successfully! Your Compplaint No.'+result[1]+' <a href="print_call.php?number='+result[1]+'" style="color:red" target="_blank">Click to print service report</a>');
}
}
else
{
alert("please try later!");
return false;
}
}
});
}
//complaint_form_update
function updatecomplaint()
{
event.preventDefault();
postvalue=($('#cust_form_update').serialize());
$.ajax({
type: "POST",
url: "add_details.php?type=2&pid=2_1_1",
data: postvalue,
success: function(msg) {
result=msg.split('|');
console.log(result);
if(result[0]=="1")
{
$('#booknewcoplaintmodel').modal('hide');
$('#updatecomplaintmodel').modal('hide');
//alert("Data Save Scuessfully customer code".result[0]);
$('.msgsuccess').show();
$('.msgsuccess').html('Information Submited Successfully! Your Compplaint No.'+result[1]+' <a href="print_service.php?number="'+result[1]+' style="color:red" target="_blank">Click to print service report</a>');
}
else
{
alert("please try later!");
return false;
}
}
});
}
// edit complaint info
function editcomplaint(complaintno)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"8",pageid:"2_1_1",complaintno:complaintno},
success: function(msg) {
$('#updatecomplaint').html(msg);
$('#viewcomplaintinfomodel').modal('hide');
$('#updatecomplaintmodel').modal('show');
}
});
}
// customer table function recall for fetch data
function searchcuatomerrecall(searchby,searchtext)
{
$.ajax({
type: "POST",
url: "ajax/loaddata.php",
data: {type:"1",pageid:"2_1_1",searchby:searchby,searchtext:searchtext},
success: function(msg) {
$('#searchresult').html(msg);
$('#searchloading').hide();
$('#searchresult').show();
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
//
}
});
}
</script>