EVOLUTION-NINJA
Edit File: loans_list.php
<?php echo view('includes/header');?> <section class="content-header"> <h1>Loans list </h1> </section> <!--- section 1 --> <section class="content"> <div role="tabpanel" class="tab-pane" id="loans_list"> <form id="land_owner" class="form-inline loans_list"> <div class="row" style="padding-bottom:20px; padding-top:10px;"> <!-- <label class="col-sm-4">Payment mode</label>--> <label class="col-sm-2" style="margin-left: 17px;">Project Status</label> <div class="col-sm-12 col-md-5"> <label class="radio-inline"><input type="radio" value="Ongoing" id="ongoing_type" name="l_project_type">Ongoing</label> <label class="radio-inline"><input type="radio" value="Completed" id="completed_type" name="l_project_type">Completed</label> </div> <div class="col-sm-0 col-md-5"> <!-- <input class="btn btn-default payment_btn1" type="button" style="width:22% !important;" value="Print"> --> </div> </div> <!-- row 8----> <div class="row land_owner_a"> <div class="form-group col-sm-12 col-md-3"> <label class="col-sm-4 ">Project</label> <select class="form-control col-sm-8 l_project_list" name="l_project_id" id="l_project_id"> <option value="">select</option> <!-- <?php foreach($projects as $val) { ?> <option value="<?php echo $val->project_id;?>"><?php echo $val->project_name;?></option> <?php } ?> --> </select> </div> <div class="form-group col-sm-12 col-md-3"> <label class="col-sm-4"></label> <button type="submit" id="loan_submit" style="margin-top: 0px !important" class="btn btn-primary center-block loan_submit" >Submit</button> </div> </div> </form> <div class="row" style="padding-left:20px; padding-top:25px;"> <div style="margin-left:20px;padding-right:20px;"> <div id = "jaytab3" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </section> <!--- section 2 --> <section> <div class="row" style="padding-left:20px; padding-top:25px;"> <div style="margin-left:20px;padding-right:20px;"> <div id = "jaytab4" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid"> <div class="grid_div"></div><table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </section> </div> <style type="text/css"> .content-wrapper, .right-side { //min-height:900px !important; } a { color: inherit; } .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); } #FrmGrid_list2 { width: 100% !important; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 50%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 27px !important; background:#AF0100 !important; color:white !important; } .ui-jqgrid-bdiv { height: 232px !important; } .ui-widget-overlay { z-index:0 !important; } .ui-widget-header { background: #1e7ad7 !important; } .ui-jqgrid-hdiv ui-state-default { width: 873px !important; cursor: default!important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } .ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll; //overflow-x: hidden; } .agr_appr { font-weight:bold !important; color:#AF0100; cursor: pointer; } </style> <!-- This is the Javascript file of jqGrid --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>" /> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid.css'); ?>" /> <script src="<?php echo base_url('public/assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function (){ var $radios = $('input:radio[name=l_project_type]'); if($radios.is(':checked') === false) { $radios.filter('[value=Ongoing]').prop('checked', true); } var value = $('input[name=l_project_type]:checked').val(); $.ajax({ type : 'post', url : '<?php echo base_url("check_project_type_status")?>', data : {value:value}, success:function(response){ // response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="">Select</option>'; $.each(response.message , function (index, value){ options += '<option value="' + value.project_id + '">' + value.project_name + '</option>'; $('#l_project_id').html(options); }); } } }); }); $("input[name='l_project_type']").change(function(){ var value = $('input[name=l_project_type]:checked').val(); $.ajax({ type : 'post', url : '<?php echo base_url("check_project_type_status")?>', data : {value:value}, success:function(response){ // response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var options = ''; options += '<option value="">All</option>'; $.each(response.message , function (index, value){ options += '<option value="' + value.project_id + '">' + value.project_name + '</option>'; }); $('#l_project_id').html(options); } else { toastr["error"](response.message); } } }); }); $('.loans_list').submit(function(e){ e.preventDefault(); $("#loan_submit").attr('disabled', 'disabled'); $("#loan_submit").text("submitting..."); $("#loan_submit").text("Submit"); $("#loan_submit").removeAttr('disabled'); var l_project_id=$('select[name=l_project_id]').val(); //alert(l_project_id) jQuery("#list3").jqGrid({ url:"<?php echo site_url('get-loans-list')?>?l_project_id="+l_project_id, mtype : "get", datatype: "json", colNames:['SI','Booked Date','Project','Site','Source','Customer Name','Customer Email','Customer Mobile1','Customer Mobile2','Action','Address','Executive','Agree due Date','Agree Executed On'], colModel:[ {name:'booking_id',index:'booking_id', width:50, hidden:true,editable:false,key:true}, {name:'booked_on',index:'booked_on', sorttype: 'date', width:150,formatter: 'date', formatoptions: { srcformat: 'Y-m-d', newformat: 'd-m-Y'}, editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'site_number',index:'site_number', width:150, editable:false}, {name:'source_type',index:'source_type', width:150, editable:false}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:' ',index:' ',editable:false,align: "center",editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="reg_fun($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='ADD' \>"; }}, {name:'address',index:'address', width:150, editable:false}, {name:'reference',index:'reference', width:150, editable:false}, {name:'agreement_due_date',index:'agreement_due_date',formatter: 'date', formatoptions: { srcformat: 'Y-m-d', newformat: 'd-m-Y'}, width:200, editable:false}, {name:'agreement_executed_on',index:'agreement_executed_on', width:200, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'booked_on', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Loans List", }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); jQuery("#list4").jqGrid({ url:"<?php echo site_url('get-loansagree-list')?>?l_project_id="+l_project_id, mtype : "get", datatype: "json", colNames:['SI','Agree Executed On','Project','Site','Source','Customer Name','Customer Email','Customer Mobile1','Customer Mobile2','Address','Executive','Agree due Date'], colModel:[ {name:'booking_id',index:'booking_id', width:50, hidden:true,editable:false,key:true}, {name:'agreement_executed_on',index:'agreement_executed_on',sorttype: 'date', width:200,formatter: 'date',formatoptions: { srcformat: 'd-m-Y', newformat: 'd-m-Y'},editable:false}, {name:'project_name',index:'project_name', width:150, editable:false}, {name:'site_number',index:'site_number', width:150, editable:false}, {name:'source_type',index:'source_type', width:150, editable:false}, {name:'customer_name',index:'customer_name', width:150, editable:false}, {name:'customer_email',index:'customer_email', width:150, editable:false}, {name:'customer_mobile',index:'customer_mobile', width:150, editable:false}, {name:'customer_mobile2',index:'customer_mobile2', width:150, editable:false}, {name:'address',index:'address', width:150, editable:false}, {name:'reference',index:'reference', width:150, editable:false}, {name:'agreement_due_date',index:'agreement_due_date',formatter: 'date', formatoptions: { srcformat: 'Y-m-d', newformat: 'd-m-Y'}, width:200, editable:false}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager4", sortname:'agreement_executed_on', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:" Loans List", }); $("#list4").jqGrid("setLabel", "rn", "SL"); $("#list4").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list4").jqGrid('navGrid','#pager4', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); }); function reg_fun(rowId) { var booking_id = rowId.closest('tr').attr('id'); window.location.href="<?php echo site_url('loan-form')?>/"+ booking_id; } </script> <?php echo view('includes/footer');?>