<?php 
ob_start();
session_start();
include("../inc/config.php");

$cond='where 1=1 ';
$search="";
$conditions='';

$cli="";

if(isset($_REQUEST['status']) && $_REQUEST['status']==$_REQUEST['drs_update']){
    $cond.=" and status_code!=5";
}

if(isset($_REQUEST['status']) && $_REQUEST['status']==$_REQUEST['delivery_update']){
    $cond.=" and status_code=4";
}

if(isset($_REQUEST['search_text'])){
    $search .=$_REQUEST['search_text'];
}

$cond .= " AND (cscs_awb like '%" . $search . "%' OR cscs_awb like '%" . $search . "%')";
    $statement = $pdo->prepare("SELECT * FROM pickup_entry  $cond $conditions limit 10");
    $statement->execute();
    $emp_data = $statement->fetchAll(PDO::FETCH_ASSOC);
    $totalData = $statement->rowCount();
    
   /*INR Symbol₹*/
    if($totalData>0){
        foreach($emp_data as $res){
            echo '<div onclick="product_selection('.$res['id'].')">
                   <i class="fa fa-barcode" style="font-size:12px;color:blue"></i> <span awb_id='.$res['id'].' class="drop-down-awb" style="color:blue">'.$res['cscs_awb'].'</span> &nbsp;&nbsp; <b style="color:#f39c12">('.strtoupper($res['status']).')</b><br>
                   Boxs  : <b style="color:#f39c12">'.$res['boxes'].'</b> , Wt : <b style="color:#f39c12">'.$res['a_weight'].' </b><br>
                   Client  : <b style="color:#f39c12">'.$res['shipper_name'].' </b><br>
                   Consignor  : <b style="color:#f39c12">'.$res['shipper_name'].' </b><br>
                   Consignee  : <b style="color:#f39c12">'.$res['consignee_name'].'</b> <br>
                 </div>';
        }
        
    }else{
        echo '';
    }
$pdo = null;
?>