<?php 
$PageSecurity = 15;
include('includes/session.inc');
include('includes/function_lib.php');
if($_REQUEST['q']!='')
{
	$sql=DB_query("Select adrress1,adrress2,address3,country,state,city from suppliers where vendor_code='".$_REQUEST['q']."'",$db);
	$result=DB_fetch_array($sql);
	
	$cityName=$fnLib->getField('city_master','id',$result['city'],'city');
	$stateName=$fnLib->getField('state_master','id',$result['state'],'state');
	$countryName=$fnLib->getField('country_master','id',$result['country'],'country');
?>
	<table width="100%" border="0">
          <tr>
            <td><input name="enquiryDate" type="text" value="<?php echo $result['adrress1'];?>" size="25"  style="width:100%;" class=""/></td>
            </tr>
          <tr>
            <td><input name="enquiryDate5" type="text" value="<?php echo $result['adrress2']." ".$result['address3'];?>" size="25"  style="width:100%;" class=""/></td>
            </tr>
          <tr>
            <td><input name="enquiryDate6" type="text" value="<?php echo $cityName." ".$stateName." ".$countryName;?>" size="25"  style="width:100%;" class=""/></td>
          </td></tr></table>
<?php 
}
else if($_REQUEST['p']!='')
{
	$sql=DB_query("Select adrress1,adrress2,address3,country,state,city from suppliers where vendor_code='".$_REQUEST['p']."'",$db);
	$result=DB_fetch_array($sql);
	
	$cityName=$fnLib->getField('city_master','id',$result['city'],'city');
	$stateName=$fnLib->getField('state_master','id',$result['state'],'state');
	$countryName=$fnLib->getField('country_master','id',$result['country'],'country');
?>
	<table width="100%" border="0">
          <tr>
            <td><input name="enquiryDate" type="text" value="<?php echo $result['adrress1'];?>" size="25"  style="width:100%;" class=""/></td>
            </tr>
          <tr>
            <td><input name="enquiryDate5" type="text" value="<?php echo $result['adrress2']." ".$result['address3'];?>" size="25"  style="width:100%;" class=""/></td>
            </tr>
          <tr>
            <td><input name="enquiryDate6" type="text" value="<?php echo $cityName." ".$stateName." ".$countryName;?>" size="25"  style="width:100%;" class=""/></td>
          </td></tr></table>
<?php 
}
?>