<?php 
session_name('CAKEPHP'); session_start();
$PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
//echo $_REQUEST['q'];
 $qury= "Select * from clientmaster where id='".$_REQUEST['site']."'";
$exe_query=DB_query($qury,$db);
$fetch_array_qry=DB_fetch_array($exe_query);
//$ContactPerson=$_SESSION['ContactPerson'];

$city1=DB_query("select * from city_master where id='".$fetch_array_qry['pre_city']."'",$db);
$city2=DB_fetch_array($city1);
 $city=$city2['city'];
$state1=DB_query("select * from state_master where id='".$fetch_array_qry['pre_state']."'",$db);
$state2=DB_fetch_array($state1);
 $state=$state2['state'];


$data1="<input type='text'  style='width:206px;' name='Address1'  value='".$fetch_array_qry['pre_address1']."'/>";
				
				 	$SQL="Select * from contact_information_master where master_code='".$_REQUEST['site']."'";
					$data2="<select style='width:206px;' name='ContactPerson' onchange='getPhoneNo(this.value)'>";
                   
					$data2.="<option value='0'>--Select--</option>";
					
					 
					$Res=DB_query($SQL,$db);
					while($Row=DB_fetch_array($Res))
					{
					
					$data2.="<option value=".$Row['id']." ".($ContactPerson==$Row['id']?'selected':'').">".$Row['person']."</option>";
					  } 
					
					$data2.="</select>";
										
					$data3="<input type='text' name='Address2' id='Address2' style='width:206px;' value='".$city."'  >";
					$data4="<input type='text' style='width:206px;' name='Telephone' id='Telephone' value='".$_SESSION['Telephone']."'  >";
											
					$data5="<input type='text' name='Address3' id='ddress3' style='width:206px;' value='".$state."'  >";
				
				$data6="<select style='width:206px;' name='consignee_name' id='consignee_name'>";						
$consignee_query=DB_query("SELECT * FROM `clientmaster_consignee_address` WHERE client_id='".$_REQUEST['site']."'",$db);					
				while($consignee_name=DB_fetch_array($consignee_query))
				{
				$data6.="<option value=".$consignee_name['id']." >".$consignee_name['consignee_name']."</option>";
				}	
					$data6.="</select>";
					
	
					echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6;					
										
										
								