<?php require_once('header.php'); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" language="javascript" >
			$(document).ready(function() {
			    var client_id   = $('#client_id').val();
			    var client_type = $('#client_type').val();
				var dataTable = $('#employee-grid').DataTable( {
					"processing": true,
					"serverSide": true,
					"ajax":{
						url :"data-tables/pending-pickup-entry-data-table.php", // json datasource
						data: {client_id:client_id,client_type:client_type,status:'1'},
						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");
							
						}
					}
				} );
			} );
		</script>
<script type="text/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);
        }
    });
});

   function updatestatusTo(){
        
         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="update_status_picked.php?pickup_id="+ids+"&type="+'modicare';

}
</script>
<section class="content-header">
	<div class="content-header-left">
		<h1>Pending Pickup Entry List</h1>
	</div>
	<div class="row">
	    <div class="col-md-12">
	 <div class="col-md-2">  
		<a href="excel/excel-all-pending.php" class="btn btn-danger btn-sm">Export as Excel</a>
	</div>
	<div class="col-md-2">  
	<div class="content-header-right" >
			<a href="pickup-entry-bulk-upload.php" class="btn btn-danger btn-sm">CSCS Bulk Upload</a>
	</div>
	</div>
	<div class="col-md-2">  
	<div class="content-header-right" >
			<a href="modicare-pickup-entry-add.php" class="btn btn-danger btn-sm">CSCS Single Pickup Entry</a>
	</div>
	</div>
	</div>
	</div>
</section>
<input type='hidden' name="client_id" id="client_id" value="<?php echo $clientId; ?>">
<input type="hidden" id="client_type" name="client_type" value="<?php echo $clientType; ?>">
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box box-info">
				<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>Action</th>
								<th data-sortable= false><i class="fa fa-check"></i><input type="checkbox" id="select_all" /></th>
								<?php  if($clientType=="Admin")	 { ?>	<th>Client</th><?php } ?>
								<th>CSCS AWB</th>
								<?php  if($clientType=="Admin")	 { ?>	<th>3PL AWB</th><?php } ?>
								<th>Ref No</th>
								<th>Order Type</th>
								<th>Shipper Name</th>
								<th>Shipper Address</th>
								<th>Shipper City</th>
								<th>Shipper State</th>
								<th>Shipper Phone</th>
								<th>Shipper Pincode</th>
								<th>Consignee Name</th>
								<th>Consignee Address</th>
								<th>Consignee City</th>
								<th>Consignee State</th>
								<th>Consignee Phone</th>
								<th>Consignee Pincode</th>
								<th>Volumetric Weight</th>
								<th>Volumetric Length</th>
								<th>Volumetric Breadth</th>
								<th>Volumetric Height</th>
								<th>Collectable Amount</th>
								<th>Product Description</th>
								<th>Quantity</th>
								<th>Boxes</th>
								<th>Invoice Value</th>
								<th>Taxable Value</th>
								<th>Hsn Code</th>
								<th>Discount</th>
								<th>Gst Amount</th>
								<th>MRP</th>
								<th>Ewaybill</th>
								<th>Actual Weight</th>
								<th>Charged Weight</th>
								<th>Gst Type</th>
								<th>Buyer Gst</th>
								<th>Seller Gst</th>
								<th>RTO Name</th>
								<th>RTO Address</th>
								<th>RTO City</th>
								<th>RTO State</th>
								<th>RTO Phone</th>
								<th>RTO Pincode</th>
								<th>Date Added</th>
							</tr>
						</thead>
						
					</table>
					
				</div>
			</div>
		</div>
	</div>

	<div class="content-footer-right" style="margin-left:45%">
	    <button class="btn btn-success btn-sm" onclick="updatestatusTo();">Update Status Picked</button>
	</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">&times;</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-success btn-ok">Delete</a>
            </div>
        </div>
    </div>
</div>


<?php require_once('footer.php'); ?>