<?
include("../includes/htmlMimeMail.php");
include_once("../include/main.inc.php");
include_once("../ajax_functions.php");
check_session('MyCpanel','index.php');
$table_name='business_enquiry_tbl';

$res=getResult($table_name," where slno='$recordID' and keyword !=''");
$keyword=$res[keyword]; 
$memID=$res[memID];
$contactName=$res[contactName];
$companyName=$res[companyName];
$email=$res[email];
$mobile=$res[mobile];
$mobileNo2=$res[mobileNo2];
$phone=$res[phone];
$subject=$res[subject];
$comments=$res[comments];
$replyEmail=$res[replyEmail];
$country=$res[country];
$address=$res[address];
$city=$res[city];
$state=$res[state];
$ref_id=$res[ref_id];
$source=$res[source];
$memberstatus=$res[memberstatus];
$memberID=$res[memberID];
$recvDate=$res[recvDate];
$ipTrack=$res[ipTrack];
$forwardstatus='Y';
$inquiryID='$recordID';

$query=mysql_query("SELECT * FROM member_tbl WHERE status='Y' and offertosell like '%$keyword%'");

echo "SELECT * FROM member_tbl WHERE status='Y' and offertosell in ('$keyword)";
	
while ($row = mysql_fetch_array($query)) {
	
//$mailres=getResult($table_name2," where mailerID='$mailer_id' and email='$row[email]'");

	
$sql=db_query("insert into  business_enquiry_tbl set memID='$memID', contactName='$contactName', companyName='$companyName', email='$email', mobile='$mobile', mobileNo2='$mobileNo2',phone='$phone',subject='$subject',comments='$comments',replyEmail='$replyEmail',country='$country',address='$address',city='$city',state='$state',ref_id='$ref_id',source='$source',memberstatus='$memberstatus',memberID='$memberID',recvDate='$recvDate',ipTrack='$ipTrack',forwardstatus='Y',inquiryID='$recordID',status='N'");

echo "insert into  business_enquiry_tbl set memID='$memID', contactName='$contactName', companyName='$companyName', email='$email', mobile='$mobile',, mobileNo2='$mobileNo2',phone='$phone',subject='$subject',comments='$comments',replyEmail='$replyEmail',country='$country',address='$address',city='$city',state='$state',ref_id='$ref_id',source='$source',memberstatus='$memberstatus',memberID='$memberID',recvDate='$recvDate',ipTrack='$ipTrack',forwardstatus='Y',inquiryID='$recordID',status='N'";

 }

echo "<h3>Database Alloctaed</h3> ";

//header("Location: ".SITE_ADMIN_URL."/manage_business_classified_enquiries.php");

?>

 