getRegions(); $cats=$s->getCats(); $f1=""; $f2=""; if (! $_REQUEST['asearch'] && ! $_REQUEST['qsearch']) { print ""; print "
"; print '

Choose a category to pull up a complete listings of vendors, articles and resources.
To limit your search by state or region, choose state or region below first.

'; print "
"; print ""; print ""; //$colcount=0; if (! $_REQUEST['s']) { print ""; print ""; for ($i=0; $i<(count($cats)); $i++) { print ""; for ($x=0; $x<1; $x++) { print ""; } } else { print ""; print ""; $allcats=count($s->getSubCats('%'))+(count($s->getCats())*2); //$allcats=4500; print ""; } print ""; print "
"; print "
 
 "; print "
"; $ckbx2=""; } print "
 
"; for ($i=0; $i<(count($cats)); $i++) { $subcats=$s->getSubCats($cats[$i]); if (! $nospace) { $nospace=1; } else { print "
"; } print "
"; print "

".$cats[$i+((count($cats)/1)*$x)]."

"; print "
"; $catcount+=2; if (count($subcats)>0) { for ($c=0; $c $f1".$subcats[$c]."$f2
"; $catcount++; } } else { print "$f1 General$f2
"; } if ($catcount>($allcats/1)*($colcount+1) && $catcount<$allcats) { print "
  "; $colcount++; $nospace=0; } } print "
 
"; print "
"; print "

Praisebuildings.com is published on the web by Argenti Media Group, LLC, the leader in targeted websites for business and industry. It is marketed under agreement by Five Columns Media, LLC.

We encourage professionals, contractors, suppliers, vendors, craftspeople/artists, religious organizations and others to place links on their Web sites to areas on PraiseBuildings that are of special interest to their users.


"; } else if ($_REQUEST['asearch'] && ! $_REQUEST['nosub']) { print "

Choose a Subcategory...

"; print "
"; print ""; print ""; print "
"; $subcats=$s->getSubCats($_REQUEST['sbx_0']); if (count($subcats)>0) { for ($c=0; $c $f1".$subcats[$c]."$f2
"; $catcount++; if ($catcount>count($subcats)/3) { $catcount=0; print "
"; } } } else { print "$f1 General$f2
"; } print "
"; print ""; print ""; print ""; print ""; } else { print "
"; print "
"; print "

Search Results

"; foreach ($_REQUEST as $var => $val) { if (preg_match("/^sbx_(.*)/", $var, $m)) { $sqlcats.=" || CID_3 LIKE '$val' "; $ok=1; } if (preg_match("/^sbx2_(.*)/", $var, $m)) { $sqlcats.=" || CID_15 LIKE '$val' || CID_15 LIKE '%,$val' || CID_15 LIKE '%,$val,%' || CID_15 LIKE '$val,%' "; $ok=1; } } //print $sqlcats; if (! $ok) { $sqlcats=" || 1"; } if ($_REQUEST['asearch']) { if (! $_REQUEST['region'] && ! $ok) { $sql="SELECT 1 FROM MS_150_Members WHERE 0;"; $maxed=1; } else { $sql="SELECT * FROM MS_150_Members WHERE (CID_23 LIKE '%all 50 states%' || CID_7 LIKE '%".$_REQUEST['region']."%' || CID_23 LIKE '%".$_REQUEST['region']."%') && (0 $sqlcats) "; #print $sql; } } else { if (! preg_match("/\w\w/",$_REQUEST['query'])) { $sql="SELECT 1 FROM MS_150_Members WHERE 0 "; $maxed=1; } else { $sql="SELECT * FROM MS_150_Members WHERE 1 "; $words=preg_split("/\s+/",$_REQUEST['query']); foreach ($words as $word) { $sql.="&& (0 "; for ($i=1; $i<=26; $i++) { $sql.=" || CID_$i LIKE '%".$word."%' "; } $sql.=") "; } } } $sql.=" GROUP BY CID_1 ORDER BY CID_1, CID_2;"; #print $sql; if (! ($result=mysql_query($sql))) { print "error"; #$e->addError("asearch error.",1); } else { $total=mysql_num_rows($result); print ""; if (! $maxed) { if ($total==1) { print ""; if ($total>0) { while ($d = mysql_fetch_array($result, MYSQL_ASSOC)) { $count++; print ""; print ""; } print "
$total company found."; } else if ($total>0) { print "
$total companies found."; } print "
"; } //print "
"; print ""; print "
"; preg_match("/(\d{3})\D*(\d{3})\D*(\d{4})/",$d['CID_9'],$m); if (file_exists("/data/home/praise/www/images/logos/".$m[1].$m[2].$m[3].".jpg")) { print ""; } print ""; print ""; if ($d['CID_1']) { print "".$d['CID_1']."
"; } if ($d['CID_2']) { print $d['CID_2']."
"; } if ($d['CID_4']) { print $d['CID_4']."
"; } if ($d['CID_5']) { print $d['CID_5']."
"; } if ($d['CID_21']) { print $d['CID_21']."
"; } if ($d['CID_6'] || $d['CID_7']) { print $d['CID_6'].", ".$d['CID_7']." ".$d['CID_8']."
"; } if ($d['CID_9']) { print $d['CID_9']."
"; } #if ($d['CID_11']) { print $d['CID_11']." (fax)
"; } if (strlen($d['CID_13'])>2) { print "".$d['CID_13']."
"; } print "
"; print "
"; print ""; if ($d['CID_12']) { print $d['CID_12']."
"; } if ($d['CID_25']) { print $d['CID_25']."
"; } if ($d['CID_26']) { print $d['CID_26']."
"; } if ($d['CID_15']) { print $d['CID_15']."
"; } print "
"; if ($count<$total) { //print "
"; print "

"; } } } else { print "
"; if (! $_REQUEST['region'] && ! $ok) { //print "Your search yielded too many results. Please go back and refine your search."; print "Your search either did not yield results or your query was insufficient. Please go back and refine your search."; } else { print "No results found."; } print "
"; } print "
".$s->showAds()."
"; } include("includes/bottom.php"); ?>