+ connect_error) {
+ die("Connection failed: " . $conn->connect_error);
+ }
+
+
+ //get count of users
+
+ $sql = "SELECT count(*) AS incident_count FROM incidents";
+ $stmt = $conn->prepare($sql);
+ // Execute the statement
+ $stmt->execute();
+ // Get the result
+ $result = $stmt->get_result();
+ $row = $result->fetch_assoc();
+ $num_of_incidents=$row["incident_count"];
+ $stmt->close();
+
+ // Create a connection
+ $conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
+
+ // Check the connection
+ if ($conn->connect_error) {
+ die("Connection failed: " . $conn->connect_error);
+ }
+ $last_id=-1;
+ //create the table header
+ echo('
');
+ echo('');
+ echo('');
+ echo('| Incident Id | Status | Goto Incident | ');
+ echo('
');
+ echo('');
+ echo('');
+ while($num_of_incidents!=0){
+ $sql = "SELECT * FROM incidents where id > $last_id";
+ $stmt = $conn->prepare($sql);
+ // Execute the statement
+ $stmt->execute();
+ // Get the result
+ $result = $stmt->get_result();
+ $row = $result->fetch_assoc();
+ $last_id=$row["id"];
+ $status=$row["status"];
+ if($last_id!=1){ //number 1 is the unauthenticated user
+ echo('');
+ echo('| '.$last_id.' | ');
+ echo(''.$status.' | ');
+ echo('Goto Incident | ');
+ echo('
');
+ }
+ $stmt->close();
+ $num_of_incidents--;
+ }
+ echo('');
+ echo('
');
+ $conn->close();
+ ?>
+