Referrer Information Edited?
|
Help
|
$dtup = date(Ymd);
$ID = $_POST['ID'];
$name_1 = $_POST['name_1'];
$name_2 = $_POST['name_2'];
$name = $name_1." ".$name_2;
$address = $_POST['address'];
$Company = $_POST['Company'];
$city = $_POST['city'];
$state = $_POST['state'];
$Country = $_POST['Country'];
$ZipCode = $_POST['ZipCode'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$Link = $_POST['Link'];
$trak = $_POST['track'];
$req_by = $_POST['req_by'];
$status = $_POST['status'];
$pay = $_POST['pay'];
$rate = $_POST['rate'];
$product = $_POST['product'];
$dtnum = $_POST['dtnum'];
$chunk_dtnum = chunk_split($dtnum, 2, ':');
$chunk_arr = explode(":", $chunk_dtnum);
$datus = $chunk_arr[2].'-'.$chunk_arr[3].'-'.$chunk_arr[0].$chunk_arr[1];
$thru = $_POST['thru'];
if($thru == "0"){
$trak = "No";
}elseif($thru == "1"){
$trak = "Yes";
}elseif($thru == "2"){
$trak = "Yes";
}
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_contacts', $dbcnx);
$into = @mysql_query("UPDATE refcon SET name_1='$name_1',name_2='$name_2',Company='$Company',address='$address',city='$city',state='$state',Country='$Country',ZipCode='$ZipCode',phone='$phone',email='$email',Link='$Link',track='$trak',status='$status',pay='$pay',rate='$rate',product='$product',req_by='$req_by',dtnum='$dtnum' WHERE ID='$ID' LIMIT 1");
if (!$into) {
echo("
Error Updating Referrers List.
" . 'Error: '. mysql_error(). '
');
}else{
echo("
Successful Update to Eco-\$mart Referrers List");
mysql_select_db('ecosmar_website', $dbcnx);
if($thru == "0"){
$wtq = mysql_query("DELETE FROM webtrack WHERE dom='$Link'");
if(!$wtq){
echo("
Could not Delete Web Track. ".mysql_error()."
");
}else{
echo("
Successfully Deleted Web Track");
}
}elseif($thru == "1"){
$trak = "Yes";
$wtq = mysql_query("INSERT INTO webtrack SET RID='$ID',name_1='$name_1',name_2='$name_2',Company='$Company',email='$email',dom='$Link',count='0',cids='None',dtup='$dtup',dtnum='$dtnum'");
if(!$wtq){
echo("
Could not start Web Track. ".mysql_error()."");
}else{
$recipient = "info@eco-smart.com".","."kent@kwgrubbs.com".",".$email;
$subject = "Eco-\$mart.com - Web Tracker Account Started";
$message ="This is to inform you a Web Tracker Account has been started at eco-smart.com" .
"\n" .
"FOR:" .
"\n" .
"\n" .
"NAME: $name" .
"\n" .
"COMPANY: $Company" .
"\n" .
"DOMAIN: $Link" .
"\n" .
"REFERRER ID: $ID" .
"\n" .
"\n" .
"Visits to eco-smart.com from your website will be counted, and visitor contact with Eco-\$mart will be logged with your Referrer ID." .
"\n" .
"In order for visits to be counted and your referrer ID to be credited, the link to our website must be:" .
"\n" .
"http://www.eco-smart.com/" .
"\n" .
"There are several addresses one can use to access the Eco-\$mart Website. This is the only one that counts!" .
"\n" .
"\n" .
"View an activity report for your Referrer ID at Eco-\$mart Web Tracker. Go to:" .
"\n" .
"http://www.ecosmartinc.com/trak/" .
"\n" .
"You will need your Referrer ID to access your Web Tracker Page" .
"\n" .
"\n" .
"Please let us know if you need assistance." .
"\n" .
"Matt Ross" .
"\n" .
"President, Eco-\$mart, Inc." .
"\n" .
"(888)329-2705" .
"\n" .
"info@eco-smart.com" .
"\n" .
"www.eco-smart.com" .
"\n";
if (@mail($recipient, $subject, $message, "From: Eco-Smart.com
" )) {
echo("Webtracker Started. Referrer Code: $ID
" .
"Email Notification Sent
");
}//if mail
}//ifinsertsuccessful
}elseif($thru == "2"){
$trak = "Yes";
$wtq = mysql_query("UPDATE webtrack SET count='0' WHERE dom='$Link'");
if(!$wtq){
echo("
Could not reset Web Track count. ".mysql_error()."");
}else{
echo("
Successful Web Track Reset");
}
}
}//ifinto
?>