/[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.4 - (show annotations)
Sat Oct 27 16:54:50 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
Changes since 1.3: +48 -21 lines
Rearranged the menu system on plivamed.net. Other fixes/improvements.

1 <?php
2 include("inc/conn.php");
3 if ($section == "knjiznica") {
4 $menu4 = array(
5 array("name" => "Lijeènièki vjesnik", "secmenu" => "vjesnik"),
6 array("name" => "Infektolo¹ki glasnik", "secmenu" => "inf_glasnik"),
7 array("name" => "MEDICUS", "secmenu" => "medicus"),
8 array("name" => "MedInfo", "secmenu" => "medinfo"),
9 array("name" => "Vodiè za hospitalne infekcije", "secmenu" => "vodic")
10 );
11 $tpl->assign("MENU4", $menu4);
12 } else if ($spec) {
13 $sql = "SELECT opis FROM specijalizacije WHERE (spec_id = $spec)";
14 $sth = $dbh->prepare($sql);
15 if (!$sth) error("Cannot prepare query: \"$sql\"");
16 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
17 $row = $sth->fetchrow_array();
18 $sth->finish();
19 if ($row) $row = array_shift($row);
20 $tpl->assign("MENU4_title", $row);
21 $menu4 = array(
22 array("name" => "HOME", "sec" => "home"),
23 array("name" => "Arhiva vijesti i èlanaka", "sec" => "arhiva"),
24 array("name" => "Kalendar dogaðanja", "sec" => "kalendar"),
25 array("name" => "Linkovi", "sec" => "linkovi")
26 );
27 $tpl->assign("MENU4", $menu4);
28 } else {
29 function my_cmp2($a, $b) { return MyCompare($a["title"], $b["title"]); }
30 $sql = "SELECT MAX(level) FROM specijalizacije";
31 $sth = $dbh->prepare($sql);
32 if (!$sth) error("Cannot prepare query: \"$sql\"");
33 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
34 $levels = array_shift($sth->fetchrow_array());
35 $sth->finish();
36 if (!$levels) $levels = 1;
37 $menu3 = array();
38 for ($i = 0; $i < $levels; $i++) {
39 $sql = "SELECT spec_id, opis, level FROM specijalizacije WHERE (spec_id != 0) AND (NOT link) AND (level = ".($i + 1).")";
40 $sth = $dbh->prepare($sql);
41 if (!$sth) error("Cannot prepare query: \"$sql\"");
42 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
43 $tmp = array();
44 while ($row = $sth->fetchrow_array()) {
45 list($id2, $txt) = $row;
46 array_push($tmp, array("id" => $id2, "title" => MyEscape($txt)));
47 }
48 $sth->finish();
49 usort($tmp, "my_cmp2");
50 array_push($menu3, $tmp);
51 }
52 $MENU3_section = ($section == "home" || $section == "arhiva" || $section == "linkovi" || $section == "kalendar") ? $section : "home";
53 $tpl->assign("MENU3_section", $MENU3_section);
54 $tpl->assign("MENU3", $menu3);
55 }
56 ?>

  ViewVC Help
Powered by ViewVC 1.1.26