<?php 

include("inc/config.php");


  
    $dest= $_POST['dest'];
    $orig = $_POST['orig'];
   
    
    
    	       $statement = $pdo->prepare("SELECT pickup_entry.*,tbl_user.full_name as client_name FROM `pickup_entry` inner join tbl_user ON  pickup_entry.client_id=tbl_user.id WHERE pickup_entry.destination='$dest' and pickup_entry.status='picked' order by pickup_entry.id DESC");   
            	$statement->execute();
            	$result = $statement->fetchAll(PDO::FETCH_ASSOC);							
                $i=1;
                foreach ($result as $row) {
                    //  $created=date_create($row['added']);
                    //  $da=date_format($created,'Y-m-d');
                     
                        echo'<tr>';
                       echo '<td>'. $i.'</td>';
                       echo '<td><input type="checkbox" class="checkbox" name="checkboxlist" value="'. $row['id'].'"/></td>';
                       echo '<td>'. $row['ref_no'] .'</td>';
                    //   echo '<td>'. $row['cust_code'] .'</td>';
	                   echo '<td>'. $row['pics'] .'</td>';
	                   echo '<td>'. $row['address'].'</td>';
	                   //echo '<td>'. $row['pincode'] .'</td>';
	                   echo '<td>'. $row['phone'] .'</td>';
	                   //echo '<td>'. $row['a_weight'] .'</td>';
	                   echo '<td>'. $row['c_weight'].'</td>';
	                   echo '<td>'. $row['destination'] .'</td>';
	                   //echo '<td>'. date_format($created,'d/m/Y') .'</td>';
	                   echo '<td>'. $row['client_name'] .'</td>';
	                   echo '</tr>';
	  	                              $i++;
        } 
    ?>