/[corp_html]/human_health.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /human_health.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Mon Mar 5 13:03:45 2001 UTC (23 years, 1 month ago) by dpavlin
Branch: MAIN
Changes since 1.3: +6 -2 lines
preimenovani rx otc dddi

1 <?php
2 require("Smarty.class.php");
3 require("conn.inc");
4
5 $smarty = new Smarty;
6
7 $smarty->assign( array ( Title=>"Pliva d.d." ) );
8
9 $section="products";
10
11 $title="Products : Human Health";
12 $lpic="products"; $lext=".jpg";
13 $mpic="products.gif";
14 $back_url="products.php";
15
16 $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) );
17
18 $sth = $dbh->prepare("select type,description from prod_type");
19 $sth->execute();
20 $types[]="any";
21 while ($row=$sth->fetchrow_array()) {
22 $types[]=$row[0];
23 $type_desc[]=$row[1];
24 }
25 $smarty->assign(array(
26 types=>$types,
27 type_desc=>$type_desc
28 ));
29
30 $sql_where="";
31
32 if (isset($type) && $type!="any") {
33 $sql_where.=" type='$type'";
34 }
35
36 if (isset($search) && $search!="" && $search!="all") {
37 if ($sql_where != "") {
38 $sql_where.=" and ";
39 }
40 $sql_where.=" (upper(brand) like upper('%$search%') or
41 upper(form) like upper('%$search%') or
42 upper(generic) like upper('%$search%') or
43 upper(description) like upper('%$search%') )
44 ";
45 }
46
47 if ($sql_where != "") {
48 $sql_where=" where $sql_where";
49 }
50
51 if (isset($search)) {
52
53 $sth = $dbh->prepare("select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc from products $sql_where order by brand asc");
54 $sth->execute();
55 while ($row=$sth->fetchrow_hash()) {
56 $data[]=$row;
57 }
58
59 if (!$data) {
60 $smarty->assign("data","notfound");
61 }
62
63 $smarty->assign("data",$data);
64 $smarty->assign("search",$search);
65
66 } else {
67 $smarty->assign("search","all");
68 }
69
70 $smarty->assign( array(type=>"$type",
71 show_description=>$show_description
72 ));
73 $main=$smarty->fetch("human_health.tpl");
74
75 include("common.inc");
76 $smarty->assign( array(back_url=>$back_url, MAIN=>$main));
77
78 $smarty->display("index.tpl");
79 ?>

  ViewVC Help
Powered by ViewVC 1.1.26