-
Notifications
You must be signed in to change notification settings - Fork 0
/
navigate.php
106 lines (89 loc) · 2.51 KB
/
navigate.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
<?php
//session_start();
// Include some useful functions
include_once("include/authenticate.inc.php");
#include_once("config/asset.conf.php");
# Create a connection to the database
$db = new mysqli($DBSERVER, $DBUSER, $DBPASSWD, $DBNAME);
/* check connection */
if ($db->connect_errno) {
printf("Connect failed: %s\n", $db->connect_error);
exit();
}
$cmd = $values['cmd'];
// Check to see if the user is logged in with administrative rights.
$priv = authenticate();
if ($priv != FALSE)
{
//$Authorised = true;
switch ($priv)
{
case "Admin":
case "SuperUser":
$Authorised = true;
break;
default:
unset($Authorised);
}
}
else
unset($Authorised);
?>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar">
<ul class="nav nav-sidebar">
<li <?php if ($cmd == "" || !isset($cmd)) echo "class=\"active\"";?>><a href="index.php">Home<span class="sr-only">(current)</span></a></li>
<li <?php if ($cmd == "new") echo "class=\"active\"";?>><a href="index.php?cmd=new">New Asset</a></li>
<li><a href="javascript:DisplayFloorLayout(0,0,0)">View Floor Plan</a></li>
<li <?php if ($cmd == "search" || $cmd == "search_criteria" || $cmd == "edit") echo "class=\"active\"";?>><a href="index.php?cmd=search">Search</a></li>
</ul>
<?php
if ($priv != FALSE)
{
?>
<ul class="nav nav-sidebar">
<li><a href="user_settings.php?cmd=chngpwd">Change password</a></li>
</ul>
<?php
}
?>
<?php
if ($priv == "Admin" || $priv == "SuperUser")
{
?>
<ul class="nav nav-sidebar">
<li><a href="categoryadm.php">Categories</a></li>
<li><a href="clientadm.php">Clients</a></li>
<li><a href="departmentadm.php">Departments</a></li>
<li><a href="sw_licenseadm.php">Software Licenses</a></li>
<li><a href="statusadm.php">Status Levels</a></li>
<li><a href="supplieradm.php">Suppliers</a></li>
<li><a href="index.php?cmd=invoices">Invoices</a></li>
<li><a href="useradm.php">Users</a></li>
</ul>
<?php
}
?>
<ul class="nav nav-sidebar">
<li><a href="javascript:about();">About...</a></li>
</ul>
<?php
if ($priv != FALSE)
{
?>
<ul class="nav nav-sidebar">
<li><a href="login.php?cmd=logout">Logout</a></li>
</ul>
<?php
}
else
{
?>
<ul class="nav nav-sidebar">
<li><a href="login.php">Login</a></li>
</ul>
<?php
}
?>
</div>