updating incidents
This commit is contained in:
@@ -109,7 +109,9 @@
|
|||||||
$sql = "CREATE TABLE IF NOT EXISTS incidents (
|
$sql = "CREATE TABLE IF NOT EXISTS incidents (
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
status VARCHAR(50) NOT NULL,
|
status VARCHAR(50) NOT NULL,
|
||||||
description VARCHAR(255) NOT NULL
|
description VARCHAR(255) NOT NULL,
|
||||||
|
opened VARCHAR(50),
|
||||||
|
closed VARCHAR(50)
|
||||||
)";
|
)";
|
||||||
|
|
||||||
if ($conn->query($sql) === TRUE) {
|
if ($conn->query($sql) === TRUE) {
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ include "../../../api/php/log/add_server_entry.php"; //to log things
|
|||||||
$success=0;
|
$success=0;
|
||||||
die("Connection failed: " . $conn->connect_error);
|
die("Connection failed: " . $conn->connect_error);
|
||||||
}
|
}
|
||||||
$stmt = $conn->prepare("INSERT INTO incidents (description, status) VALUES (?, 'open')");
|
$date=date("Y-m-d");
|
||||||
$stmt->bind_param("s", $keyword);
|
$stmt = $conn->prepare("INSERT INTO incidents (description, status, opened) VALUES (?, 'open', ?)");
|
||||||
|
$stmt->bind_param("ss", $keyword,$date);
|
||||||
|
|
||||||
$keyword=htmlspecialchars($_POST["keyword"]);
|
$keyword=htmlspecialchars($_POST["keyword"]);
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,21 @@ if(isset($_GET["update_box_id"])){
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<div id="overview" style="display:none">
|
<div id="overview" style="display:none">
|
||||||
|
<h4>Incident #<?php echo($_GET["incident_id"]); ?></h4>
|
||||||
|
<?php
|
||||||
|
//get some info about the incident from the db
|
||||||
|
$sql="SELECT * FROM incidents WHERE id = ?";
|
||||||
|
$stmt = $conn->prepare($sql);
|
||||||
|
$incident_id=htmlspecialchars($_GET["incident_id"]);
|
||||||
|
$stmt->bind_param("i", $incident_id);
|
||||||
|
$stmt->execute();
|
||||||
|
$results = $stmt->get_result();
|
||||||
|
$data = $results->fetch_assoc();
|
||||||
|
echo("<p>Status: ".$data["status"]."</p>");
|
||||||
|
echo("<p>Description: ".$data["description"]."</p>");
|
||||||
|
echo("<p>Opened: ".$data["opened"]."</p>");
|
||||||
|
echo("<p>Closed: ".$data["closed"]."</p>");
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div id="evidence" style="display:none">
|
<div id="evidence" style="display:none">
|
||||||
|
|
||||||
@@ -127,11 +141,6 @@ if(isset($_GET["update_box_id"])){
|
|||||||
<a data-bs-target="#add_todo" data-bs-toggle="modal" href="#add_todo" class="btn btn-primary">Add a todo list</a>
|
<a data-bs-target="#add_todo" data-bs-toggle="modal" href="#add_todo" class="btn btn-primary">Add a todo list</a>
|
||||||
<br><br>
|
<br><br>
|
||||||
<?php
|
<?php
|
||||||
//list todos from all lists
|
|
||||||
|
|
||||||
//list todos -> list each entry of each todo
|
|
||||||
|
|
||||||
|
|
||||||
$sql_lists = "SELECT id, name FROM todo_lists WHERE belongs_to_incident = ?";
|
$sql_lists = "SELECT id, name FROM todo_lists WHERE belongs_to_incident = ?";
|
||||||
$stmt = $conn->prepare($sql_lists);
|
$stmt = $conn->prepare($sql_lists);
|
||||||
$incident_id=htmlspecialchars($_GET["incident_id"]);
|
$incident_id=htmlspecialchars($_GET["incident_id"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user