ok
Direktori : /proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/ |
Current File : //proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/delivery.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 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('#status').on('change',function(){ var status= $('#status').val(); if(status=='Delivered'){ $("#delivered").show(); $("#undelivered").hide(); } else if(status=='Undelivery'){ $("#delivered").hide(); $("#undelivered").show(); } else { $("#delivered").hide(); $("#undelivered").hide(); } }); }); </script> <script type="text/javascript" language="javascript" > $(document).ready(function() { function getData(){ var values = $('#set_status').val(); console.log('set_status :'+values); var s=''; // if(values=='pending'){ s+='<option value="picked">Picked</option>'; //}else if(values=='picked'){ s+='<option value="manifest">Manifest</option><option value="In Transit">In Transit</option>'; //} // else if(values=='manifest'){ // s+='<option value="In Transit">In Transit</option>'; // } // else if(values=='In Transit'){ s+='<option value="Received at destination">Received at destination</option>'; // } // else if(values=='Received at destination'){ s+='<option value="Out for delivery">Out for Delivery</option>'; // } // else if(values=='Out for delivery'){ s+='<option value="Delivered">Delivered</option><option value="Undelivery">Undelivery</option><option value="Return To Origin">Return To Origin</option>'; // } // else if(values=='Undelivery'){ // s+='<option value="Delivered">Delivered</option>'; // } $('#status').empty(); $('#status').append(s); 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(); console.log("client id details"+role_id); if(role_id==null){ role_id="all"; } // alert(from); var dataTable = $('#employee-grid').DataTable( { "processing": true, "serverSide": true, "aaSorting":[[0,'desc']], "destroy":true, "ajax":{ url :"data-tables/delivery-data-table.php", // json datasource data: {client_id:role_id,client_type:role,from:from,to:to,status:set_status,entry_type:entry_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(); /*$('#set_status').keyup(function(){ var from_date= $('#from').val(); if(from_date){ getData(); } else { alert('Select a Date !!'); } });*/ $('#set_status,#client_id').change(function(e) { var values = $('#set_status').val(); console.log('set_status :'+values); var s=''; // if(values=='pending'){ s+='<option value="picked">Picked</option>'; // }else if(values=='picked'){ s+='<option value="manifest">Manifest</option><option value="In Transit">In Transit</option>'; // } // else if(values=='manifest'){ // s='<option value="In Transit">In Transit</option>'; // } // else if(values=='In Transit'){ s+='<option value="Received at destination">Received at destination</option>'; // } // else if(values=='Received at destination'){ s+='<option value="Out for delivery">Out for Delivery</option>'; // } // else if(values=='Out for delivery'){ s+='<option value="Delivered">Delivered</option><option value="Undelivery">Undelivery</option><option value="Return To Origin">Return To Origin</option>'; // } // else if(values=='Undelivery'){ //s='<option value="Delivered">Delivered</option>'; // } // else if(values=='In Transit'){ // s='<option value="In Transit">In Transit</option>'; // } // else{ // } $('#status').empty(); $('#status').append(s); var from_date= $('#from').val(); if(from_date){ getData(); }else{ alert('Select a Date !!'); } }); $('#get_report').on('click', function(){ var from_date= $('#from').val(); if(from_date){ getData(); } else { alert('Select a Date !!'); } } ); } ); </script> <script type="text/javascript"> $(document).ready(function(){ $("#client_id").select2(); $("#set_status").select2(); $('#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); } }); }); function updatestatusTo(){ var status=$('#status').val(); var r_name=$('#r_name').val(); var r_mobile=$('#r_mobile').val(); var r_relation=$('#r_relation').val(); var r_delivery_date=$('#r_delivery_date').val(); var reason=$('#reason').val(); var remark=$('#remark').val(); var destination= $('#destination').val(); var status_date= $('#status_date').val(); var checkValues = $('input[name=checkboxlist]:checked').map(function() { return $(this).val(); }).get(); if(status!=''){ if(checkValues!=""){ $.ajax({ url: 'delivery_status_update.php', type: 'post', data: {pickup_id:checkValues,status:status,r_name:r_name,r_mobile:r_mobile,r_relation:r_relation,r_delivery_date:r_delivery_date,reason:reason,remark:remark,destination:destination,status_date:status_date}, dataType: 'json', success: function(response) { //alert(response); if(response==1) { alert('Status Updated SuccessFully !!'); location.reload(); } else{ alert('Failed To Assign !!'); location.reload(); } } }); } else{ alert('No Value Selected'); } }else{ alert('Select Updated Status Name'); } } </script> <section class="content-header"> <div class="row"> <div class="col-md-8" style="text-align: center;"> <h4><i class="fa fa-info-circle"></i> Pickup Entry Update Status</h4> </div> <div class="col-md-4" style="text-align: right;"> <a href="delivery_bulk_upload.php" class="btn btn-primary btn-sm">Bulk Upload</a> </div> </div> <div class="row"> <div style="padding-bottom: 25px;padding-top: 10px;"> <div class="col-md-2" style="text-align: center;"> <b>From</b> </div> <div class="col-md-2" style="text-align: center;"> <b>To</b> </div> <div class="col-md-3" style="text-align: center;"> <b>Client</b> </div> <div class="col-md-2" style="text-align: center;"> <b>Status</b> </div> <div class="col-md-2" style="text-align: center;"> <b>Entry Type</b> </div> <div class="col-md-1" style="text-align: center;"> <b>Action</b> </div> </div> <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;"> <input type="date" class="form-control" id="from" value="<?php echo $old_date ?>" name="from"> </div> <div class="col-md-2" style="text-align: center;"> <input type="date" class="form-control" id="to" value="<?php echo $today ?>" name="to"> </div> <div class="col-md-3" style="text-align: center;"> <select class="form-control" name="client_id[]" id="client_id" multiple> <?php $wheres=""; if($clientType=="Admin") { ?><option value="all" >All Client's </option> <?php }else{ $wheres=" and id=".$clientId;} ?> <?php $statement = $pdo->prepare("SELECT * FROM tbl_user WHERE (role='client' or role='Modicare' or role='Cargo') $wheres ORDER BY id ASC"); $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($result as $row) { ?> <option value="<?php echo $row['id']; ?>" <?php if(count($result)==1){ echo 'selected';} ?>><?php echo $row['full_name']; ?></option> <?php } ?> </select> </div> <div class="col-md-2" style="text-align: center;"> <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> <option value='Return To Origin'>Return To Origin</option> </select> </div> <div class='col-md-2'> <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-1" style="text-align: center;"> <span class="btn btn-success btn-sm" id="get_report"><i class="fa fa-filter"></i> Filter</span> </div> </div> </div> <!--Bulk Upload Code End--> </section> <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" /></th> <th>AWB Number</th> <th>Ref Number</th> <th>Date</th> <th>Company Name</th> <!--<th>Address</th>--> <th>Mobile Number</th> <th>Status</th> <!--<th>Payment Mode</th>--> <th>Customer Name</th> <th>Destination</th> </tr> </thead> </table> </div> </div> </div> </div> <br> <br> <div class="row"> <div class="col-md-12"> <div class="col-md-8"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Select Status <span>*</span></label> <div class="col-sm-6"> <select name="status" class="form-control" id='status'> </select> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Status Update Date <span>*</span></label> <div class="col-sm-6"> <input type="date" autocomplete="off" class="form-control" name="status_date" value="<?php echo date("Y-m-d") ?>" id="status_date" required> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Status Update Location <span>*</span></label> <div class="col-sm-6"> <input type="text" class="form-control" name="destinaton" id="destination" value="Bangalore"> </div> </div> </div> <div id='delivered' style="display:none;padding-top: 4%;" > <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Receiver Name <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="r_name" id="r_name" value=""> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Receiver Mobile <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="r_mobile" id="r_mobile" value=""> </div> </div> </div> <div style="padding-top: 4%;"> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Relation <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="r_relation" id="r_relation" value=""> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Delivery Date <span>*</span></label> <div class="col-sm-6"> <input type="date" autocomplete="off" class="form-control" name="r_delivery_date" id="r_delivery_date" value=""> </div> </div> </div> </div> </div> <div id='undelivered' style="display:none;padding-top: 4%;"> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Reason <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="reason" id="reason" value=""> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="" class="col-sm-6 control-label text-right">Remark <span>*</span></label> <div class="col-sm-6"> <input type="text" autocomplete="off" class="form-control" name="remark" id="remark" value=""> </div> </div> </div> </div> <div class="col-md-4"> <center><button class="btn btn-primary btn-sm" onclick="updatestatusTo();">Update Status</button></center> </div> <br> <br> <br> <br> <br> <br> <br> </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'); ?>