EVOLUTION-NINJA
Edit File: loan_progress_list.php
<?php $this->load->view('includes/header.php')?> <div class="content-wrapper"> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#">Customer</a></li> <li class="breadcrumb-item"> Sale Agreement </li> </ol> </div> </div> </div> </div> <div class="row"> <div class="col-md-12 grid-margin stretch-card"> <div class="card"> <div class="card-body"> <div class="form-check-inline"> <label class="form-check-label"> <input type="radio" checked="checked" class="form-check-input" id="todays" name="optradio" value="todays" onclick="planningtypes('sale_agreement')">Sale Agreement List </label> </div> <div class="form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" id="todays" name="optradio" value="todays" onclick="planningtypes('customer_agreement')">Customer Sale Agreement List </label> </div> <div class="form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" id="todays" name="optradio" value="todays" onclick="planningtypes('bank_agreement')">Bank Sale Agreement List </label> </div> <div class="form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" id="todays" name="optradio" value="todays" onclick="planningtypes('approved_customer_agreement')">Aproved Customer Sale Agreement List </label> </div> <div class="form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" id="todays" name="optradio" value="todays" onclick="planningtypes('approved_bank_agreement')">Aproved Bank Sale Agreement List </label> </div> <div id="sale_agreement"> <div id ="jaytab1" style="margin-top:3%" class="grid table-responsive"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="approved_sale_agreement" style="display:none"> <div id ="jaytab2" style="margin-top:3%" class="grid table-responsive"> <table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="customer_agreement" style="display:none"> <div id ="jaytab3" style="margin-top:3%" class="grid table-responsive"> <table id="list5"></table> <div id="pager5"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="bank_agreement" style="display:none"> <div id ="jaytab4" style="margin-top:3%" class="grid table-responsive"> <table id="list6"></table> <div id="pager6"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="approved_bank_agreement" style="display:none"> <div id ="jaytab7" style="margin-top:3%" class="grid table-responsive"> <table id="list7"></table> <div id="pager7"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </div> </div> </div> </div> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content "> <div class="modal-header"> <h3 class="modal-title pull-right">Follow up</h3> <button type="button" class="close" data-dismiss="modal">×</button> </div> <form method="post" class="add_forms"> <div class="modal-body"> <p><b>Customer : </b><b id="customer_name"></b> <span style="padding-left: 175px;"> <b>Contact No : </b> <b id="contact_no"></b> </span> <span style="float: right;"> <b>Email ID : </b> <b id="email"></b> </span> </p> <!---grid--> <div id ="jaytab" style="margin-top:3%" class="grid table-responsive"> <table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <!--end grid---> <hr> <h5>Add followup</h5> <div class="row"> <div class="col-sm-6"> <label for="name">Progress</label> <div class="form-group"> <select type="text" name="progress" class="form-control progress_type" required=""> <option value="">Select</option> <option value="Sales Final Costing">Sales Final Costing</option> <option value="Loan Followup ">Sale Agreement </option> <option value="Registration">Registration</option> <option value="Records">Records</option> <option value="Architecture ">Architecture </option> <option value="Building Agreement">Revised Budget </option><option value="Execution">Execution</option> <option value="House Service ">House Service</option> <option value="Layout Service">Layout Service</option> <option value="Customer Visit">Customer Visit</option> <option value="Finalized Reject">Finalized Reject</option> <option value="Collection">Collection</option> <option value="Payment">Payment</option> <option value="Billing">Billing</option> <option value="Selections">Selections</option> </select> </div> </div> <div class="col-sm-6"> <label for="name">Layout Name</label> <div class="form-group"> <select type="text" name="" class="form-control booking_layout_id" required="" id="layout_id" disabled=""> <option value="">Select</option> <?php foreach($result_layout as $key => $value) { ?> <option value="<?php echo $value->id; ?>"><?php echo $value->layout_name;?></option> <?php } ?> </select> </div> </div> <div class="col-sm-6 followup_date"> <div class="form-group"> <label for="name">Follow Date :</label> <input type="text" name="follow_date" class="date form-control date-picker date-picker1" autocomplete="off" required> <input type="hidden" name="followuser_id" class="followuser_id form-control"> <input type="hidden" name="site_id" class="site_idss form-control" > <input type="hidden" name="layout_id" class="booking_layout_id form-control" > </div> </div> <div class="col-sm-6"> <div class="form-group" id="leaves1"> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <label for="name">Assign Employee</label> <div class="form-group"> <select name="employee" class="form-control employee_name" required> <option value="">Select</option> <?php foreach($employee_type as $key => $value) { ?> <option value="<?php echo $value->emp_id; ?>"><?php echo $value->full_name;?> <?php echo $value->last_name;?> </option> <?php } ?> </select> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="name">Department</label> <input type="text" class="form-control" name="department" id="department_name" readonly="" required=""> <input type="hidden" name="department_id" id="department_id"> </div> </div> <div class="col-sm-12"> <div class="form-group"> <label for="name">Description :</label> <textarea name="description" name="description" class="date form-control" id="modal_input" required="required"></textarea> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="form-group"> <label for="name">File Attachment Name</label> <select name="file_name" class="form-control file_name" required> <option value="">Select</option> <?php foreach($file_names as $key => $value) { ?> <option value="<?php echo $value->id; ?>"><?php echo $value->name;?></option> <?php } ?> </select> </div> </div> <div class="col-sm-6"> <div class="form-group"> <label for="name">File Attachment</label> <input type="file" class="form-control file" name="file" id="file" required="" > </div> </div> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary add">Submit</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> </div> </div> </div> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/grid_style.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/jqgrid/css/ui.jqgrid.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/jqgrid/css/ui.jqgrid-bootstrap.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/jqgrid/css/ui.jqgrid-bootstrap-ui.css'); ?>" /> <script type="text/ecmascript" src="<?php echo base_url('assets/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <script type="text/ecmascript" src="<?php echo base_url('assets/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <script src="<?php echo base_url('assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script type="text/javascript"> function planningtypes(str) { if(str=="sale_agreement") { $('#sale_agreement').show(); $('#approved_sale_agreement').hide(); $('#customer_agreement').hide(); $('#bank_agreement').hide(); $('#approved_bank_agreement').hide(); } else if(str=="approved_customer_agreement") { $("#list4").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#sale_agreement').hide(); $('#approved_bank_agreement').hide(); $('#approved_sale_agreement').show(); $('#customer_agreement').hide(); $('#bank_agreement').hide(); } else if(str=="customer_agreement") { $("#list5").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#sale_agreement').hide(); $('#approved_sale_agreement').hide(); $('#approved_bank_agreement').hide(); $('#customer_agreement').show(); $('#bank_agreement').hide(); } else if(str=="bank_agreement") { $("#list6").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#sale_agreement').hide(); $('#approved_sale_agreement').hide(); $('#customer_agreement').hide(); $('#approved_bank_agreement').hide(); $('#bank_agreement').show(); } else if(str=="approved_bank_agreement") { $("#list7").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#sale_agreement').hide(); $('#approved_sale_agreement').hide(); $('#customer_agreement').hide(); $('#bank_agreement').hide(); $('#approved_bank_agreement').show(); } } function booking_up(id,site_id,layout_id) { load_grid(id,site_id,layout_id); $('.followuser_id').val(id); $("#myModal").modal('show'); var followuser_id = $('.followuser_id').val(); $.ajax({ type:'post', url:'<?php echo site_url('get-customer-name');?>', data:{'followuser_id':followuser_id,'site_id':site_id,'layout_id':layout_id}, success:function(response){ response=jQuery.parseJSON(response); if(response.result==1) { $('#customer_name').empty(); $('#customer_name').text(response.customer.name); $('#contact_no').text(response.customer.phone); $('#email').text(response.customer.email); $('#layout_id').val(response.booking.layout_id); $('.site_idss').val(response.booking.site_id); $('.booking_layout_id').val(response.booking.layout_id); $.ajax({ type:'post', url:'<?php echo site_url('get-site-based-on-layout');?>', data:{'layout_id':response.booking.layout_id}, success:function(response){ response=jQuery.parseJSON(response) if(response.result==1) { var site_idss = $('.site_idss').val(); var con1 = ''; con1 += '<label for="name">Site No</label>'; con1 += '<select type="text" class="form-control site_list" name="" disabled>'; con1 += '<option value="">Select</option>'; $.each( response.sites, function( key, value2 ) { if(site_idss == value2.id) { con1+='<option value="'+value2.id+'" selected>'+value2.site_no+'</option>'; } else { con1+='<option value="'+value2.id+'" >'+value2.site_no+'</option>'; } }); con1 += '</select> '; $('#leaves1').empty(); $('#leaves1').append(con1); } else { $('#leaves1').empty(); toastr["error"](response.message); } } }); } else { $('#customer_name').empty(); toastr["error"](response.message); } } }); } $("#list2").jqGrid({ url:"<?php echo site_url('Get-loan-progress-list')?>", mtype : "get", datatype: "json", colNames:['id','','','','','','Name','Layout Name','Site No','Enquiry Layout','Reference Type','Referred By','Ref Person\'s Layout','Ref Person\'s Site','Department Name','Created By','Created Time','Created Time','Employee Name','Remarks','Customer Agreement','Bank Agreement'], colModel:[ {name:'ids',index:'ids', width:100, hidden:true,editable:false}, {name:'site_visit_id',index:'site_visit_id', width:100, hidden:true,editable:false}, {name:'sale_agre_id',index:'sale_agre_id', width:100, hidden:true,editable:false}, {name:'customer_id',index:'customer_id', width:100, hidden:true,editable:false}, {name:'site_id',index:'site_id', width:100, hidden:true,editable:false}, {name:'layout_id',index:'layout_id', width:100, hidden:true,editable:false}, {name:'name',index:'name', width:100, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:100, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:100, hidden:false,editable:false}, {name:'enquiry_layout',index:'enquiry_layout', width:100, hidden:false,editable:false}, {name:'reference_type',index:'reference_type',editable:false, width:100}, {name:'ref_from',index:'ref_from',editable:false, width:100}, {name:'ref_layout',index:'ref_layout',editable:false, width:75}, {name:'ref_site_number',index:'ref_site_number',editable:false, width:100}, {name:'dept_name',index:'dept_name',editable:false, width:100}, {name:'created_by',index:'created_by',editable:false, width:100}, {name:'created_date',index:'created_date',editable:false, width:100,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time',editable:false, width:100}, {name:'first_name',index:'first_name',editable:false, width:100}, {name:'remarks',index:'remarks',editable:false, width:100}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a onclick="edit_customer_agreement_details('+rowObject.site_id+');" href="javascript:void(0);"><i class="fa fa-pencil-square-o" style="color:blue;" aria-hidden="true"></i></a>'; return retVal; }}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a onclick="edit_bank_agreement_details('+rowObject.site_id+');" href="javascript:void(0);"><i class="fa fa-pencil-square-o" style="color:blue;" aria-hidden="true"></i></a>'; return retVal; }}, ], rowNum:20, rowTotal: 2000, rowList : [20,50,100,400,800,1600], rownumbers: true, //rownumWidth: 60, pager:"#pager2", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Sale Agreement Details", //Subgrid1... subGrid: false, }); jQuery("#list2").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list2").jqGrid('navGrid','#pager2', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); $("#list5").jqGrid({ url:"<?php echo site_url('Get-customer-sale-agreement-list')?>", mtype : "get", datatype: "json", colNames:['id','','','','','','Name','Layout Name','Site No','Enquiry Layout','Reference Type','Referred By','Ref Person\'s Layout','Ref Person\'s Site','Department Name','Created By','Created Time','Created Time','Employee Name','Remarks','Customer Agreement','Preview'], colModel:[ {name:'ids',index:'ids', width:100, hidden:true,editable:false}, {name:'site_visit_id',index:'site_visit_id', width:100, hidden:true,editable:false}, {name:'sale_agre_id',index:'sale_agre_id', width:100, hidden:true,editable:false}, {name:'customer_id',index:'customer_id', width:100, hidden:true,editable:false}, {name:'site_id',index:'site_id', width:100, hidden:true,editable:false}, {name:'layout_id',index:'layout_id', width:100, hidden:true,editable:false}, {name:'name',index:'name', width:100, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:100, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:100, hidden:false,editable:false}, {name:'enquiry_layout',index:'enquiry_layout', width:100, hidden:false,editable:false}, {name:'reference_type',index:'reference_type',editable:false, width:100}, {name:'ref_from',index:'ref_from',editable:false, width:100}, {name:'ref_layout',index:'ref_layout',editable:false, width:75}, {name:'ref_site_number',index:'ref_site_number',editable:false, width:100}, {name:'dept_name',index:'dept_name',editable:false, width:100}, {name:'created_by',index:'created_by',editable:false, width:100}, {name:'created_date',index:'created_date',editable:false, width:100,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time',editable:false, width:100}, {name:'first_name',index:'first_name',editable:false, width:100}, {name:'remarks',index:'remarks',editable:false, width:100}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a onclick="edit_customer_agreement_details('+rowObject.site_id+');" href="javascript:void(0);"><i class="fa fa-pencil-square-o" style="color:blue;" aria-hidden="true"></i></a>'; return retVal; }}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { if(rowObject.layout_name == "18 - MMG Green City - Phase 3") { var retVal = ""; var retVal = ' <a onclick="preview_mmg_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "15 - MMG Ambari Enclave ") { var retVal = ""; var retVal = ' <a onclick="fifteen_ambari_enclave_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "17 - MMG Grand City ") { var retVal = ""; var retVal = ' <a onclick="seventeen_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else { var retVal = ""; return retVal; } }}, ], rowNum:20, rowTotal: 2000, rowList : [20,50,100,400,800,1600], rownumbers: true, //rownumWidth: 60, pager:"#pager5", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Customer Sale Agreement Details", //Subgrid1... subGrid: false, }); jQuery("#list5").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list5").jqGrid('navGrid','#pager5', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); $("#list6").jqGrid({ url:"<?php echo site_url('Get-bank-sale-agreement-list')?>", mtype : "get", datatype: "json", colNames:['id','','','','','','Name','Layout Name','Site No','Enquiry Layout','Reference Type','Referred By','Ref Person\'s Layout','Ref Person\'s Site','Department Name','Created By','Created Time','Created Time','Employee Name','Remarks','Bank Agreement','Preview'], colModel:[ {name:'ids',index:'ids', width:100, hidden:true,editable:false}, {name:'site_visit_id',index:'site_visit_id', width:100, hidden:true,editable:false}, {name:'sale_agre_id',index:'sale_agre_id', width:100, hidden:true,editable:false}, {name:'customer_id',index:'customer_id', width:100, hidden:true,editable:false}, {name:'site_id',index:'site_id', width:100, hidden:true,editable:false}, {name:'layout_id',index:'layout_id', width:100, hidden:true,editable:false}, {name:'name',index:'name', width:100, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:100, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:100, hidden:false,editable:false}, {name:'enquiry_layout',index:'enquiry_layout', width:100, hidden:false,editable:false}, {name:'reference_type',index:'reference_type',editable:false, width:100}, {name:'ref_from',index:'ref_from',editable:false, width:100}, {name:'ref_layout',index:'ref_layout',editable:false, width:75}, {name:'ref_site_number',index:'ref_site_number',editable:false, width:100}, {name:'dept_name',index:'dept_name',editable:false, width:100}, {name:'created_by',index:'created_by',editable:false, width:100}, {name:'created_date',index:'created_date',editable:false, width:100,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time',editable:false, width:100}, {name:'first_name',index:'first_name',editable:false, width:100}, {name:'remarks',index:'remarks',editable:false, width:100}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a onclick="edit_bank_agreement_details('+rowObject.site_id+');" href="javascript:void(0);"><i class="fa fa-pencil-square-o" style="color:blue;" aria-hidden="true"></i></a>'; return retVal; }}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { if(rowObject.layout_name == "18 - MMG Green City - Phase 3") { var retVal = ""; var retVal = ' <a onclick="preview_mmg_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "15 - MMG Ambari Enclave ") { var retVal = ""; var retVal = ' <a onclick="fifteen_ambari_enclave_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "17 - MMG Grand City ") { var retVal = ""; var retVal = ' <a onclick="seventeen_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else { var retVal = ""; return retVal; } }}, ], rowNum:20, rowTotal: 2000, rowList : [20,50,100,400,800,1600], rownumbers: true, //rownumWidth: 60, pager:"#pager6", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Bank Sale Agreement Details", //Subgrid1... subGrid: false, }); jQuery("#list6").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list6").jqGrid('navGrid','#pager6', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); $("#list4").jqGrid({ url:"<?php echo site_url('Get-approved-customer-agreement-list')?>", mtype : "get", datatype: "json", colNames:['id','','','','','Name','Layout Name','Site No','Enquiry Layout','Reference Type','Referred By','Ref Person\'s Layout','Ref Person\'s Site','Department Name','Created By','Created Time','Created Time','Employee Name','Remarks','Preview'/*,'Follow Up'*/], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false}, {name:'site_visit_id',index:'site_visit_id', width:100, hidden:true,editable:false}, {name:'customer_id',index:'customer_id', width:100, hidden:true,editable:false}, {name:'site_id',index:'site_id', width:100, hidden:true,editable:false}, {name:'layout_id',index:'layout_id', width:100, hidden:true,editable:false}, {name:'name',index:'name', width:80, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:80, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:80, hidden:false,editable:false}, {name:'enquiry_layout',index:'enquiry_layout', width:80, hidden:false,editable:false}, {name:'reference_type',index:'reference_type',editable:false, width:80}, {name:'ref_from',index:'ref_from',editable:false, width:80}, {name:'ref_layout',index:'ref_layout',editable:false, width:75}, {name:'ref_site_number',index:'ref_site_number',editable:false, width:80}, {name:'dept_name',index:'dept_name',editable:false, width:80}, {name:'created_by',index:'created_by',editable:false, width:80}, {name:'created_date',index:'created_date',editable:false, width:80,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time',editable:false, width:80}, {name:'first_name',index:'first_name',editable:false, width:80}, {name:'remarks',index:'remarks',editable:false, width:80}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { if(rowObject.layout_name == "18 - MMG Green City - Phase 3") { var retVal = ""; var retVal = ' <a onclick="preview_mmg_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "15 - MMG Ambari Enclave ") { var retVal = ""; var retVal = ' <a onclick="fifteen_ambari_enclave_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "17 - MMG Grand City ") { var retVal = ""; var retVal = ' <a onclick="seventeen_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else { var retVal = ""; return retVal; } }}, /* {name:'',index:'',width:80, search:false,editable:false,formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a href="javascript:void(0);" onclick="booking_up('+rowObject.id+','+rowObject.site_id+','+rowObject.layout_id+');" class="btn btn-default" id="btn"><i class="fa fa-mobile fa-2x" aria-hidden="true"></i></a>'; return retVal; }},*/ ], rowNum:20, rowTotal: 2000, rowList : [20,50,100,400,800,1600], rownumbers: true, //rownumWidth: 60, pager:"#pager4", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Aproved Customer Sale Agreement", //Subgrid1... subGrid: false, }); jQuery("#list4").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list4").jqGrid('navGrid','#pager4', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); $("#list7").jqGrid({ url:"<?php echo site_url('Get-approved-bank-agreement-list')?>", mtype : "get", datatype: "json", colNames:['id','','','','','Name','Layout Name','Site No','Enquiry Layout','Reference Type','Referred By','Ref Person\'s Layout','Ref Person\'s Site','Department Name','Created By','Created Time','Created Time','Employee Name','Remarks','Preview'/*,'Follow Up'*/], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false}, {name:'site_visit_id',index:'site_visit_id', width:100, hidden:true,editable:false}, {name:'customer_id',index:'customer_id', width:100, hidden:true,editable:false}, {name:'site_id',index:'site_id', width:100, hidden:true,editable:false}, {name:'layout_id',index:'layout_id', width:100, hidden:true,editable:false}, {name:'name',index:'name', width:80, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:80, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:80, hidden:false,editable:false}, {name:'enquiry_layout',index:'enquiry_layout', width:80, hidden:false,editable:false}, {name:'reference_type',index:'reference_type',editable:false, width:80}, {name:'ref_from',index:'ref_from',editable:false, width:80}, {name:'ref_layout',index:'ref_layout',editable:false, width:75}, {name:'ref_site_number',index:'ref_site_number',editable:false, width:80}, {name:'dept_name',index:'dept_name',editable:false, width:80}, {name:'created_by',index:'created_by',editable:false, width:80}, {name:'created_date',index:'created_date',editable:false, width:80,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time',editable:false, width:80}, {name:'first_name',index:'first_name',editable:false, width:80}, {name:'remarks',index:'remarks',editable:false, width:80}, {name:'',index:'',width:80, search:false,editable:false,align:'center',formatter: function (cellvalue, options, rowObject) { if(rowObject.layout_name == "18 - MMG Green City - Phase 3") { var retVal = ""; var retVal = ' <a onclick="preview_mmg_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "15 - MMG Ambari Enclave ") { var retVal = ""; var retVal = ' <a onclick="fifteen_ambari_enclave_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else if(rowObject.layout_name == "17 - MMG Grand City ") { var retVal = ""; var retVal = ' <a onclick="seventeen_grand_city_agreement('+rowObject.site_id+');" href="javascript:void(0);"><button>Preview</button></a>'; return retVal; } else { var retVal = ""; return retVal; } }}, /* {name:'',index:'',width:80, search:false,editable:false,formatter: function (cellvalue, options, rowObject) { var retVal = ""; var retVal = ' <a href="javascript:void(0);" onclick="booking_up('+rowObject.id+','+rowObject.site_id+','+rowObject.layout_id+');" class="btn btn-default" id="btn"><i class="fa fa-mobile fa-2x" aria-hidden="true"></i></a>'; return retVal; }},*/ ], rowNum:20, rowTotal: 2000, rowList : [20,50,100,400,800,1600], rownumbers: true, //rownumWidth: 60, pager:"#pager7", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Aproved Bank Sale Agreement", //Subgrid1... subGrid: false, }); jQuery("#list7").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list7").jqGrid('navGrid','#pager7', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); function edit_customer_agreement_details(site_id) { window.location.href = '<?php echo site_url('edit-customer-agreement-details');?>/'+site_id; } function edit_bank_agreement_details(site_id) { window.location.href = '<?php echo site_url('edit-bank-agreement-details');?>/'+site_id; } function preview_mmg_grand_city_agreement(site_id) { window.location.href = '<?php echo site_url('18-grand-city-agreement');?>/'+site_id; } function fifteen_ambari_enclave_agreement(site_id) { window.location.href = '<?php echo site_url('15-ambari-enclave-agreement');?>/'+site_id; } function seventeen_grand_city_agreement(site_id) { window.location.href = '<?php echo site_url('17-grand-city-agreement');?>/'+site_id; } function load_grid(id,site_id,layout_id) { $("#list3").setGridParam( { url:"<?php echo site_url('Booking-followup-list/')?>"+id+'/'+site_id+'/'+layout_id, page:1 } ).trigger("reloadGrid");//Reload grid trigger $("#list3").setGridParam({datatype:'json', page:1}).trigger('reloadGrid'); return false } $("#list3").jqGrid({ url:"<?php echo site_url('Booking-followup-list/0/0/0')?>", mtype : "get", datatype: "json", colNames:['id','Description','Follow Date','Progress','Employee','Department','Layout Name','Site No','Created By','Created At','Created Time'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'description',index:'description', width:300, hidden:false,editable:false}, {name:'follow_date',index:'follow_date', width:100, hidden:false,editable:false,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'progress',index:'progress', width:250, hidden:false,editable:false}, {name:'employee',index:'employee', width:250, hidden:false,editable:false}, {name:'department',index:'department', width:300, hidden:false,editable:false}, {name:'layout_name',index:'layout_name', width:100, hidden:false,editable:false}, {name:'site_no',index:'site_no', width:100, hidden:false,editable:false}, {name:'name',index:'name', width:100, hidden:false,editable:false}, {name:'created_at',index:'created_at', width:100, hidden:false,editable:false,formatter: 'date', formatoptions: { newformat: 'd-m-Y' }}, {name:'created_time',index:'created_time', width:100, hidden:false,editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [20,30], rownumbers: true, //rownumWidth: 60, pager:"#pager3", sortname:'id', viewrecords: true, gridview: true, // autowidth: true, sortorder:"asc", shrinkToFit: true, loadonce:true, autoencode: true, caption:"Customer Enquiry List", }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, closeAfterDelete:true, closeAfterEdit:true }, ); $('.progress_type').change(function() { var type = $(this).val(); if(type == "Finalized Reject") { $('.date-picker').removeAttr('required'); $('.followup_date').hide(); } else { $('.date-picker').prop('required',true); $('.followup_date').show(); } }); $('.booking_layout_id').change(function() { var id = $(this).val(); $.ajax({ type:'post', url:'<?php echo site_url('get-site-based-on-layout');?>', data:{'layout_id':id}, success:function(response){ response=jQuery.parseJSON(response) if(response.result==1) { var con1 = ''; con1 += '<label for="name">Site No</label>'; con1 += '<select type="text" class="form-control site_list" name="site_id">'; con1 += '<option value="">Select</option>'; $.each( response.sites, function( key, value2 ) { con1+='<option value="'+value2.id+'" >'+value2.site_no+'</option>'; }); con1 += '</select> '; $('#leaves1').empty(); $('#leaves1').append(con1); } else { $('#leaves1').empty(); toastr["error"](response.message); } } }); }); $('.employee_name').change(function() { var employee_name = $(this).val(); $.ajax({ type:'post', url:'<?php echo site_url('get-department-based-on-employee');?>', data:{'employee_name':employee_name}, success:function(response){ response=jQuery.parseJSON(response); if(response.result==1) { $('#department_name').empty(); $('#department_id').empty(); $('#department_name').val(response.message.dept_name); $('#department_id').val(response.message.id); } else { $('#department_id').empty(); toastr["error"](response.message); } } }); }); $(function() { $('.date-picker1').datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'd-m-yy', }); }); $('.date_picker').datepicker({ changeMonth:true, changeYear:true, yearRange: "1940:c", //dateFormat: 'yy-mm-dd' dateFormat: 'dd-mm-yy' }); $('.booking_calendar').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:c", //dateFormat: 'yy-mm-dd' dateFormat: 'dd-mm-yy' }); $('.booking_calendar1').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:c", //dateFormat: 'yy-mm-dd' dateFormat: 'dd-mm-yy' }); $('#selected_project').change(function() { var layout_name = $(this).val(); $.ajax({ type:'post', url:'<?php echo site_url('fetch-sites-id');?>', data:{"layout_name":layout_name}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { var con = ''; con += '<select name="site_number" class="form-control get_dimsension" id="find_bookings">'; con += '<option value="">select</option>'; $.each( response.message, function( key, value ) { con += '<option value="'+value.id+'">'+value.site_no+'</option>'; }); con += '</select>'; $('.site_number').empty(); $('.site_number').append(con); } else { toastr["error"](response.message); } } }); }); $('.add_forms').submit(function(e) { e.preventDefault(); formdata = new FormData($(this)[0]); $(".add").attr('disabled', 'disabled'); $(".add").text("Submtting..."); $.ajax({ type : 'post', url : '<?php echo site_url("add-booking-followups")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { $('#myModal').modal('hide'); toastr["success"](response.message); $('.add_forms')[0].reset(); $(".add").text("Submit"); $(".add").removeAttr('disabled'); $("#list3").setGridParam({datatype:'json', page:1}).trigger('reloadGrid'); $("#list2").setGridParam({datatype:'json', page:1}).trigger('reloadGrid'); } else { toastr["error"](response.message); $(".add").text("Submit"); $(".add").removeAttr('disabled'); $("#list3").setGridParam({datatype:'json', page:1}).trigger('reloadGrid'); } } }); }); </script> <style type="text/css"> .midd{ background: gray; margin-bottom: 20px; } .midd p{ padding-top: 10px; padding-bottom: 10px; text-align: center !important; color: white; } #modal_input{ height: 48px; } #btn{ color:#D9554B; } .modal-header{ padding: 10px 26px !important; } .modal-body { padding: 0px 26px !important; } .modal-footer { padding: 10px 31px !important; justify-content: center !important; } pre { background-color: transparent; border: 1px solid transparent; line-height: 1.6; text-align: justify; } .form-control:focus, input[type="Submit"]:focus, input[type="button"]:focus { border-color: #FF0000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.6); } .modal-content{ width: 150%; background: aliceblue; } #ui-id-1{ margin-left: 1128px; width: 190.859px; margin-top: 218px; } #search{ margin-right: 30px; } #ui-id-1{ height: 250px; overflow-y: scroll; } </style> <?php $this->load->view('includes/footer.php')?> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <!--<script src="https://code.jquery.com/jquery-1.12.4.js"></script>--> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>