Eco-$mart Home

Eco-$mart AWG Referrer

Thank you. You are logged out.

"); exit(); } if($RID == "" and $email == ""){ echo("
" . "
" . "" . "" . "" . "" . "
" . "Please Log In" . "
" . "
" . "Email Address:" . "" . "" . "
" . "Referrer ID:" . "" . "" . "
" . "" . "
" . "
"); }//RID and email are both blank elseif($RID != "" and $email == ""){ echo("
" . "
" . "" . "" . "" . "" . "
" . "Please Log In" . "
You must enter the email address you used to register as an Eco-\$mart Referrer." . "
" . "
" . "Email Address:" . "" . "" . "
" . "Referrer ID:" . "" . "" . "
" . "" . "
" . "
"); }//RID is not blank but email address is. elseif($RID == "" and $email != ""){ echo("
" . "
" . "" . "" . "" . "" . "
" . "Please Log In" . "
You must enter your assigned Referrer ID Number." . "
" . "
" . "Email Address:" . "" . "" . "
" . "Referrer ID:" . "" . "" . "
" . "" . "
" . "
"); }//RID is blank but email address is not. else{//RID and email are both not blank $dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1'); mysql_select_db('ecosmar_contacts', $dbcnx); $getref = mysql_query("SELECT email FROM refcon WHERE ID='$RID'"); if(!$getref){ echo("
" . "" . "
" . "We are sorry. We are experiencing technical difficulties. Please try again later." . "
"); }else{//got referrer $row = mysql_fetch_array($getref); $RIDemail = $row['email']; if (strcmp ($RIDemail, $email) == 0){//emails are the same $sesame = "open"; }//emails are the same else{//emails are different echo("
" . "
" . "" . "" . "" . "" . "" . "
" . "Please Try Again" . "
REFERRER ID AND EMAIL ADDRESS DID NOT MATCH" . "
" . "
" . "Email Address:" . "" . "" . "
" . "Referrer ID:" . "" . "" . "
" . "" . "
" . "Contact Eco-\$mart" . "
" . "
"); }//emails are different }//got referrer }//RID and email are both not blank ////START OPENED SESAME HERE if($sesame == "open"){ $dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1'); ///////////////////////////GET REFCON INFO ABOUT PAYMENTS mysql_select_db('ecosmar_contacts', $dbcnx); $getpay = mysql_query("SELECT name_1,name_2,Company,pay,rate FROM refcon WHERE ID='$RID'"); if(!$getpay){ $nopay = "on"; echo("
" . "" . "
" . "We are sorry. We are experiencing technical difficulties. Please Contact Eco-\$mart about this error." . "
"); echo("
" . "" . "
Contact Eco-\$mart" . "   Toll Free: (888) 329-2705" . "   941-377-9460" . "   orders@eco-smart.com" . "   www.eco-smart.com" . "
"); }else{//got pay $nopay = "off"; $row = mysql_fetch_array($getpay); $name_1 = $row['name_1']; $name_2 = $row['name_2']; $Company = $row['Company']; $pay = $row['pay']; $rate = $row['rate']; ///check if rate is flat if not it is not an exclusive AWG Referrer. ///Question rate and redirect w message if($pay != "Flat Fee"){ $fee = "***"; $feenote = "*** Only exclusive AWG Referrer Records Displayed."; }else{ $fee = sprintf("%01.2f", $rate); } $outs[] = ""; $outs[] = "NONE"; $outs[] = "None"; $outs[] = "No"; $outs[] = "N//A"; $outs[] = "n//a"; if(in_array($Company, $outs)){ $notice = $name_1." ".$name_2; }else{ $notice = $Company; } }//got pay $dnum = date(Ym)* 24; echo("
" . "" . "
" . "Welcome $name_1 $name_2" . "
"); //////////////////////////////Place download for DOC sell sheets here echo("
" . "" . "" . "" . "" . "" . "" . "" . "" . "
" . "Atmospheric Water Generator Referrer Card" . "
" . "Print cards with your Eco-\$mart Referrer ID so customers know who gets credit for referral.AWG Referrers Card
About
Print On-line
Download Word DOC
Download Adobe PDF
"); //////////////////////////////Begin listing referrer info echo("
" . "" . "
" . "Contacts for $notice ¦ Referrer ID: $RID"); $tmprid = $trichar.":".$RID; mysql_select_db('ecosmar_contacts', $dbcnx); $getcontacts = mysql_query("SELECT first_Name,Name,Company,Address,City,State,ZipCode FROM con_main WHERE tmp_RID='$tmprid'"); if(!$getcontacts){ echo("
Unable to retrieve Contacts. Please try again later."); }else{//gotcontacts $numrows = mysql_num_rows($getcontacts); if($numrows < 1){ echo("" . "
No Contacts Recorded for Referrer ID: $RID
"); }else{//there are rows echo("" . ""); while($rowc = mysql_fetch_array($getcontacts)){ echo(""); }//while fetching contacts }//gotcontacts echo("
NameCompanyAddressCityStateZip Code
$rowc[0] $rowc[1]$rowc[2]$rowc[3]$rowc[4]$rowc[5]$rowc[6]
"); ///////////////////INVOICE INFO mysql_select_db('ecosmar_inv', $dbcnx); echo("
" . "" . "
" . "Referrals for $notice ¦ Referrer ID: $RID"); $getinv = mysql_query("SELECT invnum,CID,ridpay,dtup,dtnum,status,prgrss FROM ecoinvoice WHERE RID='$RID'"); if(!$getinv){ echo("
Unable to retrieve Customer Info. Please try again later."); }else{//gotinvoices $invrows = mysql_num_rows($getinv); if($invrows < 1){//there are no customers echo("" . "
No Referrals Recorded for Referrer ID: $RID
"); }//there are no customers else{//there are customers////////// while($rowi = mysql_fetch_array($invrows)){ $invnum = $rowi['invnum']; $CID = $rowi['CID']; $ridpay = $rowi['ridpay']; $dtup = $rowi['dtup']; $chunk_dtup = chunk_split($dtup, 2, ':'); $chunk_arrd = explode(":", $chunk_dtup); $duem = $chunk_arrd[2].'/'.$chunk_arrd[3].'/'.$chunk_arrd[0].$chunk_arrd[1]; $dtnum = $rowi['dtnum']; $chunk_dtnum = chunk_split($dtnum, 2, ':'); $chunk_arrn = explode(":", $chunk_dtnum); $datem = $chunk_arrn[2].'/'.$chunk_arrn[3].'/'.$chunk_arrn[0].$chunk_arrn[1]; $status = $rowi['status'];//EEE=process error,PPP=payment error,New,Active,Closed $prgrss = $rowi['prgrss'];//Opened,Order In,Shipped,Delivered if($status != "Closed"){ $actinvnums[] = $invnum; $actCIDs[] = $CID; $actridpays[] = $ridpay; $actdtups[] = $duem; $actdtnums[] = $datem; $actstatuss[] = $status; $actprgrsss[] = $prgrss; }//status is not closed else{//status is closed $cloinvnums[] = $invnum; $cloCIDs[] = $CID; $cloridpays[] = $ridpay; $clodtups[] = $duem; $clodtnums[] = $datem; $clostatuss[] = $status; $cloprgrsss[] = $prgrss; }//status is closed }// while fetching all rows //////////////////////deal with two arrays active and closed $actcount = count($actinvnums); if($actcount < 1){ echo("
" . "" . "
No Active Orders Recorded for Referrer ID: $RID
"); }else{//there are active accounts echo("
" . "" . "
" . "Active Referrals". "" . ""); //////////////////////////////////////////begin gathering data $i = 0; while($i < $actcount){ echo(""); mysql_select_db('ecosmar_contacts', $dbcnx); $getcon = mysql_query("SELECT first_Name,Name FROM con_main WHERE ID='$actCIDs[$i]'"); if(!$getcon){ echo(""); }else{ $row = mysql_fetch_array($getcon); echo(""); }//gotcontact echo(""); if($actridpays[$i] > 0){ echo(""); $paidfy[] = $fee;//its all about the fee }else{ echo(""); $doofy[] = $fee; } $i=$i+1; }//while there are active rows to be read $feesdue = array_sum($doofy); echo("
InvoiceNameDateOrder ProgressFee
$actinvnums[$i]Could not get invoice contact name. Error: ".mysql_error()."$row[0] $row[1]$actdtnums[$i]$actprgrsss[$i]
$actdtups[$i]
$fee PD
$fee Due
Fees Due$feesdue
"); //^^^^ table inside this one vvvv echo("
"); }//there are active accounts }//there are customers////////// }//gotinvoices ////////////////closed accounts $clocount = count($cloinvnums); if($clocount < 1){ echo("
" . "" . "
No Closed Referrals Recorded for Referrer ID: $RID
"); }else{//there are closed accounts echo("
" . "" . "
" . "Closed Referrals". "" . ""); ////begin gathering data $i = 0; while($i < $clocount){ echo(""); mysql_select_db('ecosmar_contacts', $dbcnx); $getcon = mysql_query("SELECT first_Name,Name FROM con_main WHERE ID='$cloCIDs[$i]'"); if(!$getcon){ echo(""); }else{ $row = mysql_fetch_array($getcon); echo(""); }//gotcontact echo(""); echo(""); $paidfy[] = $cloridpays[$i]; } $i=$i+1; }//while there are active rows to be read $feespaid = array_sum($paidfy); if($feespaid > 0){ echo("
InvoiceNameDateOrder ProgressFee
$cloinvnums[$i]Could not get invoice contact name.$row[0] $row[1]$clodtnums[$i]$cloprgrsss[$i]
$clodtups[$i]
$cloridpays[$i] PD
Fees Paid$feespaid"); }else{ echo("
  "); } //^^^^ table inside this one vvvv echo("
"); }//there are closed accounts }//sesame is open ?>
Contact Eco-$mart

Email about Orders: orders@eco-smart.com
Please refer to the Invoice Number when corresponding about Orders.

Email about Eco-$mart Referrers: referrers@eco-smart.com
Please refer to your Referrer Number when corresponding about your Referral Status.

Phone: (888)329-2705

 BACK   Log Out   Eco-$mart Home 
©2009 Eco-$mart, Inc.     (888)329-2705     info@eco-smart.com     www.eco-smart.com