IsStaff()) { WebContextManager::Redirect("/"); } $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));