gymrooster_php/html/index.php

23 lines
644 B
PHP
Executable File

<?php
include __DIR__ . '/../php/auth.php';
ob_start();
$url = $_SERVER['REQUEST_URI'];
$url = preg_replace('/\?.+\=.+/m', '', $url);
if ($url === '/') {
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';
}
$output = ob_get_clean();
include __DIR__ . '/../templates/layout.html.php';