Exemplo n.º 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['sid'];
$LINE = $_GET['lid'];
$stopData = $Database->getStop($ID);
$lineName = $Database->getLineName($LINE, $userName);
if ($lineName == null) {
    die('PERMISSION DENIED');
}
$timeData = $_GET['time'];
$typeData = $_GET['type'];
if ($Database->isExistTime($ID, $LINE, $timeData, $typeData)) {
    $Database->deleteTime($ID, $LINE, $timeData, $typeData);
}
header("Location: timetable.php?stopid={$ID}&lineid={$LINE}", true, 303);
Exemplo n.º 2
0
Arquivo: login.php Projeto: Amfys/BST
<?php

$USER = @$_POST['username'];
$PASS = @$_POST['pass'];
$DO = @$_GET['do'];
$ERROR = "";
$USERHAS = "";
$PASSHAS = "";
$showForm = true;
require_once 'db.php';
$Database = new DbUtil();
if ($Database->getUserName() != null) {
    header('Location: personal/my.php', true, 303);
}
function login()
{
    global $DO, $PASS, $USER, $ERROR, $USERHAS, $PASSHAS, $Database;
    if ($DO != "") {
        if ($USER == "" || $PASS == "") {
            $ERROR = '<div class="alert alert-danger" role="alert">一部または全ての項目が入力されていません</div>';
            if ($USER == "") {
                $USERHAS = "has-error";
            }
            if ($PASS == "") {
                $PASSHAS = "has-error";
            }
        } else {
            if (!$Database->login($USER, $PASS)) {
                $ERROR = '<div class="alert alert-danger" role="alert">ユーザ名またはパスワードが違います</div>';
            } else {
                $showForm = false;