--- human_health.php 2001/02/20 12:16:35 1.1.1.1 +++ human_health.php 2001/10/01 14:05:16 1.8 @@ -6,22 +6,23 @@ $smarty->assign( array ( Title=>"Pliva d.d." ) ); -$section="products"; - -$title="Products : Human Health"; -$lpic="products"; $lext=".jpg"; -$mpic="products.gif"; +include("section.inc"); $back_url="products.php"; $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); -$sth = $dbh->prepare("select distinct type from products"); +$sth = $dbh->prepare("select type,description from prod_type"); $sth->execute(); $types[]="any"; +$type_desc[]="any"; while ($row=$sth->fetchrow_array()) { $types[]=$row[0]; + $type_desc[]=$row[1]; } -$smarty->assign("types",$types); +$smarty->assign(array( + types=>$types, + type_desc=>$type_desc + )); $sql_where=""; @@ -46,7 +47,8 @@ if (isset($search)) { - $sth = $dbh->prepare("select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc from products $sql_where"); + $sql="select distinct brand,form,generic,description,type,atc,town,smpc,have_smpc,tm from products $sql_where order by brand asc"; + $sth = $dbh->prepare("$sql"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $data[]=$row; @@ -63,11 +65,13 @@ $smarty->assign("search","all"); } -$smarty->assign("type","$type"); +$smarty->assign( array(type=>"$type", + show_description=>$show_description + )); $main=$smarty->fetch("human_health.tpl"); include("common.inc"); -$smarty->assign( array(back_url=>$back_url, MAIN=>$main)); +$smarty->assign( array(back_url=>$back_url, MAIN=>$main, self=>$PHP_SELF)); $smarty->display("index.tpl"); ?>