예제 #1
0
require_once 'busTableGateway.php';
start_session();
//if user is not logged in, return to  log in form
if (!is_logged_in()) {
    header("Location: loginform.php");
}
$user = $_SESSION['user'];
if (!isset($_GET['id'])) {
    die("Illegal Request");
}
$id = $_GET['id'];
$dbconnection = dbconnection::getConnection();
$garageGateway = new garageTableGateway($dbconnection);
$busGateway = new busTableGateway($dbconnection);
//get garage by id based on garageID of bus object
$garages = $garageGateway->getGarageByBusId($id);
//get  bus by id based on the id passed in through the url
$buses = $busGateway->getBusById($id);
if (!$buses) {
    die("Illegal Request");
}
?>

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!--javascript script for delete confirmation-->
        <script src="deleteConfirm.js"></script>
    </head>