8 |
|
|
9 |
$section="products"; |
$section="products"; |
10 |
|
|
11 |
$title="Products : Animal Health"; |
include("section.inc"); |
|
$lpic="products"; $lext=".jpg"; |
|
|
$mpic="products.gif"; |
|
12 |
$back_url="products.php"; |
$back_url="products.php"; |
13 |
|
|
14 |
$sql_where=array(); |
$sql_where=array(); |
58 |
if (isset($search) && $search!="" && $search!="all") { |
if (isset($search) && $search!="" && $search!="all") { |
59 |
$sql_where[]=" (upper(brand) like upper('%$search%') or |
$sql_where[]=" (upper(brand) like upper('%$search%') or |
60 |
upper(form) like upper('%$search%') or |
upper(form) like upper('%$search%') or |
61 |
upper(generic) like upper('%$search%') or |
upper(composition) like upper('%$search%') or |
62 |
upper(description) like upper('%$search%') ) |
upper(description) like upper('%$search%') ) |
63 |
"; |
"; |
64 |
} |
} |
69 |
|
|
70 |
if (isset($search)) { |
if (isset($search)) { |
71 |
|
|
72 |
$sth = $dbh->prepare("select distinct brand,form,composition,description,type,smpc from vet_products $sql_where"); |
$sth = $dbh->prepare("select distinct brand,form,composition,description,type,smpc,have_smpc from vet_products $sql_where order by brand asc"); |
73 |
$sth->execute(); |
$sth->execute(); |
74 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
75 |
if ($show_animals) { |
if ($show_animals) { |
76 |
$sth2 = $dbh->prepare("select vet_animal_product.animal,name from vet_animal_product,vet_animal where vet_animal_product.animal=vet_animal.animal and smpc=$row[smpc] order by brand asc"); |
$sth2 = $dbh->prepare("select distinct vet_animal_product.animal,name from vet_animal_product,vet_animal where vet_animal_product.animal=vet_animal.animal and smpc=$row[smpc]"); |
77 |
$sth2->execute(); |
$sth2->execute(); |
78 |
unset($animals); |
unset($animals); |
79 |
while ($row2=$sth2->fetchrow_hash()) { |
while ($row2=$sth2->fetchrow_hash()) { |