<?php session_name('CAKEPHP'); session_start();
$PageSecurity = 4;
include('includes/session.inc');
include('includes/function_lib.php');
global $db;

$data1='';
$data2='';
$data3='';
$data4='';
$data5='';
$data6='';
$data7='';

$sql=DB_query("select * from clientmaster where id='".$_REQUEST['id']."'",$db);
$row=DB_fetch_array($sql);
$data1.=$row['pre_address1'];

$sql_country=DB_query("select * from country_master",$db);
while($row_country=DB_fetch_array($sql_country))
{
$s='';
if($row['pre_country']==$row_country['id'])
$s="selected='selected'";
$data2.="<option value='".$row_country['id']."' ".$s.">".$row_country['country']."</option>";

}


$sql_state=DB_query("select * from state_master",$db);
while($row_state=DB_fetch_array($sql_state))
{
$s2='';
if($row['pre_state']==$row_state['id'])
$s2="selected='selected'";
$data3.="<option value='".$row_state['id']."' ".$s2.">".$row_state['state']."</option>";
}

$sql_city=DB_query("select * from city_master",$db);
while($row_city=DB_fetch_array($sql_city))
{
$s1='';
if($row['pre_city']==$row_city['id'])
$s1="selected='selected'";
$data4.="<option value='".$row_city['id']."' ".$s1.">".$row_city['city']."</option>";

}

$data5.=$row['pre_pincode'];

$data6.="<option value=''>Select</option>";
$contact_person=DB_query("select * from `contact_information_master` where master_code='".$_REQUEST['id']."'",$db);
while($contact_person_row=DB_fetch_array($contact_person))
{
	$data6.="<option value='".$contact_person_row['id']."'>".$contact_person_row['person']."</option>";
}
$consignee=DB_query("SELECT * FROM `clientmaster_consignee_address` where client_id='".$_REQUEST['id']."'",$db);
while($consignee_row=DB_fetch_array($consignee))
{
	$data7.="<option value='".$consignee_row['id']."'>".$consignee_row['consignee_name']."</option>";
}

echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6."__".$data7;
?>
  
