From 3ae104124cdc2f0ffde9efed8a252fac13c357f4 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 1 Nov 2021 06:39:02 -0400 Subject: [PATCH] finishing up reports --- html/MCP/reports/data/reports.php | 32 +++++++++++++++++++++++ html/MCP/reports/index.php | 43 ++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 html/MCP/reports/data/reports.php diff --git a/html/MCP/reports/data/reports.php b/html/MCP/reports/data/reports.php new file mode 100644 index 0000000..4098569 --- /dev/null +++ b/html/MCP/reports/data/reports.php @@ -0,0 +1,32 @@ +isStaff()) { + redirect("/MCP"); +} + +$report = $GLOBALS['pdo']->prepare("SELECT * FROM user_reports WHERE closed = 0 ORDER BY whenReported ASC"); +$report->execute(); +if ($report->rowCount() == 0) { + die(json_encode(["alert"=>"No reports found"])); +} + +$jsonData = array(); + +foreach($report as $report) { + $chatData = array( + "id" => $report['id'], + "reported" => date("m/d/Y", $report['whenReported']) + ); + + array_push($jsonData, $chatData); +} + +die(json_encode($jsonData)); \ No newline at end of file diff --git a/html/MCP/reports/index.php b/html/MCP/reports/index.php index 7227a77..8febc1b 100644 --- a/html/MCP/reports/index.php +++ b/html/MCP/reports/index.php @@ -9,4 +9,45 @@ if(!$user->isStaff()) { redirect("/"); } -echo "soon"; \ No newline at end of file +$body = <<Open Reports +
+ +
+
+
+
+ +
+
+
+
+
+ + +EOT; + +pageHandler(); +$ph->pageTitle("Reports"); +$ph->body = $body; +$ph->output(); \ No newline at end of file