<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['code']!='')
{
$sql="Select * from clientmaster where client_code='".$_REQUEST['code']."'";
$result=DB_query($sql,$db);
$row=DB_fetch_array($result);

$countryName=$s->getField('country_master','id',$row['pre_country'],'country');
$stateName=$s->getField('state_master','id',$row['pre_state'],'state');
$cityName=$s->getField('city_master','id',$row['pre_city'],'city');
?>
<table width="100%" cellpadding="0" cellspacing="1" border="0" align="center">
        <tr>
<th width="19%" scope="row" rowspan="3"><strong>Address</strong></th>
<td width="31%"><input name="partyaddress1" type="text" value="<?php echo $row['pre_address1'];?>" size="25"  style="width:100%;"/></td>
<th width="25%" scope="row"><strong>Contact Person</strong></th>
<td width="25%"><select name="partyContact" style="width: 100%" onchange="contactDetails(this.value)">
		<option value="0">Select</option>
		<?php 
		$contact_sql=DB_query("Select * from contact_information_master where master_code='".$_REQUEST['code']."' and master_prefix='C'",$db);
		while ($contact_row=DB_fetch_array($contact_sql)) 
		{?>
			<option value="<?php echo $contact_row['id'];?>"><?php echo $contact_row['person'];?></option>
		<?php 	
		}
		?>
	</select></td>
</tr>
          <tr>
            
            <td><input name="partyaddress2" type="text" value="<?php echo $row['pre_address2'];?>" size="25" style="width:100%;" /></td>
            <th scope="row"><strong>Mobile No.</strong></th>
            <td id="contactId"><input name="ContactMobile" type="text" value="" size="25" style="width:100%;"/></td>
            </tr>
<tr>
<td colspan="3"><input type="text" name="partyaddress3" value="<?php echo $row['pre_address3'].", ".$countryName.", ".$stateName.", ".$cityName;?>" style="width: 100%"></td>	
</tr>
    </table> 
  <?php } 
 if($_REQUEST['contact']!='')
 {
 	$sql="Select phone from contact_information_master where id='".$_REQUEST['contact']."'";
	$result=DB_query($sql,$db);
	$myrow=DB_fetch_array($result);
?>
<input name="ContactMobile" type="text" value="<?php echo $myrow['phone'];?>" size="25" style="width:100%;"/>
<?php 
 } 
  ?>