" ; echo "" ; echo "" ; echo"\n" ; /*if (!$search) { /* if ($lang=="sp") echo "

Cree su perfil " ; else echo "

Keep Me Posted "; echo "" ; } */ if (!$search){ if($lang=="sp") echo "" ; //echo "" ; /* -----------------Let's build the query here----------------------- */ /* first, split up the keywords */ if ($mode=="alpha") { // echo "alpha=$alpha" ; $query_string="select distinct companylist.company_id, companylist.company_name, companylist.company_profile, companylist.spanish_profile, companylist.phone, companylist.fax,companylist.prod1,companylist.prod2, companylist.prod3, companylist.prod4, companylist.prod5, companylist.prod1_url, companylist.prod2_url, companylist.prod3_url, companylist.prod4_url, companylist.prod5_url from companylist, bgcompmag where companylist.company_name like '$alpha%' and bgcompmag.company_id=companylist.company_id and bgcompmag.magazine_id='$mag_id' order by company_name" ; //echo $query_string; $count_string = "SELECT distinct count(companylist.company_id) AS total from companylist, bgcatcomp, bgcatmag where companylist.company_name like '$alpha%' and bgcatmag.magazine_id='$mag_id' and bgcatcomp.company_id=companylist.company_id and bgcatcomp.category_id=bgcatmag.category_id " ; //echo "search=$search" ; } else { $keywordlist = split(",", $keywords) ; $wordtotal = count($keywordlist) ; $product_string= "" ; $company_string = "" ; /* use bitwise math on 3 bits to check for state of selections */ $today = date( "Ymd"); //echo $today; for($i = 0 ; $i < $wordtotal ; $i++) { $word = $keywordlist[$i] ; if($company_string) { $company_string = $company_string." or companylist.company_name like '%$word%' or companylist.address like '%$word%' or companylist.city like '%$word%'" ; } else { $company_string = "(companylist.company_name like '%$word%' or companylist.address like '%$word%' or companylist.city like '%$word%'" ; } } /* for */ //echo "COM:$company_string, TOTAO:$wordtotal, KEY:$keywords"; $company_string=$company_string.")"; if ($category=="all") { $out_string="select distinct company_id from bgcompmag where magazine_id='$mag_id'" ; $out_result=mysql_query($out_string) ; $out_num=mysql_num_rows($out_result) ; //echo "out_num=$out_num" ; $p=0; while ($test=mysql_fetch_array($out_result)) { if (!$p) $tmp_string=$tmp_string."company_id=$test[company_id]"; else $tmp_string=$tmp_string." or company_id=$test[company_id]"; $p++; } $tmp_string=" (".$tmp_string.")" ; //echo "tmp_string=$tmp_string" ; $query_string="select distinct companylist.company_id, companylist.company_name, companylist.company_profile, companylist.spanish_profile, companylist.phone, companylist.fax,companylist.prod1,companylist.prod2, companylist.prod3, companylist.prod4, companylist.prod5, companylist.prod1_url, companylist.prod2_url, companylist.prod3_url, companylist.prod4_url, companylist.prod5_url from companylist where $tmp_string and $company_string order by company_name" ; } else { $query_string = "select distinct companylist.company_id, companylist.company_name, companylist.company_profile, companylist.spanish_profile, companylist.phone, companylist.fax,companylist.prod1,companylist.prod2, companylist.prod3, companylist.prod4, companylist.prod5, companylist.prod1_url, companylist.prod2_url, companylist.prod3_url, companylist.prod4_url, companylist.prod5_url from companylist, bgcatcomp where companylist.company_id=bgcatcomp.company_id and bgcatcomp.category_id='$category' and $company_string order by companylist.company_name"; } //echo "$query_string" ; $test_string = "companylist, bgcatcomp where companylist.company_id=bgcatcomp.company_id and bgcatcomp.category_id='$category' and $company_string"; //let's weed out the companies who's payment expired $count_string = "SELECT distinct count(*) AS total from $test_string" ; //echo $count_string; } // if $mode==alpha /* this is where we go out and get us some results */ if($search) { /* this is just to make sure we have been called as a search */ /* this is how we puke up the results */ //echo "
" ; //echo $query_string; //echo "
" ; $count=mysql_query("$query_string") ; $query_string = $query_string." LIMIT ".($offset != 0 ? "$offset, 10" : "10" ) ; //echo "
QS: $query_string
"; $results = mysql_query("$query_string" ) ; //echo $query_string; /* this will give us a count of the "real" search */ //echo $count_string; //$count = mysql_query("$count_string") ; //$countarray = mysql_fetch_array($count) ; // $found = mysql_num_rows($results) ; $total = intval($countarray[0]) ; //echo "Found $total" ; if ($count) $total=mysql_num_rows($count) ; //echo "total = $total" ; if ($lang=="sp") { $search_results="Resultados de la búsqueda"; $result_word="Resultados"; } else { $search_results="Search Results"; $result_word="Results"; } switch($total) { case 0: echo "" ; break; default: /* lay out the heading */ if($total > 10) { echo "" ; } else { echo "" ; } /* echo "Getting results ...
" ; */ while($row = mysql_fetch_array($results) ) { if($counter %2 ) { $bgcolor ="#ffffcc" ; /* odd, white color */ } else { $bgcolor = "ffffff" ; /* even, pink color */ } /* if counter */ echo "" ; } else { //echo $row[thru]; echo "" ; echo "$row[company_name]
"; if($lang=="sp") echo "Teléfono:"; else echo "Phone:"; echo " " ; echo "$row[phone] Fax: $row[fax]
" ; if($lang=="sp") echo "$row[spanish_profile]" ; else echo "$row[company_profile]" ; if ($row[prod1_url] || $row[prod2_url] || $row[prod3_url] || $row[prod4_url] || $row[prod5_url]) echo "
Product reviews" ; echo "

