-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnav.php
109 lines (100 loc) · 3.13 KB
/
nav.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
function showHeader($selectedId='', $title, $cssFiles=Array(), $jsFiles=Array())
{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="keywords" content="cogestione liceo einstein pietrodn" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo htmlspecialchars($title) ?></title>
<link rel="icon" href="images/favicon.ico" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/common.css" rel="stylesheet" />
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<?php
foreach($cssFiles as $f) {
echo '<link rel="stylesheet" href="' . htmlspecialchars($f) . '" />' . "\n";
}
foreach($jsFiles as $f) {
echo '<script src="' . htmlspecialchars($f) . '"></script>' . "\n";
}
?>
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=".">Cogestione 2014</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<?php
$tablinks = array(
array('id' => 'ca-nstab-prenota', 'title' => 'Prenota', 'url' => '.', 'login' => FALSE),
array('id' => 'ca-nstab-elenchi', 'title' => 'Elenchi', 'url' => 'elenchi.php', 'login' => FALSE),
array('id' => 'ca-nstab-grafico', 'title' => 'Grafico', 'url' => 'grafico.php', 'login' => FALSE),
array('id' => 'ca-nstab-imposta', 'title' => 'Imposta', 'url' => 'imposta.php', 'login' => TRUE)
);
foreach($tablinks as $i) {
if(!$i['login'] || isset($_SESSION['auth'])) {
echo "<li " . ($selectedId == $i['id'] ? 'class="active"' : '') . '><a href="' . $i['url'] . '">' . $i['title'] . "</a></li>\n";
}
}
?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?php
if(isset($_SESSION['auth'])) {
?>
<li class="navbar-text">Signed in as <?php echo htmlspecialchars($_SESSION['username']); ?></li>
<li>
<a href="login.php?logout=1">Logout</a>
</li>
<?php
} else {
?>
<li <?php echo ($selectedId == 'ca-nstab-login' ? 'class="active"' : '') ?>>
<a href="login.php">Login</a>
</li>
<?php
}
?>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<div class="page-header">
<h1><?php echo htmlspecialchars($title) ?></h1>
</div>
<!-- start content -->
<?php
}
function showFooter()
{
?>
</div>
<div class="footer">
<div class="container">
<p class="text-muted">
Made by <a href="//github.com/pietrodn">Pietro De Nicolao</a>.
Licensed under the <a href="//www.gnu.org/copyleft/gpl.html">GNU GPLv3 license</a>.
<a href="//github.com/pietrodn/cogestione">Source code</a>.
</p>
</div>
</div>
</body>
</html>
<?php
}
?>