ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/www/lilyexpresslive/software/admin/r-print.php

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

<section class="content" style="background-color: white;">
    
   <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">

	<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</b>
		</div>
		<div class="col-md-1" style="text-align: center;">		
			<b>Action</b>
		</div>
	</div>
<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;">		
			<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;">		
			<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;">	
		
		
		<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" 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>
            </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" onclick="getData()"><i class="fa fa-filter"></i> Filter</span><br>
			<button type="submit" class="btn btn-sm btn-primary" >Export As Excel</button>
		</div>
</div>
	</form>

	</div>
</section>
    
	<div class="row">
		<div class="col-md-12">
			<div>
				<div class="box-body table-responsive">
					<table id="example1" 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>Ref Number</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>
								<th>Destination</th>
							</tr>
						</thead>
						<tbody>
							<?php
							$cond="where tbl_user.role='Modicare'";
							if(isset($_GET['client_id'])){
							    $cond.=" and pickup_entry.client_id=".$_GET['client_id'];
							}
							if(isset($_GET['set_status'])){
							    $cond.=" and pickup_entry.client_id=".$_GET['client_id'];
							}
							if(isset($_GET['entry_type']) && $_GET['entry_type']!=""){
                               $condition=" and pickup_entry.entry_type=".$_GET['entry_type'];
                            }
							if(isset($_GET['set_status'])){
							    $cond.=" and pickup_entry.status='".$_GET['set_status']."'";
							}
							if(isset($_GET['from']) && isset($_GET['to'])){
							    $cond.=" and pickup_entry.created_at BETWEEN '2022-09-05' AND '2022-09-05'";
							}
							
							
							$i=0;
							$statement = $pdo->prepare("SELECT pickup_entry.*,tbl_user.full_name as client_name,pickup_entry.created_at as added,tbl_customer.cust_code as cust_code,material_desc.full_desc as content,tbl_customer.cust_name as cust_name FROM pickup_entry INNER JOIN tbl_user INNER JOIN tbl_customer INNER JOIN material_desc on pickup_entry.client_id=tbl_user.id AND pickup_entry.content_desc=material_desc.id AND pickup_entry.customer_id=tbl_customer.cust_id     ORDER BY id desc");
							$statement->execute();
							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
							foreach ($result as $row) {
								$i++;
								?>
								<tr>
									<td><?php echo $i; ?></td>
									<td><input type='checkbox' class='checkbox' name='checkboxlist' value="<?=$row['id']?>"/></td>
									<td><?php echo $row['ref_no']; ?></td>
									<td><?php echo $row['cust_code']; ?></td>
									<td><?php echo strtoupper($row["status"]);; ?></td>
									<td><?php echo $row["client_name"]; ?></td>	
									<td><?php echo $row['address']; ?></td>
									<td><?php echo $row['pincode']; ?></td>
									<td><?php echo $row["phone"]; ?></td>
                    	<td><?php echo $row["a_weight"];?></td>
                    	<td><?php echo $row["c_weight"];?></td>
                    	<td><?php echo $row["pics"];
                    	$day=date_create($row['added']);$created=date_format($day,'d-m-Y');?></td>
                    	<td><?php echo $created;
                    	$day=date_create($row['updated_at']);$updated_at=date_format($day,'d-m-Y');?></td>
                    	<td><?php echo $updated_at;?></td>
                    	<td><?php echo $row["cust_name"];?></td>
                    	<td><?php echo $row["destination"]?></td>
								
								</tr>
								<?php
							}
							?>							
						</tbody>
					</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>
</section>

<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();
	   
$('#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);
          }
        });
          }
            //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;

}



function getData(){
    var link='';
			    var from=  $('#from').val();     
                var to=  $('#to').val();   
                var client_id= $('#client_id').val();
                var set_status= $('#set_status').val();
                var entry_type= $('#entry_type').val();
                link.='&from='+from;
                link.='&to='+to;
                link.='&client_id='+client_id;
                link.='&set_status='+set_status;
                link.='&entry_type='+entry_type;
        
window.location.href="r-print.php?d=1&"+link;
				
			    }


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

Zerion Mini Shell 1.0