/[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.3 - (hide annotations)
Mon Mar 5 12:01:28 2001 UTC (23 years, 1 month ago) by dpavlin
Branch: MAIN
Changes since 1.2: +1 -1 lines
order by brand

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

  ViewVC Help
Powered by ViewVC 1.1.26