gymrooster_php/html/index.php

22 lines
598 B
PHP
Raw Normal View History

2020-03-05 23:06:59 +01:00
<?php
include __DIR__ . '/../php/auth.php';
2020-03-05 23:06:59 +01:00
ob_start();
$url = $_SERVER['REQUEST_URI'];
if ($url === '/') {
2020-03-05 23:06:59 +01:00
include __DIR__ . '/../templates/index.html.php';
} elseif ($url === '/login' && $_SERVER['REQUEST_METHOD'] === "GET") {
include __DIR__ . '/../templates/login.html.php';
} elseif ($url === '/login' && $_SERVER['REQUEST_METHOD'] === "POST") {
include __DIR__ . '/../php/login.php';
} elseif ($url === '/dashboard' && isAuthorized()) {
include __DIR__ . '/../templates/dashboard.html.php';
}
2020-03-05 23:06:59 +01:00
$output = ob_get_clean();
2020-03-05 23:06:59 +01:00
include __DIR__ . '/../templates/layout.html.php';