summaryrefslogtreecommitdiff
path: root/public/index.php
blob: 2cc062725857a76a99177d48daa82f75b31d9205 (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
<?php

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

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

switch( $url ) {

case("/"):
	echo $twig->render('index.html');
	break;
case("/submit"):
	$data = renderSubmission($db);
	#echo $twig->render('familie.html', ["data" => $data, "updated" => true]);
	echo $twig->render('danke.html', ["data" => $data, "updated" => true]);
	break;
default:
	$data = getData($db);
	# echo "<pre>";var_dump($data);exit;
	if ( empty( $data ) ) {
		echo $twig->render('404.html');
		break;
	}
	echo $twig->render('familie.html', ["data" => $data]);
}