Register Contact with Product Manufacturer
|
|
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_products', $dbcnx);
foreach($check2 as $value){
$ok4 = @mysql_query("SELECT ID,prod_name,co_name,co_rep,email FROM mfg WHERE ID='$value'");
if (!$ok4) {
echo("
Could not get MFG List
Error: " . mysql_error(). "
");
}else{
$row4 = mysql_fetch_array($ok4);
$MID = $row4['ID'];
$prod_name = stripslashes($row4['prod_name']);
$co_name = stripslashes($row4['co_name']);
$co_rep = stripslashes($row4['co_rep']);
$email = $row4['email'];
if($regemail != ""){
$recipient = $email.",".$regemail.","."mross@eco-smart.com";
}else{
$recipient = $email.","."mross@eco-smart.com";
}
$reply = "From: ".$usremail;
$subject = "New Eco-\$mart Contact Registration";
$message="A presentation of your company's $prod_name has been made by Eco-\$mart, Inc." .
"\n" .
"Please consider this a registration of this contact as a customer to Eco-\$mart, Inc. Below are the details:" .
"\n" .
"REPRESENTATIVE: $repusrn" .
"\n" .
"DATE: $today" .
"\n" .
"\n" .
"CONTACT DETAILS:" .
"\n" .
"$first_Name $Name" .
"\n" .
"$mailCompany" .
"\n" .
"$Phone" .
"\n" .
"$Address" .
"\n" .
"$City, $State $ZipCode" .
"\n" .
"BUSINESS TYPE: $biztype" .
"\n" .
"\n" .
"Thank You," .
"\n" .
"Ecosmartinc.com Notifications" .
"\n";
$ok = @mysql_query("INSERT INTO mfg_con SET CID='$ID',MID='$MID'");
if ($ok) {
echo("
Eco-\$mart Manufacturers List for $prod_name Updated
");
}
if(@mail($recipient, $subject, $message, "From: $usrn <$usremail>")){
echo("
Contact Registration Sent for $prod_name.
");
}else{
echo ("
Error Sending Registration for $prod_name.
".
"Error:". error() . "
");
}
echo("
Return to this Contact Page
");
}
}
?>