Exemplo n.º 1
0
if (isset($_POST["reprSurname"])) {
    $reprSurname[] = $_POST["reprSurname"];
}
if (isset($_POST["reprName"])) {
    $reprName[] = $_POST["reprName"];
}
if (isset($_POST["reprPatronymic"])) {
    $reprPatronymic[] = $_POST["reprPatronymic"];
}
if (isset($_POST["reprEmail"])) {
    $reprEmail[] = $_POST["reprEmail"];
}
if (isset($_POST["reprTel"])) {
    $reprTel[] = $_POST["reprTel"];
}
$statement = new statement\Statement($title, $regNum, $activity, $additionalActivity, $surname, $name, $patronymic, $email, $tel, $jurAddr, $actAddr, $taxation, $headCount, $note, date("Y-m-d H:i:s", time()));
try {
    $statement->insertStatement($pdo);
} catch (Exception $e) {
    die($e->getMessage());
}
for ($i = 0; $i < count($reprSurname[0]); $i++) {
    $agents[] = new statement\Agent($reprSurname[0][$i], $reprName[0][$i], $reprPatronymic[0][$i], $reprEmail[0][$i], $reprTel[0][$i], $statement->getId());
    try {
        $agents[$i]->insertAgent($pdo);
    } catch (Exception $e) {
        die($e->getMessage());
    }
}
?>
<!doctype html>
Exemplo n.º 2
0
<?php

session_start();
require "../blocks/connect.php";
require "../packages/statement/Statement.php";
require "packages/moderators/Moderator.php";
if (isset($_SESSION["login"])) {
    header("Location: index.php");
}
if (isset($_POST["login"]) && !empty($_POST["login"])) {
    $login = $_POST["login"];
}
if (isset($_POST["password"]) && !empty($_POST["password"])) {
    $password = $_POST["password"];
}
if (isset($login) && isset($password)) {
    $password = statement\Statement::checkData($password);
    $password = strrev(md5($password));
    $moderator = new moderators\Moderator($pdo);
    try {
        $moderator->checkUser(statement\Statement::checkData($login), $password);
        $_SESSION = $moderator->serialize();
        echo "<html><head><meta http-equiv='refresh' content='0; url=index.php'></head></html>";
    } catch (Exception $e) {
        die($e->getMessage());
    }
} else {
    die("<html><head><meta http-equiv='refresh' content='2; url=login.php'></head>Вы не ввели не всю информацию, вернитесь и заполните все поля.</html>");
}