ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/awb-list.php |
<?php require_once('header.php'); /*for($i=1200001;$i<=1400000;$i++){ $statement = $pdo->prepare("INSERT INTO tbl_awb (awb_code,client_id,status) VALUES (?,?,?)"); $statement->execute(array($i,28,)); }*/ ?> <style> /* The container */ .checkbox { display: block; padding-left: 35px; margin-bottom: 12px; cursor: pointer; font-size: 15px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /* Hide the browser's default checkbox */ .checkbox input { opacity: 0; cursor: pointer; height: 0; width: 0; } /* Create a custom checkbox */ .checkbox { height: 25px; width: 25px; background-color: #eee; } /* On mouse-over, add a grey background color */ .checkbox:hover input ~ .checkmark { background-color: #ccc; } /* When the checkbox is checked, add a blue background */ .checkbox input:checked ~ .checkmark { background-color: #f39c12; } /* Create the checkmark/indicator (hidden when not checked) */ .checkbox:after { content: ""; display: none; } /* Show the checkmark when checked */ .checkbox input:checked ~ .checkmark:after { display: block; } /* Style the checkmark/indicator */ .checkbox .checkbox:after { left: 9px; top: 5px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } /* The container */ .checkbox_delete { display: block; padding-left: 35px; margin-bottom: 12px; cursor: pointer; font-size: 15px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /* Hide the browser's default checkbox_delete */ .checkbox_delete input { opacity: 0; cursor: pointer; height: 0; width: 0; } /* Create a custom checkbox_delete */ .checkbox_delete { height: 25px; width: 25px; background-color: #eee; } /* On mouse-over, add a grey background color */ .checkbox_delete:hover input ~ .checkmark { background-color: #ccc; } /* When the checkbox_delete is checked, add a blue background */ .checkbox_delete input:checked ~ .checkmark { background-color: #f39c12; } /* Create the checkmark/indicator (hidden when not checked) */ .checkbox_delete:after { content: ""; display: none; } /* Show the checkmark when checked */ .checkbox_delete input:checked ~ .checkmark:after { display: block; } /* Style the checkmark/indicator */ .checkbox_delete .checkbox_delete:after { left: 9px; top: 5px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } </style> <script> function get_data() { var courier_id= $('#courier_id').val(); var logistic_id = $('#logistic_id').val(); var set_status= $('#set_status').val();var awb_type= $('#awb_type').val(); console.log(courier_id,set_status); var dataTable = $('#employee-grid').DataTable( { "processing": true, "serverSide": true, "bDestroy": true, "lengthMenu": [[10, 25, 50,100,1000,10000, 100000], [10, 25, 50,100,1000,10000, 100000]], "pageLength": 50 , "ajax":{ url :"data-tables/awb-list-data-table.php", // json datasource data:{courier_id:courier_id,status:set_status,awb_type:awb_type,logistic_id:logistic_id}, 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"); } } } ); } $(document).ready(function(){ get_data(); $('#get_awb_list').on('click', function(){ get_data(); }); $('#select_all').on('click',function(){ if(this.checked){ $('.checkbox').each(function(){ this.checked = true; }); }else{ $('.checkbox').each(function(){ this.checked = false; }); } }); $('.checkbox').on('click',function(){ if($('.checkbox:checked').length == $('.checkbox').length){ $('#select_all').prop('checked',true); }else{ $('#select_all').prop('checked',false); } }); $('#select_all_delete').on('click',function(){ if(this.checked){ $('.checkbox_delete').each(function(){ this.checked = true; }); }else{ $('.checkbox_delete').each(function(){ this.checked = false; }); } }); $('.checkbox_delete').on('click',function(){ if($('.checkbox_delete:checked').length == $('.checkbox_delete').length){ $('#select_all_delete').prop('checked',true); }else{ $('#select_all_delete').prop('checked',false); } }); }); function print_empty_invoice(){ var checkValues = $('input[name=checkboxlist]:checked').map(function() { return $(this).val(); }).get(); var ids=[]; ids = checkValues; // window.location.href="cargo-invoice-empty.php?list_id="+ids; window.open('cargo-invoice-empty.php?list_id='+ids, '_blank'); } function delete_awb(){ var checkboxlist_delete = $('input[name=checkboxlist_delete]:checked').map(function() { return $(this).val(); }).get(); var ids=[]; ids = checkboxlist_delete; if(ids.length>0){ //Do Some Delete Actions var r = confirm("Confirm if You Want to Delete Those Awb Number Details...?"); if (r == true) { $.ajax({ url: 'data-tables/custom-function.php', type: 'post', data: {type:'delete_awb_numbers',delete_id:ids}, success: function(response){ console.log(response); get_data(); } }); } }else{ alert('Delete Access Min Select One Awb Numbers...') } console.log('delete ids length :'+ids.length); console.log('delete ids:'+ids); } </script> <section class="content-header"> <div class="col-md-2"> <div class="form-group"> <a href="print-cargo-empty-number.php" class="btn btn-warning btn-sm"><i class="fa fa-plus" aria-hidden="true"></i> Create New Awb List</a> </div> </div> <div class="row" > <div class='col-md-3'> <label for="to">Client Name</label> <select class="form-control select2" name="courier_id" id="courier_id"> <?php if($_SESSION['lily_express_software_live']['id']=='1'){ $where_cus="";?> <option value="all">All Client's</option> <?php }else{ $where_cus=" and id=".$_SESSION['lily_express_software_live']['id'];} ?> <?php $statement = $pdo->prepare("SELECT * FROM `tbl_user` where 1=1 $where_cus"); $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { ?> <option value="<?php echo $row['id']; ?>"><?php echo $row['full_name']; ?></option> <?php } ?> </select> </div> <div class='col-md-3'> <label for="to">Logistic</label> <select class="form-control select2" name="logistic_id" id="logistic_id"> <option value="all">All Logistic's</option> <?php $statement = $pdo->prepare("SELECT * FROM `tbl_logistic`"); $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { ?> <option value="<?php echo $row['id']; ?>"><?php echo $row['name']; ?></option> <?php } ?> </select> </div> <div class='col-md-2'> <label for="to">Status:</label> <select class="form-control select2" name="set_status" id="set_status"> <option value='all'>All</option> <option value='1'>Available</option> <option value='0'>Used</option> <option value='2'>Waiting for Order Create</option> </select> </div> <div class='col-md-2'> <label for="to">AWB Type:</label> <select class="form-control select2" name="awb_type" id="awb_type"> <option value='all'>All</option> <option value='0'>Forwart AWB</option> <option value='1'>Reversed AWB </option> </select> </div> <div class='col-md-2' style="margin-top: 2%;"> <button id="get_awb_list" class="btn btn-sm btn-info"><span id='sub_txt'>Submit</span> <span id="sub_spin"></span></button> </div> </div> note: status :<br> 1.Available means -awb number still not used<br> 2.Used means -awb number shipment created<br> 3.Waiting for Order Create means -awb number client requested but still not order created </section> <center><!--<button class="btn btn-success btn-xs" onclick="print_empty_invoice();"><i class="fa fa-print"></i> Print Cargo Empty AWB Number</button>--> <button class="btn btn-danger btn-xs" onclick="delete_awb();"><i class="fa fa-print"></i> Delete AWB Numbers</button> </center> <section class="content"> <div class="row"> <div class="col-md-12"> <div> <div class="box-body table-responsive"> <table id="employee-grid" class="table table-bordered table-striped"> <thead> <tr> <th width="30">SL</th> <!--<th data-sortable="false"><i class="fa fa-check"></i><input type="checkbox" class='checkbox' id="select_all" /> Print</th>--> <th data-sortable="false"><i class="fa fa-check"></i><input type="checkbox" class='checkbox_delete' id="select_all_delete" /> Delete</th> <th>AWB Numbers</th> <th>Client Name</th> <th>Logistic Name</th> <th>Status</th> <th>AWB Type</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-sucess" data-dismiss="modal">Cancel</button> <a class="btn btn-sucess btn-ok">Delete</a> </div> </div> </div> </div> <?php require_once('footer.php'); ?>