This repository was archived by the owner on Nov 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplaySystems.php
More file actions
80 lines (75 loc) · 3.33 KB
/
DisplaySystems.php
File metadata and controls
80 lines (75 loc) · 3.33 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
<?php
include('session.php');
include('SQLFunctions.php');
$Role = $_SESSION['role'];
$table = 'system';
$title = "SVBX - Display Status Types";
include('filestart.php');
$link = f_sqlConnect();
$sql = "SELECT SystemID, SystemName, lastUpdated, updatedBy FROM $table ORDER BY SystemName";
$sql1 = "SELECT COUNT(*) FROM $table";
// display Page Heading
if($result = mysqli_query($link,$sql1)) {
echo" <header class='page-header'>
<h1 class='page-title'>Systems</h1>
</header>
<main class='main-content data-page'>
<table class='sumtable'>
<tr class='sumtr'>
<td class='sumtd'>Systems:</td>";
while ($row = mysqli_fetch_array($result)) {
echo "<td class='sumtd'>{$row[0]}</td>";
}
echo" </tr></table>";
}
// display Deficiency Table
if($result = mysqli_query($link,$sql)) {
echo" <table class='table def-table'>
<tr class='def-tr'>
<th class='userth'>ID</th>
<th class='userth'>System</th>";
if(!isset($_SESSION['userID']))
{
echo "</tr>";
} else {
echo "
<th class='userth'>Last Update</th>
<th class='userth'>Updated By</th>
<th class='userth'>Edit</th>";
if($Role >= 40) {
echo "
<th class='userth'>Delete</th>";
}
echo"
</tr>";
}
while ($row = mysqli_fetch_array($result)) {
echo" <tr class='def-tr'>
<td class='usertd'>{$row[0]}</td>
<td class='usertd'>{$row[1]}</td>";
if(!isset($_SESSION['userID']))
{
echo "</tr>";
} else {
echo "
<td class='usertd'>{$row[2]}</td>
<td class='usertd'>{$row[3]}</td>
<td class='usertd'><form action='UpdateSystem.php' method='POST' onsubmit=''>
<button type='submit' name='q' value='{$row[0]}'><i class='typcn typcn-edit'></i></button></form></td>";
if($Role >= 40) {
echo "
<td class='usertd'><form action='DeleteSystem.php' method='POST' onsubmit='' onclick='return confirm(`do you want to delete {$row[1]} Status`)'/>
<button type='Submit' name='q' value='{$row[0]}'><i class='typcn typcn-times'></i></button></form></td>";
}
echo "</tr>";
}
}
echo "</table>";
}
mysqli_free_result($result);
if(mysqli_error($link)) {
echo 'Error: ' .mysqli_error($link);
} else //echo 'Success';
mysqli_close($link);
include 'fileend.php';
?>