This repository has been archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
49 lines (41 loc) · 1.54 KB
/
index.php
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
45
46
47
48
49
<?php
declare(strict_types=1);
require_once("./templates/common.php");
require_once("./templates/list.php");
require_once("./templates/metadata.php");
require_once("./database/models/restaurant.php");
require_once("./lib/session.php");
$session = new Session();
session_start();
if ($session->isAuthenticated()) {
$user = User::getById($session->get('user'));
$favorite_restaurants = $user->getFavoriteRestaurants();
$favorite_dishes = $user->getFavoriteDishes();
}
$recommended_restaurants = Restaurant::getAll();
$recommended_dishes = DIsh::getAll();
?>
<!DOCTYPE html>
<html lang="en">
<?php createHead(
metadata: baseMetadata(description: "Home page for XauFome."),
scripts: [
"components/form.js",
"components/card.js",
"components/dialog.js",
"components/slider.js",
"components/snackbar.js"
]
); ?>
<body class="top-app-bar layout">
<?php createAppBar(); ?>
<main class="large medium-spacing column layout">
<?php
createRestaurantList($favorite_restaurants, 2, title: 'Your favorite restaurants');
createDishList($favorite_dishes, 2, title: 'Your favorite dishes', show_restaurant: true);
createRestaurantList($recommended_restaurants, 2, title: 'Recommended restaurants');
createDishList($recommended_dishes, 2, title: 'Recommended dishes', show_restaurant: true);
?>
</main>
</body>
</html>