<?php
include("../db.php");
error_reporting(0);
$q = strtolower($_GET["q"]);
if (!$q) return;

$branch_name=$_GET['branch_name'];

    $sql_user="select * from  branch_creation where branch_id=$branch_name";
	$rs_user=mysql_query($sql_user);
	while($rsdata_user=mysql_fetch_object($rs_user))
	{ 
	$branch_namess=$rsdata_user->branch_name;
	
     $sql_user="select * from  place_creation where to_place='$branch_namess'";
	$rs_user=mysql_query($sql_user);
	while($rsdata_user=mysql_fetch_object($rs_user))
	{ 
	$id=$rsdata_user->id;

    $sql = "select * from booking_main_list where booking_no LIKE '%$q%' and delivery_status!='1' and company_delivery_status!='1' and unloading_status='1' and book_place='$id'  ";

$rsd = mysql_query($sql);
$count = mysql_num_rows($rsd);
if($count != "0")
{
while($rs = mysql_fetch_array($rsd)) {
	$booking_no= $rs['booking_no'];
	echo "$booking_no\n";
} 
}
}
}

	

?>