18 lines
666 B
PHP
18 lines
666 B
PHP
<?php
|
|
session_start();
|
|
require_once 'config.php';
|
|
header('Content-Type: application/json');
|
|
|
|
if (isset($_SESSION["username"]))
|
|
{
|
|
$conn = dbConn();
|
|
$stmt = $conn->prepare("SELECT Vehicle_type, People_name, Incident_Date, Incident_Report, Offence_description FROM Incident INNER JOIN People P on Incident.People_ID = P.People_ID INNER JOIN Vehicle V on Incident.Vehicle_ID = V.Vehicle_ID INNER JOIN Offence O on Incident.Offence_ID = O.Offence_ID;");
|
|
$stmt->execute();
|
|
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
echo json_encode(array("message" => "ok", "data" => $result));
|
|
}
|
|
else
|
|
{
|
|
echo json_encode(array("message" => "Not logged in "));
|
|
}
|