" ; } $counter = $counter + 1 ; } /* while */ break ; } /* switch total */ } /* if $search */ /* do something about those next and previous buttons */ echo "" ; /* this is the box opened for the button bar */ echo "
"; if ($lang=="sp") echo "Proveedores:  "; else echo "Suppliers:  "; echo ""; if ($lang=="sp") echo "Actualicen sus productos "; else echo "Update your product listings "; echo "" ; if ($lang=="sp") echo "aquí" ; else echo "here" ; echo ".
" ; echo "
Add new listing here.
"; // } this is that preemptive thing echo "" ; echo "
" ; /* if ($mag_id=="7") { echo "
" ; echo "Please select the database you wish to search in the Manufacturing & Processing group 

" ; echo "" ; echo "" ; echo "

" ; } if ($mag_id=="5") { echo "
" ; echo "Please select the database you wish to search in the Instrumentation group 

" ; echo "" ; echo "" ; echo "

" ; } else { */ // $mag="bgcatmag.magazine_id='chem' or bgcatmag.magazine_id='wir'" ; //else $mag="bgcatmag.magazine_id='$mag_id'" ; echo "
" ; echo ""; echo "
"; if ($lang=="sp") echo "Guía del Comprador"; else echo "Buyer's Guide"; echo"
"; //if ($lang=="sp") // echo "Conteniendo las palabras"; //else // echo "Search by keywords: "; //echo " " ; //echo "" ; //echo "
" ; //echo "

" ; //echo "
"; if ($lang=="sp") echo "Encontrar compañías en las categorías siguientes: 
" ; else echo "Select a category to view listings: 
"; echo "
"; //note we're using magazine code in categories //lets pass in group_id from query string. // setting magazine id = // Look up the English name of the publication if ($lang=="sp") $catlist = mysql_query("SELECT distinct categorylist.category_id, categorylist.name_sp from categorylist where magazine_id='$mag_id' and categorylist.active='Y' order by name_sp" ) ; else $catlist = mysql_query("SELECT distinct categorylist.category_id, categorylist.name_eng from categorylist where magazine_id='$mag_id' and categorylist.active='Y' order by name_eng" ) ; //echo "mag_id = $test_id" ; echo "\n" ; echo "" ; echo "" ; echo "
" ; if($lang=="sp") echo "Buscar por nombre de compañía
" ; else echo "Search by company name:  
"; echo "a " ; echo "b " ; echo "c " ; echo "d " ; echo "e " ; echo "f " ; echo "g " ; echo "h " ; echo "i " ; echo "j " ; echo "k " ; echo "l " ; echo "m " ; echo "n " ; echo "o " ; echo "p " ; echo "q " ; echo "r " ; echo "s " ; echo "t " ; echo "u " ; echo "v " ; echo "w " ; echo "x " ; echo "y " ; echo "z " ; //echo "
¿Qué productos o servicios le interesan más?
Llene simplemente el formulario \"Manténgame informado\" y le haremos saber inmediatamente por e-mail cuando se agregue un nombre a la guía de compradores de la categoría de los productos/servicios que haya escogido."; else echo "
What products/services are most interesting to you?
Simply fill out our \"Keep Me Posted\" form and you will instantly be notified by e-mail when a buyers' guide listing is added to your pre-selected product/services categories."; } echo "\n" ; echo "\n" ; echo "" ; echo "
" ; echo "
"; //
echo "
No Results
$result_word " ; echo $min." to ". ( $max > $total ? $total : $max) ." of ". $total ; echo "
$search_results:
" ; if($type == products) { // $x = mysql_query("SELECT company from bgcompanies where record_id='$row[company_id]'") ; $x = mysql_query("SELECT companyname from companylist where company_id='$row[company_id]'") ; $y = mysql_fetch_array($x) ; echo "" ; echo "$row[name_eng]
Offered By: $y[company]
" ; echo "
$row[description]
Price: $row[pricing]

