/[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

Annotation of /human_health.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations)
Mon Mar 12 16:41:56 2001 UTC (23 years ago) by dpavlin
Branch: MAIN
Changes since 1.5: +1 -1 lines
trademark changes

1 dpavlin 1.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 dpavlin 1.4 $sth = $dbh->prepare("select type,description from prod_type");
19 dpavlin 1.1 $sth->execute();
20     $types[]="any";
21 dpavlin 1.5 $type_desc[]="any";
22 dpavlin 1.1 while ($row=$sth->fetchrow_array()) {
23     $types[]=$row[0];
24 dpavlin 1.4 $type_desc[]=$row[1];
25 dpavlin 1.1 }
26 dpavlin 1.4 $smarty->assign(array(
27     types=>$types,
28     type_desc=>$type_desc
29     ));
30 dpavlin 1.1
31     $sql_where="";
32    
33     if (isset($type) && $type!="any") {
34     $sql_where.=" type='$type'";
35     }
36    
37     if (isset($search) && $search!="" && $search!="all") {
38     if ($sql_where != "") {
39     $sql_where.=" and ";
40     }
41     $sql_where.=" (upper(brand) like upper('%$search%') or
42     upper(form) like upper('%$search%') or
43     upper(generic) like upper('%$search%') or
44     upper(description) like upper('%$search%') )
45     ";
46     }
47    
48     if ($sql_where != "") {
49     $sql_where=" where $sql_where";
50     }
51    
52     if (isset($search)) {
53    
54 dpavlin 1.6 $sql="select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc,tm from products $sql_where order by brand asc";
55 dpavlin 1.5 $sth = $dbh->prepare("$sql");
56 dpavlin 1.1 $sth->execute();
57     while ($row=$sth->fetchrow_hash()) {
58     $data[]=$row;
59     }
60    
61     if (!$data) {
62     $smarty->assign("data","notfound");
63     }
64    
65     $smarty->assign("data",$data);
66     $smarty->assign("search",$search);
67    
68     } else {
69     $smarty->assign("search","all");
70     }
71    
72 dpavlin 1.2 $smarty->assign( array(type=>"$type",
73     show_description=>$show_description
74     ));
75 dpavlin 1.1 $main=$smarty->fetch("human_health.tpl");
76    
77     include("common.inc");
78     $smarty->assign( array(back_url=>$back_url, MAIN=>$main));
79    
80     $smarty->display("index.tpl");
81     ?>

  ViewVC Help
Powered by ViewVC 1.1.26