<?php  
require "commonincludefiles.php";
if($_SESSION["cCompany_id"]!="" && isset($_SESSION["cCompany_id"]))
{

	$objInquiryMgmt = new InquiryMgmt();
	
	$objInquiryMgmt ->inquiry_id            = $_REQUEST["inquiry_id"] ;
	$objInquiryMgmt ->inquierorg_name		= $_REQUEST['inquierorg_name'] ;
	$objInquiryMgmt ->inquier_address		= $_REQUEST['inquier_add'] ;
	$objInquiryMgmt ->district_id			= $_REQUEST['dist_code1'];
	$objInquiryMgmt ->contactperson			= $_REQUEST['personname'];
	$objInquiryMgmt ->inquier_phoneno		= $_REQUEST['inquier_phoneno'];
	$objInquiryMgmt ->inquier_mobileno		= $_REQUEST['inquier_mobileno'];
	$objInquiryMgmt ->inquier_faxno			= $_REQUEST['inquier_faxno'];
	$objInquiryMgmt ->inquier_email         = $_REQUEST["email"] ;
	$objInquiryMgmt ->inquier_url			= $_REQUEST['webPage'] ;
	$objInquiryMgmt ->appointmentdate		= $_REQUEST['appintment_date'];
	$objInquiryMgmt ->appointmenttime       = $_REQUEST["appintment_time"] ;
	$objInquiryMgmt ->comment				= $_REQUEST['comment'] ;
	$objInquiryMgmt ->product_ids			= $_REQUEST['product_ids'];
	
	$objInquiryMgmt ->user_id			= $_REQUEST['user_idhedden'];
	$objInquiryMgmt ->customer_id			= $_REQUEST['customer_orgname'];
		$objInquiryMgmt ->inquiry_date			= $_REQUEST['inquiry_date'];
	
	if($objInquiryMgmt->inquiry_id=="0" || $objInquiryMgmt->inquiry_id==""){
		$objInquiryMgmt->add();						
	}
	else{
		$objInquiryMgmt->edit();												
	}					
	
	echo '{"success":"true","msg":""}';
}
else {
	echo '{"success":"false","msg":"session expiry"}';
}	         
?>
