Exemple #1
0
<!DOCTYPE html>
<?php 
require_once '../db.php';
$Database = new DbUtil();
$userName = $Database->getUserName();
if ($userName == null) {
    header('Location: ../login.php', true, 303);
    exit;
}
$ID = $_GET['stopid'];
$LINE = $_GET['lineid'];
$stopData = $Database->getStop($ID);
$lineName = $Database->getLineName($LINE, $userName);
$timeData = $_POST['time'];
$typeData = $_POST['type'];
if (!$Database->isExistTime($ID, $LINE, $timeData, $typeData)) {
    $Database->registerTime($ID, $LINE, $timeData, $typeData);
}
header("Location: timetable.php?stopid={$ID}&lineid={$LINE}", true, 303);