2 |
include("inc/conn.php"); |
include("inc/conn.php"); |
3 |
function myComp($a, $b) { return MyCompare($a["name"], $b["name"]); } |
function myComp($a, $b) { return MyCompare($a["name"], $b["name"]); } |
4 |
function escape_quote($str) { return str_replace('"', """, $str); } |
function escape_quote($str) { return str_replace('"', """, $str); } |
5 |
if ($id) { |
$tpl->assign("ID", $bid); |
6 |
list($bid, $aid) = explode("-", $id); |
if ($bid) { |
7 |
$sql = "SELECT ".($aid?"bolesti_aliasi.alias":"bolesti.naziv")." FROM bolesti".($aid?", bolesti_aliasi":"")." WHERE (bolesti.bolest_id = $bid)".($aid?" AND (bolesti_aliasi.bolest_id = bolesti.bolest_id) AND (bolesti_aliasi.alias_id = $aid)":""); |
list($bid, $aid) = explode("-", $bid); |
|
$sth = $dbh->prepare($sql); |
|
|
if (!$sth) error("Cannot prepare query: \"$sql\""); |
|
|
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
|
|
$row = $sth->fetchrow_array(); |
|
|
$sth->finish(); |
|
|
array_push($PATH, MyUpper($row[0])); |
|
8 |
$sql = "SELECT bolesti.naziv, opis, grupe_bolesti.naziv FROM bolesti, grupe_bolesti WHERE (bolesti.bolest_id = $bid) AND (grupe_bolesti.grupa_b_id = bolesti.grupa_bolesti_id)"; |
$sql = "SELECT bolesti.naziv, opis, grupe_bolesti.naziv FROM bolesti, grupe_bolesti WHERE (bolesti.bolest_id = $bid) AND (grupe_bolesti.grupa_b_id = bolesti.grupa_bolesti_id)"; |
9 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
10 |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
12 |
$row = $sth->fetchrow_array(); |
$row = $sth->fetchrow_array(); |
13 |
$sth->finish(); |
$sth->finish(); |
14 |
list($snaziv, $opis, $grupa) = $row; |
list($snaziv, $opis, $grupa) = $row; |
15 |
|
array_push($PATH, MyUpper($grupa)); |
16 |
|
array_push($PATH, MyUpper($snaziv)); |
17 |
$tpl->assign("bolest", escape_quote($snaziv)); |
$tpl->assign("bolest", escape_quote($snaziv)); |
18 |
$tpl->assign("opis", escape_quote(ParseNewline($opis))); |
$tpl->assign("opis", escape_quote(ParseNewline($opis))); |
19 |
$tpl->assign("grupa", escape_quote($grupa)); |
$tpl->assign("grupa", escape_quote($grupa)); |
23 |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
24 |
$row = $sth->fetchrow_array(); |
$row = $sth->fetchrow_array(); |
25 |
$sth->finish(); |
$sth->finish(); |
26 |
$tpl->assign("thumb", escape_quote($row[0])); |
$tpl->assign("thumb", str_replace("+", "%20", urlencode(escape_quote($row[0])))); |
27 |
$tpl->assign("thumb_alt", escape_quote($row[1])); |
$tpl->assign("thumb_alt", MyEscape($row[1])); |
28 |
$tpl->assign("full", MyEscape($row[2])); |
$tpl->assign("full", str_replace("+", "%20", urlencode(escape_quote($row[2])))); |
29 |
$sql = "SELECT alias FROM bolesti_aliasi WHERE (bolest_id = $bid) ORDER BY alias"; |
$sql = "SELECT alias FROM bolesti_aliasi WHERE (bolest_id = $bid) ORDER BY alias"; |
30 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
31 |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
62 |
} |
} |
63 |
$tpl->assign("slova", $slova); |
$tpl->assign("slova", $slova); |
64 |
} |
} |
|
$tpl->assign("ID", $id); |
|
65 |
$dbh->disconnect(); |
$dbh->disconnect(); |
66 |
?> |
?> |