/[health_html]/inc/pgBolesti-bolesti.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

Diff of /inc/pgBolesti-bolesti.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ravilov, Fri Sep 28 23:34:37 2001 UTC revision 1.2 by ravilov, Sat Sep 29 00:57:58 2001 UTC
# Line 2  Line 2 
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\"");
# Line 18  Line 12 
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));
# Line 27  Line 23 
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\"");
# Line 66  Line 62 
62                  }                  }
63                  $tpl->assign("slova", $slova);                  $tpl->assign("slova", $slova);
64          }          }
         $tpl->assign("ID", $id);  
65          $dbh->disconnect();          $dbh->disconnect();
66  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26