/[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.5 - (show annotations)
Mon Oct 29 14:43:21 2001 UTC (17 years, 7 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -0 lines
Added a new page (Farmaceutski glasnik) to plivamed. Other improvements/fixes.

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

  ViewVC Help
Powered by ViewVC 1.1.26