--- inc/pgBolesti-grupe.php 2001/09/28 23:34:37 1.2 +++ inc/pgBolesti-grupe.php 2001/09/29 00:57:58 1.3 @@ -2,18 +2,20 @@ include("inc/conn.php"); function myComp($a, $b) { return MyCompare($a["name"], $b["name"]); } function escape_quote($str) { return str_replace('"', """, $str); } - if ($id) { + $tpl->assign("ID", $gid); + if ($gid) { $grupe = array(); - $sql = "SELECT naziv FROM grupe_bolesti WHERE (grupa_b_id = $id)"; + $sql = "SELECT naziv FROM grupe_bolesti WHERE (grupa_b_id = $gid)"; $sth = $dbh->prepare($sql); if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); $grupa = $sth->fetchrow_array(); $sth->finish(); if ($grupa) $grupa = array_shift($grupa); + array_push($PATH, MyUpper($grupa)); $tpl->assign("naslov", $grupa); $grupe = array(); - $sql = "SELECT bolest_id, naziv FROM bolesti WHERE (grupa_bolesti_id = $id) AND (is_bolest)"; + $sql = "SELECT bolest_id, naziv FROM bolesti WHERE (grupa_bolesti_id = $gid) AND (is_bolest)"; $sth = $dbh->prepare($sql); if (!$sth) error("Cannot prepare query: \"$sql\""); if (!$sth->execute()) error("Cannot execute query: \"$sql\""); @@ -57,6 +59,5 @@ } $tpl->assign("slova", $slova); } - $tpl->assign("ID", $id); $dbh->disconnect(); ?>