<<<<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(); } $dtnum = date(Ymd); $today = date("F j, Y"); $dbcnx = @mysql_connect('mysql.plainhost.com','ecosmar_ecosmart','ecoman1'); $biztype = $_POST[biztype]; $biz_all = $_POST['biz_all']; if($biz_all == "on"){ $biztype = array(); $biztype[]= "Architect"; $biztype[]= "Cabinet Maker"; $biztype[]= "Developer"; $biztype[]= "Electrical Contractor"; $biztype[]= "Energy Management Company"; $biztype[]= "Engineer"; $biztype[]= "Flooring Dealer"; $biztype[]= "Flooring Distributor"; $biztype[]= "Furniture Maker"; $biztype[]= "General Contractor - Commercial"; $biztype[]= "General Contractor - Residential"; $biztype[]= "Hardware Store"; $biztype[]= "Home Owner"; $biztype[]= "HVAC Contractor"; $biztype[]= "HVAC Distributor"; $biztype[]= "Interior Designer"; $biztype[]= "Landscape Contractor"; $biztype[]= "Mortgage - Finance"; $biztype[]= "Other"; $biztype[]= "Plumbing Contractor"; $biztype[]= "Plywood Distributor"; $biztype[]= "Pool Contractor"; $biztype[]= "Pool Deck Contractor"; $biztype[]= "Pool Supply"; $biztype[]= "Realtor"; $biztype[]= "Retail"; $biztype[]= "Roofing Contractor"; $biztype[]= "Solar Contractor"; $biztype[]= "Subcontractor"; $biztype[]= "Window Contractor"; } $bizcount = count($biztype); $repusrn = $_POST['repusrn']; $info = $_POST[info]; $info_all = $_POST['info_all']; if($info_all == "on"){ $info = array(); $info[] = "first_Name"; $info[] = "Name"; $info[] = "Address"; $info[] = "City"; $info[] = "State"; $info[] = "ZipCode"; $info[] = "email"; $info[] = "Phone"; $info[] = "Company"; } if(empty($info)){ echo("

Error: No Contact Data Selected. Please go back and select Contact Data to display."); exit(); } $info_csv = implode(",", $info); $info_count = count($info); if($repusrn == "All"){ $tisit = ""; }else{ $tisit = "AND usrn = '".$repusrn."'"; } $mess = "No Message yet."; ?>

BACK Eco-$mart Contact List

Report Generated by:

"); foreach($info as $value){ if($value == "first_Name"){ $nite = "First Name"; }elseif($value == "Name"){ $nite = "Last Name"; }elseif($value == "email"){ $nite = "Email"; }else{ $nite = $value; } echo("$nite ¦ "); } echo(""); }elseif($formtype == "csv" AND $repusrn != "All"){ echo("Commma Separated Values for $repusrn in $info_count Columns:
"); foreach($info as $value){ if($value == "first_Name"){ $nite = "First Name"; }elseif($value == "Name"){ $nite = "Last Name"; }elseif($value == "email"){ $nite = "Email"; }else{ $nite = $value; } echo("$nite ¦ "); } echo(""); }elseif($formtype == "print" AND $repusrn != "All"){ echo("Contact List for $repusrn in $info_count Columns:
"); foreach($info as $value){ if($value == "first_Name"){ $nite = "First Name"; }elseif($value == "Name"){ $nite = "Last Name"; }elseif($value == "email"){ $nite = "Email"; echo(""); }else{ $nite = $value; } echo("$nite ¦ "); } }else{ echo("Contact List for All Contacts in $info_count Columns:
"); foreach($info as $value){ if($value == "first_Name"){ $nite = "First Name"; }elseif($value == "Name"){ $nite = "Last Name"; }elseif($value == "email"){ $nite = "Email"; }else{ $nite = $value; } echo("$nite ¦ "); } echo(""); } ?>
"); foreach($biztype as $value){ echo("$value"); $new = @mysql_query("SELECT $info_csv FROM con_main WHERE biztype='$value' $tisit ORDER BY Name"); if(!$new){ echo("

Problem retrieving List.
Error: ". mysql_error()."

"); } $num_rows = mysql_num_rows($new); if($num_rows < 1){ echo("No Contacts for this Business Type."); }else{ echo(""); foreach($info as $value){ if($value == "first_Name"){ $inside = "First Name"; }elseif($value == "Name"){ $inside = "Last Name"; }elseif($value == "State"){ $inside = "ST"; }else{ $inside = $value; } echo("$inside"); }//4ea }//else echo(""); $c = 1; while($rows = mysql_fetch_array($new)){ $ck = $c / 2; if(is_int($ck)){ $cell = "style='border:solid silver 1;background-color:white;'"; }else{ $cell = "style='border:solid silver 1;background-color:#ffffc0;'"; } $go = "go"; $aa = $rows[0]; $bb = $rows[1]; $cc = $rows[2]; $dd = $rows[3]; $ee = $rows[4]; $ff = $rows[5]; $gg = $rows[6]; $hh = $rows[7]; $ii = $rows[8]; if(ereg("Test", $aa) or ereg("test", $aa)){ $go = "no"; } if(ereg("Test", $bb) or ereg("test", $bb)){ $go = "no"; } if(in_array($aa, $aack) AND in_array($bb, $bbck)){ $go = "no"; } if($go == "go"){ $aack[] = $aa; $bbck[] = $bb; echo(""); if($aa == "n/a" or $aa == "NA" or $aa == "N/A" or $aa == "none" or $aa == "No Email" or $aa == "lklk" or $aa == "?"){ $ay = ""; }else{ $az = stripslashes($aa); $ay = str_replace ( ',', " ", $az); } echo("$ay"); if($info_count > 1){ if($bb == "n/a" or $bb == "NA" or $bb == "N/A" or $bb == "none" or $bb == "No Email" or $bb == "lklk" or $bb == "?"){ $by = " "; }else{ $bz = stripslashes($bb); $by = str_replace ( ',', " ", $bz); } echo("$by"); } if($info_count > 2){ if($cc == "n/a" or $cc == "NA" or $cc == "N/A" or $cc == "none" or $cc == "No Email" or $cc == "lklk" or $cc == "?"){ $cy = " "; }else{ $cz = stripslashes($cc); $cy = str_replace ( ',', " ", $cz); } echo("$cy"); } if($info_count > 3){ if($dd == "n/a" or $dd == "NA" or $dd == "N/A" or $dd == "none" or $dd == "No Email" or $dd == "lklk" or $dd == "?"){ $dy = " "; }else{ $dz = stripslashes($dd); $dy = str_replace ( ',', " ", $dz); } echo("$dy"); } if($info_count > 4){ if($ee == "n/a" or $ee == "NA" or $ee == "N/A" or $ee == "none" or $ee == "No Email" or $ee == "lklk" or $ee == "?"){ $ey = " "; }else{ $ez = stripslashes($ee); $ey = str_replace ( ',', " ", $ez); } echo("$ey"); } if($info_count > 5){ if($ff == "n/a" or $ff == "NA" or $ff == "N/A" or $ff == "none" or $ff == "No Email" or $ff == "lklk" or $ff == "?"){ $fy = " "; }else{ $fz = stripslashes($ff); $fy = str_replace ( ',', " ", $fz); } echo("$fy"); } if($info_count > 6){ if($gg == "n/a" or $gg == "NA" or $gg == "N/A" or $gg == "none" or $gg == "No Email" or $gg == "lklk" or $gg == "?"){ $gy = " "; }else{ $gz = stripslashes($gg); $gy = str_replace ( ',', " ", $gz); } echo("$gy"); } if($info_count > 7){ if($hh == "n/a" or $hh == "NA" or $hh == "N/A" or $hh == "none" or $hh == "No Email" or $hh == "lklk" or $hh == "?"){ $hy = " "; }else{ $hz = stripslashes($hh); $hy = str_replace ( ',', " ", $hz); } echo("$hy"); } if($info_count > 8){ if($ii == "n/a" or $ii == "NA" or $ii == "N/A" or $ii == "none" or $ii == "No Email" or $ii == "lklk" or $ii == "?"){ $iy = " "; }else{ $iz = stripslashes($ii); $iy = str_replace ( ',', " ", $iz); } echo("$iy"); } echo(""); $c = $c + 1; }//while }//goisgo }//4ea echo(""); }//ifformtypeisprint elseif($formtype == "csv"){ $scrip = "\"javascript:selectAll('test.select1');\""; echo("" . "" . "
"); if($repusrn == "All"){ echo("Business Type:  "); foreach($biztype as $value){ echo("$value ¦ "); } }else{ echo("Business Type:  "); foreach($biztype as $value){ echo("$value ¦ "); } } echo("

" . "Instructions:" . "
1, Select All text in the Text Area below and Copy." . "
2. Paste the script into a new file in a Plain Text editor (eg.,Note Pad or Simple Text)." . "
3. Save As "some_file_name.csv"." . "
     You will then be able to open the file in Excel or other spreadsheet and import into an address book or data base as a Comma Separated Values file.

" . "
" . "

" . "
"); }else{//nocsvnoprint echo("" . "
Problems with formulation of list.
Too much information to process." . "
"); } ?>

 
Back List Created at Eco-smart.com -