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

Contents of /inc/menuMED.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Tue Sep 25 15:38:04 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Changes since 1.1: +18 -8 lines
Major changes. Too numeruous to mention all here.

1 <?php
2 function my_cmp2($a, $b) { return MyCompare($a["title"], $b["title"]); }
3 include("inc/conn.php");
4 $sql = "SELECT MAX(level) FROM specijalizacije";
5 $sth = $dbh->prepare($sql);
6 if (!$sth) error("Cannot prepare query: \"$sql\"");
7 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
8 $levels = array_shift($sth->fetchrow_array());
9 $sth->finish();
10 if (!$levels) $levels = 1;
11 $menu3 = array();
12 for ($i = 0; $i < $levels; $i++) {
13 $sql = "SELECT spec_id, opis, level FROM specijalizacije WHERE (spec_id != 0) AND (NOT link) AND (level = ".($i + 1).")";
14 $sth = $dbh->prepare($sql);
15 if (!$sth) error("Cannot prepare query: \"$sql\"");
16 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
17 $tmp = array();
18 while ($row = $sth->fetchrow_array()) {
19 list($id2, $txt) = $row;
20 array_push($tmp, array("id" => $id2, "title" => MyEscape($txt)));
21 }
22 $sth->finish();
23 usort($tmp, "my_cmp2");
24 array_push($menu3, $tmp);
25 }
26 $tpl->assign("MENU3", $menu3);
27 ?>

  ViewVC Help
Powered by ViewVC 1.1.26