-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtopNav.php
More file actions
executable file
·138 lines (124 loc) · 3.94 KB
/
Copy pathtopNav.php
File metadata and controls
executable file
·138 lines (124 loc) · 3.94 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<div class="row border-bottom">
<nav class="navbar navbar-static-top white-bg" role="navigation" style="margin-bottom: 0">
<!-- NAV BAR MINIMIZER -->
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i></a>
</div>
<ul class="nav navbar-top-links navbar-right">
<!-- WELCOME MESSAGE -->
<li>
<span class="m-r-sm text-muted welcome-message">Welcome to White Stone Support Desk.</span>
<?php
$sapi_type = php_sapi_name();
if($sapi_type == "cgi-fcgi") {
?>
<span class="label label-primary"><i class="fa fa-lock" aria-hidden="true"></i>Mode Security: ON</span>
<?php } else { ?>
<span class="label label-danger">Mode Security: OFF</span>
<?php } ?>
</li>
<?php
if($_SESSION['auth'] != 0 && $_SESSION['auth'] != 3)
{
$numberOfNewIncidents = 0;
//Select incident records to display
$TableNameIncident = "INCIDENT";
$TableNameStatus = "INCIDENT_STATUS";
$TableNameIncidentType = "INCIDENT_TYPE";
$SQLstring = "SELECT $TableNameStatus.`IncidentID`, MAX(`StatusTypeID`), `IncidentTypeName` FROM $TableNameStatus, $TableNameIncident, $TableNameIncidentType WHERE $TableNameIncident.`IncidentID` = $TableNameStatus.`IncidentID` AND $TableNameIncident.`IncidentTypeID` = $TableNameIncidentType.`IncidentTypeID` GROUP BY `IncidentID` ORDER BY `DateStart` DESC";
$QueryResult = mysqli_query($DBConnection, $SQLstring);
while ($TableRow = mysqli_fetch_assoc($QueryResult))
{
if ($TableRow['MAX(`StatusTypeID`)'] == 1)
{
$numberOfNewIncidents += 1;
}
}
echo "<!-- DROPDOWN LATEST INSTANCES -->
<li class=\"dropdown\">
<a class=\"dropdown-toggle count-info\" data-toggle=\"dropdown\" href=\"#\">
<i class=\"fa fa-bell\"></i>";
if($numberOfNewIncidents != 0)
{
echo "<span class=\"label label-primary\">" . $numberOfNewIncidents . "</span>";
}
echo "</a>
<ul class=\"dropdown-menu dropdown-alerts\">";
$QueryResult = mysqli_query($DBConnection, $SQLstring);
if($numberOfNewIncidents > 3){
$rowBlocker = 0;
while($row = mysqli_fetch_assoc($QueryResult))
{
if ($row['MAX(`StatusTypeID`)'] == 1)
{
echo "<li>
<a href=\"editIncident.php?IncidentID=" . $row['IncidentID'] . "\">
<div>
<i class=\"fa fa-edit\"></i>
Incident no " . $row['IncidentID'] . "
<small>" . $row['IncidentTypeName'] . "</small>
</div>
</a>
</li>
<li class=\"divider\"></li>";
$rowBlocker += 1;
}
if($rowBlocker == 3)
{
break;
}
}
}
elseif($numberOfNewIncidents > 0)
{
while($row = mysqli_fetch_assoc($QueryResult))
{
if ($row['MAX(`StatusTypeID`)'] == 1)
{
echo "<li>
<a href=\"editIncident.php?IncidentID=" . $row['IncidentID'] . "\">
<div>
<i class=\"fa fa-edit\"></i>
Incident no " . $row['IncidentID'] . "
<small>" . $row['IncidentTypeName'] . "</small>
</div>
</a>
</li>
<li class=\"divider\"></li>";
}
}
}
if($numberOfNewIncidents == 0){
echo "<li>
<div class=\"text-center link-block\">
<strong>There are no new incidents</strong>
</div>
</li>
</ul>
</li>";
}
else
{
echo "<li>
<div class=\"text-center link-block\">
<a href=\"newIncidents.php\">
<strong>See All New Incidents</strong>
<i class=\"fa fa-angle-right\"></i>
</a>
</div>
</li>
</ul>
</li>";
}
mysqli_free_result($QueryResult);
}
?>
<!-- LOGOUT LINK -->
<li>
<a href="login.php">
<i class="fa fa-sign-out"></i> Log out
</a>
</li>
</ul>
</nav>
</div>