<<<<Restricted Area>>>>" . "
Sorry, you must Log In to view this Page

"); exit(); } $usrn = $_GET['usrn']; if($usrn == ""){ $usrn = $_POST['usrn']; } if($usrn == ""){ echo("

<<<<Restricted Area>>>>" . "
Problem with your username. Please Log In again.

"); exit(); } $listrep = $_POST['listrep']; $newlistrep = $_POST['newlistrep']; $ID_array = $_POST[bulk_id]; $ID_count = count($ID_array); $today = date("F j, Y"); $dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1'); mysql_select_db('ecosmar_website', $dbcnx); $passem = @mysql_query("SELECT ID,pswcon FROM psw WHERE usrn='$usrn'"); if (!$passem) { die("

Error Checking Password.
" . "Error: " . mysql_error(). "

"); } $row = mysql_fetch_array($passem); $pswcon = $row[1]; if($pswcon != 'All'){ echo("

<<<<Restricted Area>>>>" . "
Sorry, you must have clearance to manage All Contacts

"); exit(); } ?>
Contacts Eco-$mart, Inc.  On-line Administration
Re-Assign Contact List  ~ ~
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() . "

"); } } ?>
 Your Contacts   All Contacts   Return to Your Page 
Eco-$mart Products
©2007 - Data Base Interface - Custom Built at:  kwgrubbs.com