ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/public_html/lilyexpresslive/software/admin/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/public_html/lilyexpresslive/software/admin/check-awb.php

<?php

ob_start();
session_start();
include("inc/config.php");
date_default_timezone_set('Asia/Kolkata');
$date = date("Y-m-d");
if(isset($_POST["id"])) {
    
     $name = $_POST["id"];
if(isset($_POST["destination"])){$destination = $_POST["destination"];}else{ $destination=''; }
if(isset($_POST["gvalue"])){$gvalue = $_POST["gvalue"];}else{ $gvalue=''; }
    
                        
//  $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.ref_no like '%".$name."%' order by pickup_entry.id asc limit 3");
    if($gvalue==2){
                    $statement = $pdo->prepare("SELECT tbl_customer.cust_name as customer_name,tbl_customer.cust_code as dpcode,pickup_entry.*,tbl_user.full_name as client_name FROM `pickup_entry` INNER JOIN tbl_user INNER JOIN tbl_customer ON pickup_entry.client_id=tbl_user.id AND pickup_entry.customer_id=tbl_customer.cust_id WHERE pickup_entry.ref_no=$name order by pickup_entry.id asc limit 1");
                }else
                {
                    $statement = $pdo->prepare("SELECT tbl_customer.cust_name as customer_name,tbl_customer.cust_code as dpcode,pickup_entry.*,tbl_user.full_name as client_name FROM `pickup_entry` INNER JOIN tbl_user INNER JOIN tbl_customer ON pickup_entry.client_id=tbl_user.id AND pickup_entry.customer_id=tbl_customer.cust_id WHERE pickup_entry.ref_no like '%".$name."%' order by pickup_entry.id asc limit 3");
                }
        
							$statement->execute();
							$result = $statement->fetchAll(PDO::FETCH_ASSOC);
							$count=$statement->rowCount();
							if($count==1)
							{
							     foreach ($result as $row) 
							     {
                                    $id = $row['id'];
                                    $read_status = $row['read_status'];
                                    $customer_name = $row['customer_name'];
                                    $dpcode = $row['dpcode'];
                                    $ref_no = $row['ref_no'];
                                    $pics = $row['pics'];
                                    $address = $row['address'];
                                    $phone = $row['phone'];
                                    $c_weight = $row['c_weight'];
                                    $destination = $row['destination'];
                                    $client_id = $row['client_name'];
                                    $created_at = $row['created_at'];
                                    $created_at=date_create($row['created_at']);
                                    $created_at=date_format($created_at,'Y-m-d');                        
                                    
                                 } 
                                 $status="Success";
                                 $datas[] = array('dpcode'=>$dpcode,'read_status'=> $read_status,'customer_name'=>$customer_name,'id' => $id,'status'=>$status,'ref_no'=>$ref_no,'pics'=>$pics,'address'=>$address,'phone'=>$phone,'c_weight'=>$c_weight,'destination'=>$destination,'client_id'=>$client_id,'created'=>$created_at,'today'=>$date);
                                echo json_encode($datas); 
							}
							elseif($count==0)
							{
							   $id=0;
							   $status="Invalid AWB Number";
							    $datas[] = array('id' => $id,'status'=>$status);
                                echo json_encode($datas);
							}
							else
							{
							    foreach ($result as $row) 
							     {
							         $id = $row['id'];
							         $read_status = $row['read_status'];
							         $customer_name = $row['customer_name'];
                                    $dpcode = $row['dpcode'];
                                    $ref_no = $row['ref_no'];
                                    $pics = $row['pics'];
                                    $address = $row['address'];
                                    $phone = $row['phone'];
                                    $c_weight = $row['c_weight'];
                                    $destination = $row['destination'];
                                    $client_id = $row['client_name'];
                                    $created_at = $row['created_at'];
                                    $created_at=date_create($row['created_at']);
                                    $created_at=date_format($created_at,'Y-m-d');
                                    $status=2;
                                 $datas[] = array('dpcode'=>$dpcode,'read_status'=> $read_status,'customer_name'=>$customer_name,'id' => $id,'status'=>$status,'ref_no'=>$ref_no,'pics'=>$pics,'address'=>$address,'phone'=>$phone,'c_weight'=>$c_weight,'destination'=>$destination,'client_id'=>$client_id,'created'=>$created_at,'today'=>$date);
							     }
							     echo json_encode($datas);
							}
							
							 
}

?>

Zerion Mini Shell 1.0