-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.php
More file actions
28 lines (23 loc) · 1.07 KB
/
Copy pathmenu.php
File metadata and controls
28 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<ul class="nav nav-pills nav-stacked">
<?php
$curr_page = basename($_SERVER['PHP_SELF']);
//Funzione per creare l'entry nel menu, evidenzio la pagina corrente
function menu_format($target, $current, $desc)
{
$ret = sprintf('<li role="presentation" %s><a href="%s">%s</a></li>', ($target == $current) ? "class=\"active\"" : "", $target, $desc);
return $ret;
}
echo menu_format("index.php", $curr_page, "Home");
if (!$_SESSION['am_i_logged']) { //pagine per i non loggati (login e registra)
echo menu_format("login.php", $curr_page, "Login");
echo menu_format("reg.php", $curr_page, "Registration");
} else { //pagine per i loggati (logout e personale)
echo menu_format("pers_temp.php", $curr_page, "Temperature");
echo menu_format("pers_hum.php", $curr_page, "Humidity");
echo menu_format("pers_press.php", $curr_page, "Pressure");
echo menu_format("pers_lum.php", $curr_page, "Luminosity");
echo menu_format("logout.php", $curr_page, "Logout");
}
unset($curr_page);
?>
</ul>