<?php
require "../commonincludefiles.php";

$condition="";

$inquiry_id= Escape($_POST['inquiry_id']);
if($inquiry_id !="") {
	
	$condition .= " AND inquiry_id='".$inquiry_id."'";  
  
    $objInquiryMgmt = new InquiryMgmt();  

	$result = $objInquiryMgmt->getAllRecords(0,0,$condition,$order_field,$order_type) ;
		
	$num = dbRows($result);
	
	$i = 0;   
	
	//$griddata = array("total" => $num, "griddata" => array());
	
	 if	(dbRows($result) > 0) 
	 {
				$temparray = array();
				while($row = dbArray($result)){
					  	 	 	 	 	 	 	 	 	 	 	 	 	 	
					$temparray["inquiry_id"]  = $row["inquiry_id"];
					$temparray["inquierorg_name"]   = $row["inquierorg_name"];
					$temparray["inquier_address"]  = $row["inquier_address"];
					$temparray["district_id"]   = $row["district_id"];
					$temparray["inquier_phoneno"]  ="Ph.No : ".$row["inquier_phoneno"]."<br/>Mob.No : ".$row["inquier_mobileno"]."<br/>Fax No : ".$row["inquier_faxno"]."<br/>";
					$temparray["inquier_mobileno"]  = $row["inquier_mobileno"];
					$temparray["inquier_faxno"]   = $row["inquier_faxno"];
					$temparray["inquier_email"]  = $row["inquier_email"];
					$temparray["inquier_url"]   = $row["inquier_url"];
					$temparray["contactperson"]   = $row["contactperson"];
					$temparray["appointmentdate"]   = $row["appointmentdate"];
					$temparray["appointmenttime"]  = $row["appointmenttime"];
					$temparray["comment"]   = $row["comment"];
					$temparray["product_ids"]  = $row["product_ids"];
					$temparray["company_id"]   = $row["company_id"];
					
					
					$griddata[$i] = $temparray;   
					$i++;
			}		
			echo '{"total":"'.$num.'","griddata":'.json_encode($griddata).'}';				
		} 
	
	//echo json_encode($griddata);	
}







?>
