summaryrefslogtreecommitdiff
path: root/public/index.php
blob: 7e4415964808f5532c9793c3dcf7df6b679414d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

require_once __DIR__ . '/../app.php';

$url = strtok($_SERVER["REQUEST_URI"], '?');

switch( $url ) {

case("/"):
	echo $twig->render('index.html');
	break;
case("/about"):
	echo $twig->render('about.html');
	break;
case("/projects"):
	echo $twig->render('projects.html');
	break;
case("/tools"):
	echo $twig->render('tools.html');
	break;
case("/tools/faces"):
case("/tools/faces/"):
	echo $twig->render('tools/faces/index.html', [ "faces" => get_faces() ]);
	break;
case("/tools/pizza"):
case("/tools/pizza/"):
	echo $twig->render('tools/pizza/index.html');
	break;
case("/tools/untrack"):
case("/tools/untrack/"):
	$_url = "";
	if ( isset($_REQUEST['url']) ) {
		$_url = htmlspecialchars($_REQUEST['url']);
	} 
	echo $twig->render('tools/untrack/index.html', [ "url" => $_url ]);
	break;
case("/tools/zeitumstellung"):
case("/tools/zeitumstellung/"):
	echo $twig->render('tools/zeitumstellung/index.html', [ "tc" => new Zeitumstellung() ]);
	break;
default:
	http_response_code(404);
	echo $twig->render('404.html');
}