 <style type="text/css">
.img-contact
{
	vertical-align: middle;
	margin: 0px 0px 0px 0px;
	width:75px;
	height:100px;
}
.x-fieldset
{
	border-style: solid none none none;
	border-width: 1px;
	border-color: #99BBE8 !important;
	padding: 10px;
	margin-bottom: 10px;
	margin-right: 20px;
	display: block;
}
    </style>
<?php require "_header.php"; ?>
<?php 

$inquiry_id= Escape($_REQUEST["ID"]);
if ($inquiry_id !="" && isset($inquiry_id)) { 
		$mode="edit";	
		$limit=1;
		$start=0;
		$condition=" and inquiry_id = '$inquiry_id' ";
		$order_field="";
		$order_type="";
		    			
		$objInquiryMgmt = new InquiryMgmt();
		
		$out =  $objInquiryMgmt->getAllRecords(0,0,$condition,$order_field,$order_type) ;
		if (dbRows($out)){
			$row=dbArray($out);
			extract($row);			
		}    	   
}
else{
	$mode="add";
	$inquiry_id=0;
}
?>
<script type="text/javascript" language="javascript"> 
	var formMode = '<?php echo $mode;?>';
	var inquiry_id = '<?php  echo $inquiry_id; ?>';
</script>

<script type="text/javascript" src="jquery/ux/CheckColumn.js"></script>
<?php require "includeGridFilters.php";?> 
<script type="text/javascript" src="js/product-inquiry.js"></script>
<script type="text/javascript" language="javascript"> 

Ext.onReady(function() {


	var inquiry_id = '<?php  echo $inquiry_id; ?>';
	
	Ext.QuickTips.init();
	
	ShowWindow();
	
	if(formMode=='edit'){

<?php
	$inquier_address = replaceSpecial($inquier_address);
	$comment 		= replaceSpecial($comment);
?>
	inquiryForm.getForm().findField('inquierorg_name').setValue('<?php print $inquierorg_name; ?>');
	inquiryForm.getForm().findField('inquier_add').setValue('<?php print $inquier_address; ?>');
	inquiryForm.getForm().findField('personname').setValue('<?php print $contactperson; ?>');
	districtsore.on({'load':{
		fn: function(store, options){
			inquiryForm.getForm().findField('dist_id').setRawValue('<?php print $district_id; ?>');
			inquiryForm.getForm().findField('dist_id').setValue('<?php print $district_id; ?>');	
		}
	}});
	
	inquiryForm.getForm().findField('inquier_phoneno').setValue('<?php print $inquier_phoneno; ?>');
	inquiryForm.getForm().findField('inquier_mobileno').setValue('<?php print $inquier_mobileno; ?>');
	inquiryForm.getForm().findField('inquier_faxno').setValue('<?php print $inquier_faxno; ?>');
	
								
	
	inquiryForm.getForm().findField('email').setValue('<?php print $inquier_email; ?>');
	inquiryForm.getForm().findField('webPage').setValue('<?php print $inquier_url; ?>');
	
	
	inquiryForm.getForm().findField('appintment_date').setValue('<?php print $appointmentdate; ?>');
	inquiryForm.getForm().findField('appintment_time').setValue('<?php print $appointmenttime; ?>');
	inquiryForm.getForm().findField('comment').setValue('<?php print $comment; ?>');
	
	store.load({  params: {inquiry_id:<?php print $inquiry_id; ?>}   });
	}	
});
</script>
<div align="center"><div id="main-content" align="center"></div></div> 
<?php require "_footer.php";?>