Error Checking Password.
" . "Error: " . mysql_error(). "
");
}
$row = mysql_fetch_array($passem);
$pswcon = $row[1];
if($pswcon != 'All'){
echo("
Re-Assign Contact List ~ ~
|
$ok = @mysql_query("SELECT first_name,last_name,email FROM psw WHERE usrn='$newlistrep'");
if (!$ok) {
echo ("
Could not retrieve Representative Info
".
'Error:' . mysql_error() . '
');
exit();
}else{
$rowa = mysql_fetch_array($ok);
$newrepname1 = $rowa[0];
$newrepname2 = $rowa[1];
$newrepemail = $rowa[2];
}
$countcheck = 0;
mysql_select_db('ecosmar_contacts', $dbcnx);
foreach($ID_array as $value){
$ok = @mysql_query("UPDATE con_main SET usrn='$newlistrep' WHERE ID='$value'");
if ($ok) {
$countcheck = $countcheck + 1;
}else{
echo ("
Error Re-Assigning Contact!
".
'Error:' . mysql_error() . '
');
}
$ok2 = @mysql_query("UPDATE con_activity SET usrn='$newlistrep' WHERE CID='$value'");
if ($ok2) {
echo ("-");
}else{
echo ("
Error Updating Activity Report!
".
'Error:' . mysql_error() . '
');
}
$ok3 = @mysql_query("UPDATE con_notes SET usrn='$newlistrep' WHERE CID='$value'");
if ($ok3) {
echo ("-");
}else{
echo ("
Error Updating Contact Notes!
".
'Error:' . mysql_error() . '
');
}
}
if($countcheck == $ID_count){
echo ("
Successful Update of Contact List
".
"Contacts for $listrep
" .
"Have been re-assigned to $newlistrep.
");
$to = $newrepemail ." ,". "info@ecosmartinc.com"." ,". "ecosmart@kwgrubbs.com";
$subject = "Contact Re-assignment at Ecosmartinc.com";
$message = "This is to inform you that an Eco-\$mart Contact List has been re-assigned." .
"\n" .
"\n" .
"$ID_count Contacts from $listrep" .
"\n" .
"\n" .
"Have been re-assigned to $newlistrep." .
"\n" .
"\n" .
"Please contact me if you have any questions." .
"\n" .
"\n" .
"Matt Ross, President" .
"\n" .
"Eco-\$mart, Inc." .
"\n" .
"www.ecosmartinc.com" .
"\n" .
"mross@ecosmartinc.com" .
"\n" .
"888-329-2705" .
"\n";
$ok4 = mail($to, $subject, $message, "From: mross@ecosmartinc.com");
if ($ok4) {
echo("
Notification Sent.
");
} else {
echo("
Error sending notification!
" .
"Error: " . error() . "
");
}
}
?>