ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/reprint-pickup-entry.php |
<?php require_once('header.php'); $old_date = date('Y-m-d', strtotime("-30 days")); /*Change the date for past days selection*/ $today=date('Y-m-d'); ?> <script type="text/javascript" language="javascript" > $(document).ready(function() { $('#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); } }); $("#client_id").select2(); $("#set_status").select2(); function getData(){ var from= $('#from').val(); var to= $('#to').val(); var role= $('#role').val(); var role_id= $('#client_id').val(); var set_status= $('#set_status').val(); var entry_type= $('#entry_type').val(); var awb_type= $('#awb_type').val(); var dataTable = $('#employee-grid').DataTable( { "processing": true, "serverSide": true, "aaSorting":[[0,'desc']], "lengthMenu": [ [10,25,50,100, 250, 500,1000,2000,2500,5000, 10000,20000,25000], [10,25,50,100, 250, 500,1000,2000,2500,5000, 10000,20000,25000], ], "destroy":true, "ajax":{ url :"data-tables/reprint-entry.php", // json datasource data: {client_id:role_id,client_type:role,from:from,to:to,status:set_status,entry_type:entry_type,awb_type:awb_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"); } } } ); } getData(); $('#get_report').on('click', function(){ var from_date= $('#from').val(); if(from_date){ getData(); } else { alert('Select a Date !!'); } } ); $('#btn_delete_shipments').on('click',function(){ var checkValues = $('input[name=checkboxlist]:checked').map(function(){ return $(this).val(); }).get(); if(checkValues != ''){ var r = confirm("Confirm if You Want to Delete Those Pickup Entry?"); if (r == true) { var ids=[]; ids = checkValues; console.log('Delete ids :'+ids); $.ajax({ url: 'data-tables/custom-function.php', type: 'post', data: {type:'delete_pickup_entry',delete_id:ids}, success: function(response){ console.log(response); //alert("test..."); //$('#status').val(0); getData(); } }); } //window.location.href="shipment-picked.php?shipment_id="+ids+"&status="+status; }else{ alert("Pls Select Min One Pickup Entry to Delete..."); } }); } ); function redirectTo(){ var checkValues = $('input[name=checkboxlist]:checked').map(function() { return $(this).val(); }).get(); // alert(checkValues); var ids=[]; ids = checkValues; // some thing like this you can set value for 1st Param. window.location.href="awb_number_print.php?list_id="+ids; } function redirectTolable(){ var checkValues = $('input[name=checkboxlist]:checked').map(function() { return $(this).val(); }).get(); // alert(checkValues); var ids=[]; ids = checkValues; // some thing like this you can set value for 1st Param. window.location.href="lable_print.php?list_id="+ids; } function redirectToAddressPrint(){ var checkValues = $('input[name=checkboxlist]:checked').map(function() { return $(this).val(); }).get(); // alert(checkValues); var ids=[]; ids = checkValues; // some thing like this you can set value for 1st Param. window.location.href="lable-print-with-address.php?list_id="+ids; } </script> <section class="content-header" style="background-color: white;"> <div class="row"> <div class="col-md-12" style="text-align: center;"> <h4><i class="fa fa-info-circle"></i> All Pickup Entry Details</h4> </div> </div> <div class="row"> <form action="excel/overall-report.php" method="POST"> <input type="hidden" id="role" name="role" value="<?php echo $clientType; ?>"> <div style="padding-bottom: 25px;padding-top: 10px;"> <div class="col-md-2" style="text-align: center;"> <label for="to">From:</label> <input type="date" class="form-control" id="from" value="<?php echo date("Y-m-d") ?>" name="from"> </div> <div class="col-md-2" style="text-align: center;"> <label for="to">To:</label> <input type="date" class="form-control" id="to" value="<?php echo date("Y-m-d") ?>" name="to"> </div> <div class="col-md-3" style="text-align: center;"> <label for="to">Client:</label> <select class="form-control" name="client_id" id="client_id"> <?php $wheres=""; if($clientType=="Admin") { ?><option value="all" >Select Client Name </option> <?php }else{ $wheres=" and id=".$clientId;} ?> <?php $statement = $pdo->prepare("SELECT * FROM tbl_user WHERE role='client' or role='Modicare' $wheres ORDER BY id ASC"); $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-2'><label for="to">AWB Type:</label> <select class="form-control select2" name="awb_type" id="awb_type"> <option value=''>All</option> <option value='0'>Forward AWB</option> <option value='1'>Reversed AWB </option> </select> </div> <div class="col-md-2" style="text-align: center;"> <label for="to">Status:</label> <select class="form-control" name="set_status" id="set_status"> <option value='all'>All</option> <option value='pending'>Pending</option> <option value='picked'>Picked</option> <option value='manifest'>Manifest Created</option> <option value='In Transit'>In Transit</option> <option value='Received at destination'>Received at Destination</option> <option value='Out for delivery'>Out for delivery</option> <option value='Delivered'>Delivered</option> <option value='Undelivery'>Undelivery</option> </select> </div> <div class='col-md-2'><label for="to">Entry Type:</label> <select class="form-control select2" name="entry_type" id="entry_type"> <option value="">All</option> <option value="1">Normarl Booking</option> <option value="2">Api Booking</option> </select> </div> <div class="col-md-3" style="text-align: center;"> <label for="to">Action:</label> <br> <span class="btn btn-success btn-sm" id="get_report"><i class="fa fa-filter"></i> Filter</span> <button type="submit" class="btn btn-sm btn-primary" >Export As Excel</button> </div> </div> </form> </div> </section> <section class="content" style="background-color: white;"> <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 class="checkbox" type="checkbox" id="select_all" /></th> <th>AWB Number</th> <th>AWB Type</th> <th>DP Code</th> <th>Status</th> <th>Company Name</th> <th>Address</th> <th>Pincode</th> <th>Mobile Number</th> <th>Actual Weight</th> <th>Charged Weight</th> <th>No.Of Pics</th> <th>Date Added</th> <th>Date of Updated</th> <th>Customer Name</th> </tr> </thead> </table> </div> </div> </div> </div> <div class="content-footer-right" style="margin-left:45%"> <button class="btn btn-warning btn-sm" onclick="redirectToAddressPrint();">Lable Print With Address </button> <button class="btn btn-primary btn-sm" onclick="redirectTo();">Print AWB Number</button> <button class="btn btn-primary btn-sm" onclick="redirectTolable();">Print Label</button> <button class="btn btn-danger btn-sm" id="btn_delete_shipments"><i class="fa fa-trash-o"></i> Delete Pickup Entry</button> </div> <!-- <a href="#" id="xx" class="btn btn-sm btn-info">Testing</a><br><br><br><br>--> </section> <script type="text/javascript"> $(document).ready(function () { function exportTableToCSV($table, filename) { var $rows = $table.find('tr:has(td),tr:has(th)'), // Temporary delimiter characters unlikely to be typed by keyboard // This is to avoid accidentally splitting the actual contents tmpColDelim = String.fromCharCode(11), // vertical tab character tmpRowDelim = String.fromCharCode(0), // null character // actual delimiter characters for CSV format colDelim = '","', rowDelim = '"\r\n"', // Grab text from table into CSV formatted string csv = '"' + $rows.map(function (i, row) { var $row = $(row), $cols = $row.find('td,th'); return $cols.map(function (j, col) { var $col = $(col), text = $col.text(); return text.replace(/"/g, '""'); // escape double quotes }).get().join(tmpColDelim); }).get().join(tmpRowDelim) .split(tmpRowDelim).join(rowDelim) .split(tmpColDelim).join(colDelim) + '"', // Data URI csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv); console.log(csv); if (window.navigator.msSaveBlob) { // IE 10+ //alert('IE' + csv); window.navigator.msSaveOrOpenBlob(new Blob([csv], {type: "text/plain;charset=utf-8;"}), "csvname.csv") } else { $(this).attr({ 'download': filename, 'href': csvData, 'target': '_blank' }); } } // This must be a hyperlink $("#xx").on('click', function (event) { exportTableToCSV.apply(this, [$('#employee-grid'), 'export.csv']); // IF CSV, don't do event.preventDefault() or return false // We actually need this to be a typical hyperlink }); }); </script <?php require_once('footer.php'); ?>