<?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['q']."'";
$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'];
?>



			<table  width="100%" border="0" cellpadding="3" cellspacing="0">
				<tr class="row1">
				<td width="433" class="tabledata1"><div style="width:190px;">Address</div></th>
				<td width="306" style="width:283px;"><input type="text"  style="width:206px;" name="Address1"  value="<?php echo $fetch_array_qry['pre_address1'];?>"/></td>
				<td width="249" class="tabledata1" style="width:200px;">Contact Person</td>
				<td> 
<?php
				 	$SQL="Select * from contact_information_master where master_code='".$_REQUEST['q']."'";?>										
					<select style="width:206px;" name="ContactPerson" onchange="getPhoneNo(this.value)">
                   
					<option value="0">--Select--</option>
					<?php
					 
					$Res=DB_query($SQL,$db);
					while($Row=DB_fetch_array($Res))
					{
					?>
					<option value="<?php echo $Row['id']?>" <?php echo($ContactPerson==$Row['id']?'selected':'')?>><?php echo $Row['person']?></option>
					<?php  } ?>
					
					</select>
										</td>
									  </tr>
										 <tr class="row1">
										<td>&nbsp;</td>
										<td><input type="text" name="Address2" id="Address2" style="width:206px;" value="<?php echo $city;?>"  ></td>
										<td class="tabledata1">Phone No</td>
										<td><div id="PhoneNo" ><input type="text" style="width:206px;" name="Telephone" id="Telephone" value="<?php echo $_SESSION['Telephone']?>"  >
											</div>
											
										</td>
									  </tr>
										 <tr class="row1">
										<td>&nbsp;</td>
										<td><input type="text" name="Address3" id="Address3" style="width:206px;" value="<?php echo $state;?>"  > </td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									  </tr>
										</table>

	