PHP-databaskonstruktion

Log | Files | Refs

commit 25770d041173ef70a3aed750a8ab30dd8437dd2e
parent c54c8ab953be1bb1c20c1ca60b7b4055cd69acef
Author: William Lindholm <william_lindholm@outlook.com>
Date:   Wed, 27 Sep 2023 19:13:02 +0000

Changed file strucure.

Diffstat:
Rdbconnection.php -> db/dbconnection.php | 0
Rdbhelper.php -> db/dbhelper.php | 0
Dimports.php | 10----------
Mincidents.php | 4++--
Mindex.php | 4++--
DinsertHandler.php | 112-------------------------------------------------------------------------------
Dlogging.php | 8--------
Moperation.php | 6++----
Moperations.php | 4++--
Mterrain.php | 4++--
Rcomponents.php -> utils/components.php | 0
Autils/imports.php | 10++++++++++
Autils/insertHandler.php | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Autils/logging.php | 8++++++++
Autils/logs.txt | 542+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RmodalBuilder.php -> utils/modalBuilder.php | 0
RpageTemplate.php -> utils/pageTemplate.php | 0
RtableFactory.php -> utils/tableFactory.php | 0
18 files changed, 682 insertions(+), 142 deletions(-)

diff --git a/dbconnection.php b/db/dbconnection.php diff --git a/dbhelper.php b/db/dbhelper.php diff --git a/imports.php b/imports.php @@ -1,9 +0,0 @@ -<?php - require 'dbconnection.php'; - include 'dbhelper.php'; - include 'logging.php'; - include 'components.php'; - include 'modalBuilder.php'; - include 'tableFactory.php'; - include 'insertHandler.php'; -?> -\ No newline at end of file diff --git a/incidents.php b/incidents.php @@ -1,5 +1,5 @@ <?php - require 'imports.php'; + require 'utils/imports.php'; dbconnection::getInstance('mysql', 'a22willi', 'root', 'Safiren1'); $handlerFactory = new InsertHandlerFactory(); @@ -21,5 +21,5 @@ $pageContent .= $modalBuilder->build(); $pageContent .= $modalBuilder->generateOpenButton("Create incident"); - include 'pageTemplate.php'; + include 'utils/pageTemplate.php'; ?> \ No newline at end of file diff --git a/index.php b/index.php @@ -1,5 +1,5 @@ <?php - require 'imports.php'; + require 'utils/imports.php'; dbconnection::getInstance('mysql', 'a22willi', 'root', 'Safiren1'); $handlerFactory = new InsertHandlerFactory(); @@ -38,5 +38,5 @@ $pageContent .= $agentModalBuilder->build(); $pageContent .= $agentModalBuilder->generateOpenButton("Hire agent"); - include 'pageTemplate.php'; + include 'utils/pageTemplate.php'; ?> \ No newline at end of file diff --git a/insertHandler.php b/insertHandler.php @@ -1,111 +0,0 @@ -<?php - interface InsertHandler { - public function handleInsert($data); - } - - class InsertHandlerFactory { - public function createHandler($tableName) { - switch ($tableName) { - case 'Operation': - return new OperationInsertHandler($tableName); - default: - return new GenericInsertHandler($tableName); - } - } - } - - class OperationInsertHandler implements InsertHandler { - private $tableName; - private $pdo; - - public function __construct($tableName) { - $this->tableName = $tableName; - $db = dbconnection::getInstance(); - $this->pdo = $db->getPdo(); - } - - public function handleInsert($data) { - $operationName = $data["OperationName"]; - $startDate = $data["StartDate"]; - $endDate = $data["EndDate"]; - $successRate = (bool) $data["SuccessRate"] ? true : false; - $groupLeader = $data["GroupLeader"]; - $incident = $data["Incident"]; - list($incidentName, $incidentNumber) = explode(", ", $incident); - - $query = "INSERT INTO {$this->tableName} (OperationName, StartDate, EndDate, SuccessRate, GroupLeader, IncidentName, IncidentNumber) VALUES (?, ?, ?, ?, ?, ?, ?)"; - - $stmt = $this->pdo->prepare($query); - - $stmt->bindParam(1, $operationName, PDO::PARAM_STR); - $stmt->bindParam(2, $startDate, PDO::PARAM_STR); - $stmt->bindParam(3, $endDate, PDO::PARAM_STR); - $stmt->bindParam(4, $successRate, PDO::PARAM_BOOL); - $stmt->bindParam(5, $groupLeader, PDO::PARAM_STR); - $stmt->bindParam(6, $incidentName, PDO::PARAM_STR); - $stmt->bindParam(7, $incidentNumber, PDO::PARAM_INT); - - logg("inserting into table {$this->tableName}"); - - if (!$stmt->execute()) { - throw new Exception("Failed to insert data into {$this->tableName}."); - } - - RefreshTables(); - } - } - - class GenericInsertHandler implements InsertHandler { - private $tableName; - private $pdo; - - public function __construct($tableName) { - $this->tableName = $tableName; - $db = dbconnection::getInstance(); - $this->pdo = $db->getPdo(); - } - - public function handleInsert($data) { - unset($data['tableName']); - - $data = $this->convertStringsToAppropriateTypes($data); - - $columns = array_keys($data); - $placeholders = array_fill(0, count($columns), '?'); - - $sql = "INSERT INTO {$this->tableName} (" . implode(', ', $columns) . ") VALUES (" . implode(', ', $placeholders) . ")"; - - $stmt = $this->pdo->prepare($sql); - - logg("inserting into table {$this->tableName}"); - - if (!$stmt->execute(array_values($data))) { - throw new Exception("Failed to insert data into {$this->tableName}."); - } - - RefreshTables(); - } - - private function convertStringsToAppropriateTypes(array $data): array { - foreach ($data as $key => $value) { - if (strtolower($value) === 'true') { - $data[$key] = 1; - } elseif (strtolower($value) === 'false') { - $data[$key] = 0; - } elseif (is_string($value) && ctype_digit($value)) { - $data[$key] = (int) $value; - } - } - return $data; - } - } - - function RefreshTables() { - $location = $_SERVER['PHP_SELF']; - if (!empty($_SERVER['QUERY_STRING'])) { - $location .= "?" . $_SERVER['QUERY_STRING']; - } - header("Location: " . $location); - exit(); - } -?> -\ No newline at end of file diff --git a/logging.php b/logging.php @@ -1,7 +0,0 @@ -<?php - function logg($message) { - $timestamp = date("Y-m-d H:i:s"); - $logMessage = "{$timestamp} - {$message}\n"; - file_put_contents('logs.txt', $logMessage, FILE_APPEND); - } -?> -\ No newline at end of file diff --git a/operation.php b/operation.php @@ -1,7 +1,7 @@ <?php session_start(); - require 'imports.php'; + require 'utils/imports.php'; dbconnection::getInstance('mysql', 'a22willi', 'root', 'Safiren1'); $handlerFactory = new InsertHandlerFactory(); @@ -18,8 +18,6 @@ AND IncidentName = '{$incidentName}' AND IncidentNumber = {$incidentNumber}"; - logg($query); - $pageContent .= "<h3>Agents in $operationName</h3>" . tableFactory::createCustomTable($query); $modalBuilder = (new ModalBuilder()) @@ -37,5 +35,5 @@ $pageContent .= $modalBuilder->build(); $pageContent .= $modalBuilder->generateOpenButton("Add agent"); - include 'pageTemplate.php'; + include 'utils/pageTemplate.php'; ?> \ No newline at end of file diff --git a/operations.php b/operations.php @@ -1,5 +1,5 @@ <?php - require 'imports.php'; + require 'utils/imports.php'; dbconnection::getInstance('mysql', 'a22willi', 'root', 'Safiren1'); $handlerFactory = new InsertHandlerFactory(); @@ -22,5 +22,5 @@ $pageContent .= $modalBuilder->build(); $pageContent .= $modalBuilder->generateOpenButton("Create operation"); - include 'pageTemplate.php'; + include 'utils/pageTemplate.php'; ?> \ No newline at end of file diff --git a/terrain.php b/terrain.php @@ -1,5 +1,5 @@ <?php - require 'imports.php'; + require 'utils/imports.php'; dbconnection::getInstance('mysql', 'a22willi', 'root', 'Safiren1'); $handlerFactory = new InsertHandlerFactory(); @@ -19,5 +19,5 @@ $pageContent .= $modalBuilder->build(); $pageContent .= $modalBuilder->generateOpenButton("Create Terrain"); - include 'pageTemplate.php'; + include 'utils/pageTemplate.php'; ?> \ No newline at end of file diff --git a/components.php b/utils/components.php diff --git a/utils/imports.php b/utils/imports.php @@ -0,0 +1,9 @@ +<?php + require 'db/dbconnection.php'; + include 'db/dbhelper.php'; + include 'logging.php'; + include 'components.php'; + include 'modalBuilder.php'; + include 'tableFactory.php'; + include 'insertHandler.php'; +?> +\ No newline at end of file diff --git a/utils/insertHandler.php b/utils/insertHandler.php @@ -0,0 +1,111 @@ +<?php + interface InsertHandler { + public function handleInsert($data); + } + + class InsertHandlerFactory { + public function createHandler($tableName) { + switch ($tableName) { + case 'Operation': + return new OperationInsertHandler($tableName); + default: + return new GenericInsertHandler($tableName); + } + } + } + + class OperationInsertHandler implements InsertHandler { + private $tableName; + private $pdo; + + public function __construct($tableName) { + $this->tableName = $tableName; + $db = dbconnection::getInstance(); + $this->pdo = $db->getPdo(); + } + + public function handleInsert($data) { + logg("Inserting into: " . $this->tableName); + + $operationName = $data["OperationName"]; + $startDate = $data["StartDate"]; + $endDate = $data["EndDate"]; + $successRate = (bool) $data["SuccessRate"] ? true : false; + $groupLeader = $data["GroupLeader"]; + $incident = $data["Incident"]; + list($incidentName, $incidentNumber) = explode(", ", $incident); + + $query = "INSERT INTO {$this->tableName} (OperationName, StartDate, EndDate, SuccessRate, GroupLeader, IncidentName, IncidentNumber) VALUES (?, ?, ?, ?, ?, ?, ?)"; + + $stmt = $this->pdo->prepare($query); + + $stmt->bindParam(1, $operationName, PDO::PARAM_STR); + $stmt->bindParam(2, $startDate, PDO::PARAM_STR); + $stmt->bindParam(3, $endDate, PDO::PARAM_STR); + $stmt->bindParam(4, $successRate, PDO::PARAM_BOOL); + $stmt->bindParam(5, $groupLeader, PDO::PARAM_STR); + $stmt->bindParam(6, $incidentName, PDO::PARAM_STR); + $stmt->bindParam(7, $incidentNumber, PDO::PARAM_INT); + + if (!$stmt->execute()) { + throw new Exception("Failed to insert data into {$this->tableName}."); + } + + RefreshTables(); + } + } + + class GenericInsertHandler implements InsertHandler { + private $tableName; + private $pdo; + + public function __construct($tableName) { + $this->tableName = $tableName; + $db = dbconnection::getInstance(); + $this->pdo = $db->getPdo(); + } + + public function handleInsert($data) { + logg("Inserting into: " . $this->tableName); + + unset($data['tableName']); + + $data = $this->convertStringsToAppropriateTypes($data); + + $columns = array_keys($data); + $placeholders = array_fill(0, count($columns), '?'); + + $sql = "INSERT INTO {$this->tableName} (" . implode(', ', $columns) . ") VALUES (" . implode(', ', $placeholders) . ")"; + + $stmt = $this->pdo->prepare($sql); + + if (!$stmt->execute(array_values($data))) { + throw new Exception("Failed to insert data into {$this->tableName}."); + } + + RefreshTables(); + } + + private function convertStringsToAppropriateTypes(array $data): array { + foreach ($data as $key => $value) { + if (strtolower($value) === 'true') { + $data[$key] = 1; + } elseif (strtolower($value) === 'false') { + $data[$key] = 0; + } elseif (is_string($value) && ctype_digit($value)) { + $data[$key] = (int) $value; + } + } + return $data; + } + } + + function RefreshTables() { + $location = $_SERVER['PHP_SELF']; + if (!empty($_SERVER['QUERY_STRING'])) { + $location .= "?" . $_SERVER['QUERY_STRING']; + } + header("Location: " . $location); + exit(); + } +?> +\ No newline at end of file diff --git a/utils/logging.php b/utils/logging.php @@ -0,0 +1,7 @@ +<?php + function logg($message) { + $timestamp = date("Y-m-d H:i:s"); + $logMessage = "{$timestamp} - {$message}\n"; + file_put_contents('utils/logs.txt', $logMessage, FILE_APPEND); + } +?> +\ No newline at end of file diff --git a/utils/logs.txt b/utils/logs.txt @@ -0,0 +1,542 @@ +2023-09-27 12:48:16 - Successrate inserted as 1 of type: integer +2023-09-27 12:48:47 - Successrate inserted as 1 of type: integer +2023-09-27 12:49:52 - Successrate inserted as 1 of type: boolean +2023-09-27 12:54:42 - Successrate inserted as 1 of type: boolean +2023-09-27 12:56:43 - Successrate inserted as 1 of type: boolean +2023-09-27 13:10:53 - Successrate inserted as 1 of type: boolean +2023-09-27 13:13:23 - Successrate inserted as 1 of type: boolean +2023-09-27 13:13:44 - Successrate inserted as 1 of type: boolean +2023-09-27 13:13:58 - Successrate inserted as 1 of type: boolean +2023-09-27 13:25:30 - Key: TerrainCode, Value: 6, Type: string +2023-09-27 13:25:30 - Key: TerrainName, Value: Tundra, Type: string +2023-09-27 13:28:36 - Key: TerrainCode, Value: 6, Type: integer +2023-09-27 13:28:36 - Key: TerrainName, Value: Tundra, Type: string +2023-09-27 13:30:30 - INSERT INTO FieldAgentAttributes (TerrainCode,TerrainName) VALUES (?,?) +2023-09-27 13:30:30 - Key: TerrainCode, Value: 6, Type: integer +2023-09-27 13:30:30 - Key: TerrainName, Value: Tundra, Type: string +2023-09-27 13:31:05 - INSERT INTO FieldAgentAttributes (TerrainCode, TerrainName) VALUES (?, ?) +2023-09-27 13:31:05 - Key: TerrainCode, Value: 6, Type: integer +2023-09-27 13:31:05 - Key: TerrainName, Value: Tundra, Type: string +2023-09-27 13:32:33 - INSERT INTO Terrain (TerrainCode, TerrainName) VALUES (?, ?) +2023-09-27 13:32:33 - Key: TerrainCode, Value: 6, Type: integer +2023-09-27 13:32:33 - Key: TerrainName, Value: Tundra, Type: string +2023-09-27 13:34:24 - INSERT INTO Agent (CodeName, FirstName, LastName, Salary, IsFieldAgent, IsGroupLeader, IsManager) VALUES (?, ?, ?, ?, ?, ?, ?) +2023-09-27 13:34:24 - Key: CodeName, Value: K2, Type: string +2023-09-27 13:34:24 - Key: FirstName, Value: Sol, Type: string +2023-09-27 13:34:24 - Key: LastName, Value: Solsson, Type: string +2023-09-27 13:34:24 - Key: Salary, Value: 2000, Type: integer +2023-09-27 13:34:24 - Key: IsFieldAgent, Value: 0, Type: integer +2023-09-27 13:34:24 - Key: IsGroupLeader, Value: 0, Type: integer +2023-09-27 13:34:24 - Key: IsManager, Value: 1, Type: integer +2023-09-27 13:36:10 - INSERT INTO Incident (RegionName, Location, IncidentName, IncidentNumber, Terrain) VALUES (?, ?, ?, ?, ?) +2023-09-27 13:36:10 - Key: RegionName, Value: Götaland, Type: string +2023-09-27 13:36:10 - Key: Location, Value: Sverige, Type: string +2023-09-27 13:36:10 - Key: IncidentName, Value: Skjutning, Type: string +2023-09-27 13:36:10 - Key: IncidentNumber, Value: 999, Type: integer +2023-09-27 13:36:10 - Key: Terrain, Value: 3, Type: integer +2023-09-27 13:43:23 - Running sql query: +2023-09-27 13:45:38 - Running sql query: +2023-09-27 13:46:02 - Running sql query: +2023-09-27 13:48:50 - Running query: +2023-09-27 13:50:57 - inserting into table Terrain +2023-09-27 14:18:17 - operationName: Operation sol Startdate: 2021-03-23 +2023-09-27 14:19:06 - operationName: Operation sol Startdate: 2021-03-23 +2023-09-27 14:19:06 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = Operation sol AND StartDate = 2021-03-23 +2023-09-27 14:19:09 - operationName: Operation Thunder Startdate: 2023-01-01 +2023-09-27 14:19:09 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = Operation Thunder AND StartDate = 2023-01-01 +2023-09-27 14:19:10 - operationName: Operation Thunder Startdate: 2023-01-01 +2023-09-27 14:19:10 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = Operation Thunder AND StartDate = 2023-01-01 +2023-09-27 14:19:46 - operationName: Operation Thunder Startdate: 2023-01-01 +2023-09-27 14:19:46 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation Thunder' AND StartDate = '2023-01-01' +2023-09-27 14:19:52 - operationName: Operation Thunder Startdate: 2023-01-01 +2023-09-27 14:19:52 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation Thunder' AND StartDate = '2023-01-01' +2023-09-27 14:19:54 - operationName: Operation Thunder Startdate: 2023-01-01 +2023-09-27 14:19:54 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation Thunder' AND StartDate = '2023-01-01' +2023-09-27 14:20:01 - operationName: Operation QuickSilver2 Startdate: 2023-02-05 +2023-09-27 14:20:01 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation QuickSilver2' AND StartDate = '2023-02-05' +2023-09-27 14:20:03 - operationName: Operation ForestGuard Startdate: 2023-05-01 +2023-09-27 14:20:03 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation ForestGuard' AND StartDate = '2023-05-01' +2023-09-27 14:20:05 - operationName: Operation DesertStorm Startdate: 2023-04-01 +2023-09-27 14:20:05 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation DesertStorm' AND StartDate = '2023-04-01' +2023-09-27 14:20:10 - operationName: Operation Sol Startdate: 2023-02-21 +2023-09-27 14:20:10 - query: SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation Sol' AND StartDate = '2023-02-21' +2023-09-27 14:36:06 - SELECT CodeName + FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = '103' +2023-09-27 14:36:39 - SELECT CodeName FROM OperatesIn WHERE OperationName = 'Operation NightFall' AND StartDate = '2023-03-10' AND IncidentName = 'Sabotage' AND IncidentNumber = '103' +2023-09-27 14:37:06 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:37:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:37:10 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:37:12 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:37:43 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = 2023-01-01 + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:37:45 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = 2023-02-05 + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:39:58 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = 2023-01-01 + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:44:02 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:44:05 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver3' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:44:07 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:44:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:44:12 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:44:14 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:44:15 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 14:44:17 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2023-05-23' + AND IncidentName = 'Arson' + AND IncidentNumber = 108 +2023-09-27 14:44:19 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:44:23 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation ForestGuard' + AND StartDate = '2023-05-01' + AND IncidentName = 'Breach' + AND IncidentNumber = 105 +2023-09-27 14:46:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:46:16 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:46:34 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:46:39 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:46:39 - inserting into table OperatesIn +2023-09-27 14:47:04 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:47:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:47:08 - inserting into table OperatesIn +2023-09-27 14:48:04 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:48:05 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:48:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 14:48:08 - inserting into table OperatesIn +2023-09-27 14:48:09 - SELECT CodeName FROM OperatesIn + WHERE OperationName = '' + AND StartDate = '' + AND IncidentName = '' + AND IncidentNumber = +2023-09-27 14:49:05 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:49:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:49:08 - inserting into table OperatesIn +2023-09-27 14:49:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = '' + AND StartDate = '' + AND IncidentName = '' + AND IncidentNumber = +2023-09-27 14:49:13 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:49:23 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:49:23 - inserting into table OperatesIn +2023-09-27 14:49:23 - SELECT CodeName FROM OperatesIn + WHERE OperationName = '' + AND StartDate = '' + AND IncidentName = '' + AND IncidentNumber = +2023-09-27 14:49:49 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 14:53:07 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:53:07 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:53:13 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:53:13 - inserting into table OperatesIn +2023-09-27 14:53:19 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:53:45 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 14:53:48 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation ForestGuard' + AND StartDate = '2023-05-01' + AND IncidentName = 'Breach' + AND IncidentNumber = 105 +2023-09-27 14:53:51 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation ForestGuard' + AND StartDate = '2023-05-01' + AND IncidentName = 'Breach' + AND IncidentNumber = 105 +2023-09-27 14:53:51 - inserting into table OperatesIn +2023-09-27 14:53:59 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation ForestGuard' + AND StartDate = '2023-05-01' + AND IncidentName = 'Breach' + AND IncidentNumber = 105 +2023-09-27 15:01:30 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:01:35 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:01:35 - inserting into table OperatesIn +2023-09-27 15:01:39 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:01:42 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 15:02:31 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:02:34 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:02:34 - inserting into table OperatesIn +2023-09-27 15:03:34 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:34 - inserting into table OperatesIn +2023-09-27 15:03:35 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:40 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:43 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:43 - inserting into table OperatesIn +2023-09-27 15:03:50 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Sol' + AND StartDate = '2023-02-21' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:52 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 15:03:55 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:58 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:03:58 - inserting into table OperatesIn +2023-09-27 15:04:01 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:04:04 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:04:10 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:04:10 - inserting into table OperatesIn +2023-09-27 15:04:10 - SELECT CodeName FROM OperatesIn + WHERE OperationName = '' + AND StartDate = '' + AND IncidentName = '' + AND IncidentNumber = +2023-09-27 15:04:14 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:04:21 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation DesertStorm' + AND StartDate = '2023-04-01' + AND IncidentName = 'Espionage' + AND IncidentNumber = 104 +2023-09-27 15:04:24 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:04:27 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:04:27 - inserting into table OperatesIn +2023-09-27 15:04:35 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:04:38 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:04:38 - inserting into table OperatesIn +2023-09-27 15:04:40 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:04:46 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:04:49 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:04:49 - inserting into table OperatesIn +2023-09-27 15:05:58 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:07:15 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation ForestGuard' + AND StartDate = '2023-05-01' + AND IncidentName = 'Breach' + AND IncidentNumber = 105 +2023-09-27 15:07:17 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation sol' + AND StartDate = '2021-03-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:07:19 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Thunder' + AND StartDate = '2023-01-01' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:07:21 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:07:22 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver2' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:07:32 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:10:23 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:10:26 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation NightFall' + AND StartDate = '2023-03-10' + AND IncidentName = 'Sabotage' + AND IncidentNumber = 103 +2023-09-27 15:11:04 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:08 - inserting into table OperatesIn +2023-09-27 15:11:08 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:17 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:17 - inserting into table OperatesIn +2023-09-27 15:11:23 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:37 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:43 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:11:43 - inserting into table OperatesIn +2023-09-27 15:11:43 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation QuickSilver1' + AND StartDate = '2023-02-05' + AND IncidentName = 'Heist' + AND IncidentNumber = 101 +2023-09-27 15:12:04 - inserting into table Agent +2023-09-27 15:12:39 - inserting into table Operation +2023-09-27 15:12:42 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Jonas' + AND StartDate = '2021-01-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:12:46 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Jonas' + AND StartDate = '2021-01-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 15:12:46 - inserting into table OperatesIn +2023-09-27 15:12:47 - SELECT CodeName FROM OperatesIn + WHERE OperationName = 'Operation Jonas' + AND StartDate = '2021-01-23' + AND IncidentName = 'Theft' + AND IncidentNumber = 110 +2023-09-27 19:09:33 - Inserting into: Agent +2023-09-27 19:09:53 - Inserting into: OperatesIn +2023-09-27 19:11:17 - Inserting into: FieldAgentAttributes +2023-09-27 19:11:34 - Inserting into: OperatesIn +2023-09-27 19:11:37 - Inserting into: OperatesIn +2023-09-27 19:11:53 - Inserting into: OperatesIn diff --git a/modalBuilder.php b/utils/modalBuilder.php diff --git a/pageTemplate.php b/utils/pageTemplate.php diff --git a/tableFactory.php b/utils/tableFactory.php