4 |
|
|
5 |
$title.=" : VADEMECUM"; |
$title.=" : VADEMECUM"; |
6 |
|
|
7 |
|
$all_local = "vse"; |
8 |
|
|
9 |
|
function fix_title($t) { |
10 |
|
$t=trim($t); |
11 |
|
if ($sp=strpos($t," ")) { |
12 |
|
$out=strtoupper(substr($t,0,$sp)).substr($t,$sp,strlen($t)-$sp); |
13 |
|
} else { |
14 |
|
$out=strtoupper($t); |
15 |
|
} |
16 |
|
return $out; |
17 |
|
} |
18 |
|
|
19 |
if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) { |
if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) { |
20 |
include_once("read_file.inc"); |
include_once("read_file.inc"); |
21 |
$main = read_file(find_html_file("vade",$smpc)); |
$main = read_file(find_html_file("vade",$smpc)); |
31 |
$title .= " : VETERINA "; |
$title .= " : VETERINA "; |
32 |
break; |
break; |
33 |
} |
} |
34 |
|
|
35 |
|
$row[title]=fix_title($row[title]); |
36 |
|
|
37 |
$title.=" : $row[title]"; |
$title.=" : $row[title]"; |
38 |
$smarty->assign("mtext",$row[title]); |
$smarty->assign("mtext",$row[title]); |
39 |
|
$smarty->assign("back_url",$PHP_SELF."?p=vade"); |
40 |
} |
} |
41 |
} else { |
} else { |
42 |
|
|
43 |
|
$sql_where=array(); |
44 |
|
|
45 |
if (isset($search) && $search!="" && $search!="all" && $search!="vsi") { |
if (isset($search) && $search!="" && $search!="all" && $search!=$all_local) { |
46 |
$sql_where[]="upper(title) like upper('%$search%')"; |
$sql_where[]="upper(title) like upper('%$search%')"; |
47 |
} |
} |
48 |
|
|
61 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
62 |
$sth->execute(); |
$sth->execute(); |
63 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
64 |
|
$row[title]=fix_title($row[title]); |
65 |
$data[]=$row; |
$data[]=$row; |
66 |
} |
} |
67 |
|
|
73 |
$smarty->assign("search",$search); |
$smarty->assign("search",$search); |
74 |
|
|
75 |
} else { |
} else { |
76 |
$smarty->assign("search","vsi"); |
$smarty->assign("search",$all_local); |
77 |
} |
} |
78 |
|
|
79 |
$types = array ('', 'H', 'V'); |
$types = array ('', 'H', 'V'); |
80 |
$types_desc = array ('vsi', 'Zdravila', 'Veterina'); |
$types_desc = array ('kjerkoli', 'zdravila', 'veterina'); |
81 |
|
|
82 |
$smarty->assign( array( |
$smarty->assign( array( |
83 |
type=>$type, |
type=>$type, |
84 |
types=>$types, |
types=>$types, |
85 |
types_desc=>$types_desc, |
types_desc=>$types_desc, |
|
self=>$PHP_SELF, |
|
86 |
title=>$title |
title=>$title |
87 |
)); |
)); |
88 |
$main=$smarty->fetch("vade.tpl"); |
$main=$smarty->fetch("vade.tpl"); |