<?php 
$PageSecurity = 11;
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');
if($_REQUEST['str1']!='0')
{
$sql=DB_query("select * from clientmaster where id='".$_REQUEST['str1']."'",$db);
$row1=DB_fetch_array($sql);
extract($row1);
$zone1=$s->getField('dbl_dealer','id',$dealer,'area_code');
$dealer1=$s->getField('dbl_dealer','id',$dealer,'dealer_name');
$subzone1=$s->getField('dbl_dealer','id',$dealer,'subarea_code');
//$engcode1=$s->getField('dbl_dealer','id',$dealer,'engineer_code');
$areaname=$s->getField('zone_master','id',$zone1,'ZoneTitle');
$areacode=$s->getField('zone_master','id',$zone1,'zonecode');
$subareaname=$s->getField('subzone_master','id',$subzone1,'subzone');
$subareacode=$s->getField('subzone_master','id',$subzone1,'subzonecode');
$enggname=$s->getField('dbl_engineer_dealer_maste','id',$engineer,'engineer_name');
$enggcode=$s->getField('dbl_engineer_dealer_maste','id',$engineer,'engineer_code');
$data1='';
$data1.="<input name='areaname' type='text' style='width:100%' id='areaname' value='".$areaname."' readonly='readonly'  />
<input name='zone' type='hidden' style='width:100%' id='zone' value='".$zone1."'  />";
$data2='';
$data2.="<input name='subareaname' type='text' style='width:100%' id='subareaname' value='".$subareaname."' readonly='readonly' />
<input name='subzone' type='hidden' style='width:100%' id='subzone' value='".$subzone1."'  />";
$data3='';
$data3.="<input name='engineer_name' type='text' style='width:100%' id='engineer_name' value='".$enggname."' readonly='readonly' />
<input name='engname' type='hidden' style='width:100%' id='engname' value='".$engineer."'  />";
$data8='';
$data8.="<input name='dealer1' id='dealer1' readonly='readonly' type='text' style='width:100%' value='".$dealer1."' readonly='readonly' />
	<input type='hidden' name='dealer' id='dealer' value='".$dealer."' />";
$data4='';
$data4.="<input name='areacode' type='text' style='width:100%' id='areacode' value='".$areacode."' readonly='readonly' />";
$data5='';
$data5.="<input name='subareacode' type='text' style='width:100%' id='subareacode' value='".$subareacode."' readonly='readonly' />";
$data6='';
$data6.="<input name='engineer_code' type='text' style='width:100%' id='engineer_code'  value='".$enggcode."' readonly='readonly' />";
$data7='';
$data7.="<input name='customer_code' type='text' style='width:100%' id='customer_code' value='".$client_code."' readonly='readonly' />";
if($discount!='')
$data9=$discount;
else
$data9=0;
 $margin=$s->getField('dbl_dealer','id',$dealer,'margin_factor');
$data14='';
$data14.=$margin;
/*

if($freight_charges!='')
$data11=$freight_charges;
else
$data16=0;*/
if($incidental_charges!='')
$data15=$incidental_charges;
else
$data15=0;
if($pnf_charges!='')
$data16=$pnf_charges;
else
$data16=0;





/*echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6."__".$data7."__".$data8,"__".$data9."__".$data10."__".$data11."__".$data12;*/


$data13='';
$i=1;
$data13.="<table width='100%'>";
$sql_db=DB_query("SELECT * FROM dbl_customer_charges where parentid='".$_REQUEST['str1']."'",$db);
while($row_db=DB_fetch_array($sql_db))
{
$data13.="<tr class='row1'>
<td class='tabledata1'>".$s->getField('dbl_dealer_charge_master','id',$row_db['chargeid'],'charge_name')."</td>
<td><input type='text' name='freight[]' id='freight_".$i."' value='".$s->getField('dbl_dealer_charge_master','id',$row_db['chargeid'],'taxrate')."'  style='width:60px;' readonly />
<input type='text' name='freight_Amt[]' id='freight_Amt_".$i."'  onfocus='calfreight(".$i.")' style='width:90px;' readonly />
<input type='hidden' name='chargeid[]' value='".$s->getField('dbl_dealer_charge_master','id',$row_db['chargeid'],'id')."'>
</td></tr>";		

$i++; }
$data13.="
<input type='hidden' id='charge_count' name='charge_count' value='".$i."'>
</table>";


echo $data=$data1."__".$data2."__".$data3."__".$data4."__".$data5."__".$data6."__".$data7."__".$data8,"__".$data9."__".$data13."__".$data14."__".$data15."__".$data16;

}
?>
    