ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/customer.php |
<?php require_once('header.php'); ?> <script type="text/javascript" language="javascript" > $(document).ready(function() { $("#excel_client_id").select2(); $("#customer_type").select2(); function getData(){ var client_id= $('#excel_client_id').val(); var branch_id= $('#branch_id').val(); var customer_type= $('#customer_type').val(); var dataTable = $('#employee-grid').DataTable( { "processing": true, "serverSide": true, "destroy":true, "ajax":{ url :"data-tables/customer_dt.php", // json datasource data: {branch_id:branch_id,client_id:client_id,customer_type:customer_type}, type: "post", // method , by default get error: function(){ // error handling $(".employee-grid-error").html(""); $("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>'); $("#employee-grid_processing").css("display","none"); } } } ); } function branchDetails(){ // branch and Employee Details Set /*var branch = $("#branch").val();*/ $.ajax({ url: 'data-tables/custom-function.php', type: 'post', data: {type:'get_branch'}, success: function(response) { var datas = JSON.parse(response) $('#branch_id').empty(); var tot = datas.length; if(tot==0) { $('#branch_id') .append($("<option></option>") .attr("value", '0') .text("Employee Not Available")); } else { $('#branch_id') .append($("<option></option>") .attr("value", '0') .text("All Branch")); } for (var index = 0; index < tot; index++) { $('#branch_id') .append($("<option></option>") .attr("value", datas[index]['id']) .text(datas[index]['branch_name'])); } } }); } function clientDetails(){ // branch and Employee Details Set var branch = $("#branch_id").val(); if(branch!=0){ $.ajax({ url: 'data-tables/custom-function.php', type: 'post', data: {type:'get_client',branch_id:branch}, success: function(response) { var datas = JSON.parse(response) $('#excel_client_id').empty(); var tot = datas.length; if(tot==0) { $('#excel_client_id') .append($("<option></option>") .attr("value", '0') .text("Client Not Available")); } else { $('#excel_client_id') .append($("<option></option>") .attr("value", '0') .text("All Client")); } for (var index = 0; index < tot; index++) { $('#excel_client_id') .append($("<option></option>") .attr("value", datas[index]['id']) .text(datas[index]['client_name'])); } } }); }else{ $('#excel_client_id').empty(); $('#excel_client_id') .append($("<option></option>") .attr("value", '0') .text("All Client")); } } branchDetails(); clientDetails(); getData(); $('#excel_client_id').on('change', function(){ getData(); } ); $('#customer_type').on('change', function(){ getData(); } ); $('#branch_id').on('change', function(){ clientDetails(); getData(); } ); } ); </script> <section class="content-header" style="background-color: white;"> <div class="row"> <div class="col-md-6" style="text-align: left;"> <h4><i class="fa fa-info-circle"></i> View Customer's</h4> </div> <div class="col-md-6" style="text-align: left;"> <?php if($_SESSION['lily_express_software_live']['id']==1 || $allPermissions['customer']['create']=="1" ){ ?><a href="customer-add.php" class="btn btn-success btn-sm"><i class="fa fa-plus"></i> Add Customer</a> <?php } ?> <?php if($_SESSION['lily_express_software_live']['id']==1 || $allPermissions['customer']['bulkupload']=="1" ){ ?><a href="customer_bulk_upload.php" class="btn btn-warning btn-sm"><i class="fa fa-upload"></i> Bulk Upload</a> <?php } ?> </div> </div> <div class="row"> <div style="padding-bottom: 25px;padding-top: 10px;"> <div class="col-md-3" style="text-align: center;"> <b>Branch</b> </div> <div class="col-md-4" style="text-align: center;"> <b>Client</b> </div> <div class="col-md-3" style="text-align: center;"> <b>Type</b> </div> <div class="col-md-2" style="text-align: left;"> <b>Action</b> </div> </div> <form action="excel/excel-customer.php" method="POST"> <div style="padding-bottom: 25px;padding-top: 10px;"> <div class="col-md-3"> <select class="form-control select2" name="branch_id" id="branch_id"> <?php if($_SESSION['lily_express_software_live']['id']==1){ ?> <option value="0">All Branch</option> <?php } ?> </select> </div> <div class="col-md-4"> <select class="form-control select2" name="excel_client_id" id="excel_client_id"> <option value="0">All Client</option> </select> </div> <div class="col-md-3" style="text-align: center;"> <select class="form-control" name="customer_type" id="customer_type"> <option value='all'>All Customer's</option> <option value='one_time'>One Time Customer</option> <option value='regular'>Regular Customer</option> </select> </div> <div class="col-md-2" style="text-align: center;"> <input type="hidden" id="role" name="role" value="<?=$clientType ?>"> <button id="get_report" type="submit" class="btn btn-sm btn-success"><i class="fa fa-upload"></i> Export As Excel</button> </div> </div> </form> </div> <div class="row"> <div class="col-md-12"> <div > <div class="table-responsive"> <table id="employee-grid" class="table table-bordered table-striped"> <thead> <tr> <th width="30">SL</th> <th>Action</th> <th>Customer Name</th> <th>Code</th> <th>City</th> <th>Pincode</th> <th>Address</th> <th>Client Name</th> <th>Destination City</th> </tr> </thead> </table> </div> </div> </div> </div> </section> <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Delete Confirmation</h4> </div> <div class="modal-body"> <p>Are you sure want to delete this item?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <a class="btn btn-danger btn-ok">Delete</a> </div> </div> </div> </div> <?php require_once('footer.php'); ?>