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

$condition="";

$order_field = "quotation_id";
$order_type = "ASC";

if($_POST["inquiry_id"]!="") {
	$condition .= " AND lms_quotationmaster.inquiry_id = '".$_POST["inquiry_id"]."'"; 
}

$objQuotationMgmt = new QuotationMgmt();  
$result = $objQuotationMgmt->quotation_getAllRecords(0,0,$condition,$order_field,$order_type) ;
		
$num = dbRows($result);

//if($num > 0){
	$i = 0;   
	$quotationData = array("total" => $num, "griddata" => array());

	$temparray = array();
	
	while($row = dbArray($result)){
		
		$temparray["quotation_id"]  		= $row["quotation_id"];
		$temparray["quotation_referenceby"] = $row["quotation_referenceby"];
		$temparray["quotation_subject"] 	= $row["quotation_subject"];
		$temparray["quotation_total"]  		= $row["quotation_total"];
		$temparray["quotation_date"]   		= $row["quotation_date"];
		
		$quotationData['griddata'][$i] 	= $temparray;   
		$i++;
	}
	
//}
echo json_encode($quotationData);	
?>