Ejemplo n.º 1
0
        }
    } else {
        AnonymousController::registration();
    }
}, "customer/rating" => function () {
    CustomerController::addRating();
    //        echo json_encode($_POST["ocena"]);
}, "customer/registration/mailsent" => function () {
    echo ViewHelper::render("view/customer-message.php", ["message" => "Hvala za registracijo! Potrditveni mail je bil poslan na mail."]);
}, "customer/registration/mailfailed" => function () {
    echo ViewHelper::render("view/customer-message.php", ["message" => "Zgodila se je napaka! Potrditveni mail ni bil poslan."]);
}, "customer/login" => function () {
    if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") {
        ViewHelper::redirect(BASE_URL . "customer");
    } elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
        CustomerController::check();
    } else {
        CustomerController::login();
    }
}, "customer/logout" => function () {
    session_unset();
    ViewHelper::redirect(BASE_URL);
}, "product/detail" => function () {
    if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") {
        ViewHelper::redirect(BASE_URL . "customer");
    } else {
        AnonymousController::productsDetail();
    }
}, "orders" => function () {
    if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") {
        CustomerController::orders();