$i = 0;
foreach($check2 as $value){
mysql_select_db('ecosmar_products', $dbcnx);
$listem = @mysql_query("SELECT proname FROM deal_pro WHERE prod_name='$value'");
if (!$listem){
echo("
Error Selecting Products from Data Base! ".
'Error:' . mysql_error() . ' ');
}else{
$row = mysql_fetch_array($listem);
$proname = $row['proname'];
}
$ok4 = @mysql_query("INSERT INTO dealers SET proname='$proname',name='$Company',address='$Address',city='$City',state='$State',zip='$ZipCode',phone='$Phone',email='$email'");
if (!$ok4) {
echo("Could not update $value Dealers List Error: " . mysql_error(). " ");
}else{
$recipient = "info@ecosmartinc.com";
$reply = "From: ".$usremail."\r\nReply-to: ".$usremail;
$subject = "Eco-\$mart Contact Added to Dealers List";
$message="A Contact has been added to the $value Dealers List" .
"\n" .
"REPRESENTATIVE: $usrn" .
"\n" .
"DATE: $datus" .
"\n" .
"\n" .
"CONTACT DETAILS:" .
"\n" .
"$aname" .
"\n" .
"$Company" .
"\n" .
"$Phone" .
"\n" .
"$Address" .
"\n" .
"$City, $State $ZipCode" .
"\n" .
"\n" .
"View or Edit this Dealer by going to:" .
"\n".
"http://www.ecosmartinc.com/ecos/ecologin.htm" .
"\n".
"Click on Eco-$mart Products, then View/Edit Dealers List" .
"\n".
"Thank You," .
"\n" .
"Ecosmartinc.com Notifications" .
"\n";
if(@mail($recipient, $subject, $message, $reply)){
echo("Successful Addition to $value Dealers List. ");
}else{
echo ("Error Adding Contact to $value Dealers List! ".
'Error:' . error() . ' ');
}
}
$i = $i+1;
}
?>
©2006 - Data Base Interface - Custom Built at:
|
|