5 |
$title.=" : VADEMECUM"; |
$title.=" : VADEMECUM"; |
6 |
|
|
7 |
if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) { |
if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) { |
8 |
$main=join('',file(find_html_file("vade",$smpc))); |
include_once("read_file.inc"); |
9 |
|
$main = read_file(find_html_file("vade",$smpc)); |
10 |
|
|
11 |
$sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc"); |
$sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc"); |
12 |
$sth->execute(); |
$sth->execute(); |
13 |
if ($row=$sth->fetchrow_hash()) { |
if ($row=$sth->fetchrow_hash()) { |
14 |
switch ($row[type]) { |
switch ($row[type]) { |
15 |
case 'H' : |
case 'H' : |
16 |
$title.=" : HUMAN "; |
$title.=" : ZDRAVILA "; |
17 |
break; |
break; |
18 |
case 'V' : |
case 'V' : |
19 |
$title .= " : VETERINA "; |
$title .= " : VETERINA "; |
26 |
} else { |
} else { |
27 |
|
|
28 |
|
|
29 |
if (isset($search) && $search!="" && $search!="all") { |
if (isset($search) && $search!="" && $search!="all" && $search!="vsi") { |
30 |
$sql_where[]="upper(title) like upper('%$search%')"; |
$sql_where[]="upper(title) like upper('%$search%')"; |
31 |
} |
} |
32 |
|
|
41 |
$sql.=" where ".join(" and ",$sql_where); |
$sql.=" where ".join(" and ",$sql_where); |
42 |
} |
} |
43 |
$sql.=" order by title asc"; |
$sql.=" order by title asc"; |
44 |
print "<pre>$sql</pre>"; |
# print "<pre>$sql</pre>"; |
45 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
46 |
$sth->execute(); |
$sth->execute(); |
47 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
56 |
$smarty->assign("search",$search); |
$smarty->assign("search",$search); |
57 |
|
|
58 |
} else { |
} else { |
59 |
$smarty->assign("search","all"); |
$smarty->assign("search","vsi"); |
60 |
} |
} |
61 |
|
|
62 |
|
$types = array ('', 'H', 'V'); |
63 |
|
$types_desc = array ('vsi', 'Zdravila', 'Veterina'); |
64 |
|
|
65 |
$smarty->assign( array( |
$smarty->assign( array( |
66 |
type=>"$type", |
type=>$type, |
67 |
|
types=>$types, |
68 |
|
types_desc=>$types_desc, |
69 |
self=>$PHP_SELF, |
self=>$PHP_SELF, |
70 |
title=>$title |
title=>$title |
71 |
)); |
)); |