summaryrefslogtreecommitdiff
path: root/menu
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-01-22 09:54:08 +0100
committerMinteck <contact@minteck.org>2023-01-22 09:54:08 +0100
commit0fb31ef23c57749eec78cb3eb38d825e2ca037b5 (patch)
tree6313809292072645edcf5bf76c067a3b623e7507 /menu
downloadnots-0fb31ef23c57749eec78cb3eb38d825e2ca037b5.tar.gz
nots-0fb31ef23c57749eec78cb3eb38d825e2ca037b5.tar.bz2
nots-0fb31ef23c57749eec78cb3eb38d825e2ca037b5.zip
Initial commit
Diffstat (limited to 'menu')
-rwxr-xr-xmenu/index.php81
1 files changed, 81 insertions, 0 deletions
diff --git a/menu/index.php b/menu/index.php
new file mode 100755
index 0000000..1ac010f
--- /dev/null
+++ b/menu/index.php
@@ -0,0 +1,81 @@
+<?php
+
+$title = "Menu";
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/header.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
+
+$menu = data_menu()["data"]["menu"];
+
+?>
+
+<div class="container">
+ <br><h2><?= $title ?></h2>
+
+ <?php foreach ($menu as $item): if ($item["date"] / 1000 < time()): ?>
+ <details>
+ <summary><?php
+
+ $fmt = new \IntlDateFormatter('fr_FR');
+ $fmt->setPattern('d MMM yyyy');
+ echo $fmt->format(new \DateTime(date("c", ($item["date"] + 7200000) / 1000)));
+
+ ?></summary>
+ <table style="margin-top: 10px; margin-bottom: 20px;">
+ <tr>
+ <td></td>
+ <td style="width:10px;"></td>
+ <td style="width:5px;background-color:#C0C0C0;"></td>
+ <td style="width:10px;"></td>
+ <td>
+ <?php foreach ($item["meals"] as $index => $meal): ?>
+ <?php foreach ($meal as $mealItem): ?>
+ <p>
+ <?php foreach ($mealItem as $subitem): ?>
+ <?= $subitem["name"] ?><br>
+ <?php endforeach; ?>
+ </p>
+ <?php endforeach; ?>
+ <?= $index + 1 < count($item["meals"]) ? "<hr>" : "" ?>
+ <?php endforeach; ?>
+ </td>
+ </tr>
+ </table>
+ </details>
+ <?php endif; endforeach; ?>
+ <hr>
+ <?php foreach ($menu as $item): if ($item["date"] / 1000 >= time()): ?>
+ <details>
+ <summary><?php
+
+ $fmt = new \IntlDateFormatter('fr_FR');
+ $fmt->setPattern('d MMM yyyy');
+ echo $fmt->format(new \DateTime(date("c", ($item["date"] + 7200000) / 1000)));
+
+ ?></summary>
+ <table style="margin-top: 10px; margin-bottom: 20px;">
+ <tr>
+ <td></td>
+ <td style="width:10px;"></td>
+ <td style="width:5px;background-color:#C0C0C0;"></td>
+ <td style="width:10px;"></td>
+ <td>
+ <?php foreach ($item["meals"] as $index => $meal): ?>
+ <?php foreach ($meal as $mealItem): ?>
+ <p>
+ <?php foreach ($mealItem as $subitem): ?>
+ <?= $subitem["name"] ?><br>
+ <?php endforeach; ?>
+ </p>
+ <?php endforeach; ?>
+ <?= $index + 1 < count($item["meals"]) ? "<hr>" : "" ?>
+ <?php endforeach; ?>
+ </td>
+ </tr>
+ </table>
+ </details>
+ <?php endif; endforeach; ?>
+</div>
+
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/footer.php"; ?>