57 |
while ($row = $sth->fetchrow_array()) array_push($aliasi, MyEscape($row[0])); |
while ($row = $sth->fetchrow_array()) array_push($aliasi, MyEscape($row[0])); |
58 |
$sth->finish(); |
$sth->finish(); |
59 |
$tpl->assign("aliases", $aliasi); |
$tpl->assign("aliases", $aliasi); |
60 |
$sql = "SELECT bolesti.bolest_id, bolesti.naziv, simptomi_bolesti.vjerojatnost FROM bolesti, simptomi_bolesti WHERE (bolesti.bolest_id = simptomi_bolesti.bolest_id) AND (simptomi_bolesti.simptom_id = $sid) ORDER BY simptomi_bolesti.vjerojatnost, bolesti.naziv"; |
$sql = "SELECT bolesti.bolest_id, bolesti.is_bolest, bolesti.naziv, simptomi_bolesti.vjerojatnost FROM bolesti, simptomi_bolesti WHERE (bolesti.bolest_id = simptomi_bolesti.bolest_id) AND (simptomi_bolesti.simptom_id = $sid) ORDER BY simptomi_bolesti.vjerojatnost, bolesti.naziv"; |
61 |
$sth = $dbh->prepare($sql); |
$sth = $dbh->prepare($sql); |
62 |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
if (!$sth) error("Cannot prepare query: \"$sql\""); |
63 |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
if (!$sth->execute()) error("Cannot execute query: \"$sql\""); |
64 |
$bolesti = array(); |
$bolesti = array(); |
65 |
$uobicajeno = $povremeno = $rijetko = false; |
$uobicajeno = $povremeno = $rijetko = false; |
66 |
while ($row = $sth->fetchrow_array()) { |
while ($row = $sth->fetchrow_array()) { |
67 |
list($bid, $naziv, $vjer) = $row; |
list($bid, $is, $naziv, $vjer) = $row; |
68 |
if ($vjer == 1) $uobicajeno = true; |
if ($vjer == 1) $uobicajeno = true; |
69 |
if ($vjer == 2) $povremeno = true; |
if ($vjer == 2) $povremeno = true; |
70 |
if ($vjer == 3) $rijetko = true; |
if ($vjer == 3) $rijetko = true; |
71 |
|
if ($is[0] == "f" || $is[0] == "F") unset($is); |
72 |
array_push($bolesti, array( |
array_push($bolesti, array( |
73 |
"id" => "$bid-0", |
"id" => "$bid-0", |
74 |
|
"is" => $is ? true : false, |
75 |
"naziv" => escape_quote($naziv), |
"naziv" => escape_quote($naziv), |
76 |
"vjerojatnost" => $vjer |
"vjerojatnost" => $vjer |
77 |
)); |
)); |