summaryrefslogtreecommitdiff
path: root/public/index.php
diff options
context:
space:
mode:
authorhorus2022-11-26 23:21:50 +0100
committerhorus2022-11-26 23:21:50 +0100
commit8ae270da94654e12c7b23bf93994249058ac9e2f (patch)
tree1b5ee3c29cee2a0740124992f2907ec62b039aee /public/index.php
downloadhochzeit-8ae270da94654e12c7b23bf93994249058ac9e2f.tar.gz
Initial commit
Diffstat (limited to 'public/index.php')
-rw-r--r--public/index.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/public/index.php b/public/index.php
new file mode 100644
index 0000000..2cc0627
--- /dev/null
+++ b/public/index.php
@@ -0,0 +1,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]);
+}