" ; /* this is a box for the table */ if( $total > $maxperpage) { echo "
\n" ; echo "\n" ; echo "\n\n" ; echo "\n
" ; if($min != 1) { /* show left/right */ echo "" ; } echo "" ; if($max < $total) { echo ">\">" ; } echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "\n" ; echo "
" ; /* this is the button table */ } // if $total > $maxperpage echo "\n" ; echo "\n" ; // echo "
\n" ; if($lang=="sp") include "include_bottom".$mag_id."sp.htm" ; else include "include_bottom".$mag_id.".htm" ; // Bottom Includes /* if ($mag_id=="" || $mag_id=="1" || $mag_id=="agri") { $tmp_mag_id=$mag_id; // used to hold id for when submitting this works around to get the includes in $mag_id="agri"; if ($lang=="sp") include "include_bottom1sp.htm" ; else include "include_bottom1.htm" ; } if ($mag_id=="2") { if ($lang=="sp") include "include_bottom2sp.htm" ; else include "include_bottom2.htm" ; } if ($mag_id=="3" || $mag_id=="petro") { $tmp_mag_id=$mag_id; $mag_id="petro" ; if ($lang=="sp") include "include_bottom3sp.htm" ; else include "include_bottom3.htm" ; } if ($mag_id=="4" || $mag_id=="gfs" ){ $tmp_mag_id=$mag_id; $mag_id="gfs"; if ($lang=="sp") include "include_bottom4sp.htm" ; else include "include_bottom4.htm" ; } if ($mag_id=="5" || $mag_id=="laa") { //$mag_id="iic"; if ($lang=="sp") include "include_bottom5sp.htm" ; else include "include_bottom5.htm" ; } if ($mag_id=="6" || $mag_id=="glscs" ) { if ($lang=="sp") include "include_bottom6sp.htm" ; else include "include_bottom6.htm" ; } if ($mag_id=="7" || $mag_id=="iic" ) { if ($lang=="sp") include "include_bottom7sp.htm" ; else include "include_bottom7.htm" ; } if ($mag_id=="8" || $mag_id=="chem" ) { if ($lang=="sp") include "include_bottom8sp.htm" ; else include "include_bottom8.htm" ; } if ($mag_id=="9" || $mag_id=="wir" ) { if ($lang=="sp") include "include_bottom9sp.htm" ; else include "include_bottom9.htm" ; } //echo ""; /* if ($lang=="sp") { if ($mag_id=="petro") include "include/include_bottom3sp.htm" ; if ($mag_id=="agri" || $mag_id=="") include "include/include_foot1sp.htm" ; if ($mag_id=="chem" || $mag_id=="wir") include "include/include_foot7sp.htm" ; if ($mag_id=="iic" || $mag_id=="laa") include "include/include_foot5sp.htm" ; if ($mag_id=="gfs") include "include/include_top4sp.htm" ; } else { if ($mag_id=="petro") include "include/include_foot3.htm" ; if ($mag_id=="agri" || $mag_id=="") include "include/include_foot1.htm" ; if ($mag_id=="chem" || $mag_id=="wir") include "include/include_foot7.htm" ; if ($mag_id=="iic" || $mag_id=="laa") include "include/include_foot5.htm" ; if ($mag_id=="gfs") include "include/include_top4.htm" ; } */ ?>