<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
$qury= "Select * from clientmaster where id='".$_REQUEST['CLIENTID']."'";
$exe_query=DB_query($qury,$db);
$fetch_array_qry=DB_fetch_array($exe_query);
$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'];

//echo "SELECT * FROM quotation where party='".$_REQUEST['CLIENTID']."' and site='".$_REQUEST['branch']."' and ConvertIntoSales='N' and approval_status='1'";
$QutsSQL=DB_query("SELECT * FROM quotation where party='".$_REQUEST['CLIENTID']."' and site='".$_REQUEST['branch']."' and ConvertIntoSales='N' and approval_status='1'",$db);
$data1="";

$data1.="<select name='against_quots' id='against_quots' style='width:206px;' onchange='GetQuotesItems(this.value)'>";
$data1.="<option value='0'>Select Quotes No</option>";
while($AgainnstQut=DB_fetch_array($QutsSQL)){
$data1.="<option value='".$AgainnstQut['id']."'>".$AgainnstQut['quotationNo']."</option>";
}
$data1.="</select>";

$data2="";
$data2.="<input type='text'  style='width:206px;' name='Address1'  value='".$fetch_array_qry['pre_address1']."'/>";


$SQL="Select * from contact_information_master where master_code='".$_REQUEST['CLIENTID']."'";		

$data3="";
$data3.="<select style='width:206px;' name='ContactPerson' onchange='getPhoneNo(this.value)'>";
$data3.="<option value='0'>--Select--</option>";
$Res=DB_query($SQL,$db);
while($Row=DB_fetch_array($Res)){
$sel='';
if($ContactPerson==$Row['id'])
$sel='selected';
$data3.="<option value='".$Row['id']."' ".$sel.">".$Row['person']."</option>";
  } 
$data3.="</select>";

$data4="";
$data4.="<input type='text' name='Address2' id='Address2' style='width:206px;' value='".$city."'>";

$data5="";
$data5.="<div id='PhoneNo' ><input type='text' style='width:206px;' name='Telephone' id='Telephone' value='".$_SESSION['Telephone']."'  ></div>";

$data6="";

$data6.="<input type='text' name='Address3' id='Address3' style='width:206px;' value='".$state."' >";
echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6;
?>