/[pliva-si]/sections/vade.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /sections/vade.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Mon Nov 19 11:24:57 2001 UTC (22 years, 5 months ago) by dpavlin
Branch: MAIN
Changes since 1.2: +1 -0 lines
back works

1 dpavlin 1.1 <?php
2    
3     include_once("find_html_file.inc");
4    
5     $title.=" : VADEMECUM";
6    
7     if (isset($smpc) && $smpc >= 1000 && $smpc <= 9999 && find_html_file("vade",$smpc)) {
8 dpavlin 1.2 include_once("read_file.inc");
9     $main = read_file(find_html_file("vade",$smpc));
10 dpavlin 1.1
11     $sth = $dbh->prepare("select smpc,type,title from vademecum where smpc=$smpc");
12     $sth->execute();
13     if ($row=$sth->fetchrow_hash()) {
14     switch ($row[type]) {
15     case 'H' :
16 dpavlin 1.2 $title.=" : ZDRAVILA ";
17 dpavlin 1.1 break;
18     case 'V' :
19     $title .= " : VETERINA ";
20     break;
21     }
22    
23     $title.=" : $row[title]";
24     $smarty->assign("mtext",$row[title]);
25 dpavlin 1.3 $smarty->assign("back_url",$PHP_SELF."?p=vade");
26 dpavlin 1.1 }
27     } else {
28    
29    
30 dpavlin 1.2 if (isset($search) && $search!="" && $search!="all" && $search!="vsi") {
31 dpavlin 1.1 $sql_where[]="upper(title) like upper('%$search%')";
32     }
33    
34     if (isset($type) && $type != "") {
35     $sql_where[]="upper(type)=upper('$type')";
36     }
37    
38     if (isset($search)) {
39    
40     $sql = "select distinct smpc,type,title from vademecum ";
41     if ($sql_where) {
42     $sql.=" where ".join(" and ",$sql_where);
43     }
44     $sql.=" order by title asc";
45 dpavlin 1.2 # print "<pre>$sql</pre>";
46 dpavlin 1.1 $sth = $dbh->prepare($sql);
47     $sth->execute();
48     while ($row=$sth->fetchrow_hash()) {
49     $data[]=$row;
50     }
51    
52     if (!$data) {
53     $smarty->assign("data","notfound");
54     }
55    
56     $smarty->assign("data",$data);
57     $smarty->assign("search",$search);
58    
59     } else {
60 dpavlin 1.2 $smarty->assign("search","vsi");
61 dpavlin 1.1 }
62    
63 dpavlin 1.2 $types = array ('', 'H', 'V');
64     $types_desc = array ('vsi', 'Zdravila', 'Veterina');
65    
66 dpavlin 1.1 $smarty->assign( array(
67 dpavlin 1.2 type=>$type,
68     types=>$types,
69     types_desc=>$types_desc,
70 dpavlin 1.1 self=>$PHP_SELF,
71     title=>$title
72     ));
73     $main=$smarty->fetch("vade.tpl");
74    
75     }
76    
77     ?>

  ViewVC Help
Powered by ViewVC 1.1.26