This commit is contained in:
jakani24
2024-06-20 15:34:01 +02:00
parent a379d739c8
commit 064e48a0cd
3 changed files with 22 additions and 2 deletions

View File

@@ -105,6 +105,24 @@
</div>';
}
// Create incident table
$sql = "CREATE TABLE IF NOT EXISTS incidents (
id INT AUTO_INCREMENT PRIMARY KEY,
status VARCHAR(50) NOT NULL,
description VARCHAR(255) NOT NULL
)";
if ($conn->query($sql) === TRUE) {
echo '<br><div class="alert alert-success" role="alert">
Table log created successfully!
</div>';
} else {
$success=0;
echo '<br><div class="alert alert-danger" role="alert">
Error creating table log: ' . $conn->error .'
</div>';
}
// Create server log table
$sql = "CREATE TABLE IF NOT EXISTS server_log (
id INT AUTO_INCREMENT PRIMARY KEY,

View File

@@ -72,7 +72,7 @@ include "../../../api/php/log/add_server_entry.php"; //to log things
echo('<table class="table">');
echo('<thead>');
echo('<tr>');
echo('<th>Incident Id</th><th>Status</th><th>Goto Incident</th>');
echo('<th>Incident Id</th><th>Status</th><th>Description</th><th>Goto Incident</th>');
echo('</tr>');
echo('</thead>');
echo('<tbody>');
@@ -86,10 +86,12 @@ include "../../../api/php/log/add_server_entry.php"; //to log things
$row = $result->fetch_assoc();
$last_id=$row["id"];
$status=$row["status"];
$description=$row["description"];
if($last_id!=1){ //number 1 is the unauthenticated user
echo('<tr>');
echo('<td>'.$last_id.'</td>');
echo('<td>'.$status.'</td>');
echo('<td>'.$description.'</td>');
echo('<td><a href="manage_incident.php?incident_id='.$last_id.'">Goto Incident</a></td>');
echo('</tr>');
}

View File

@@ -117,7 +117,7 @@ if(isset($_GET["page"])){
<ul>
<?php
if($perms[9]=="1" or $perms[10]=="1")
echo('<li><a href="index.php?page=manage_incident.php">View Incidents</a></li>');
echo('<li><a href="index.php?page=incident_list.php">View Incidents</a></li>');
if($perms[10]=="1")
echo('<li><a href="index.php?page=add_incident.php">Add Incident</a></li>');
?>