-
Notifications
You must be signed in to change notification settings - Fork 0
/
dish.php
30 lines (25 loc) · 874 Bytes
/
dish.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
<?php
declare(strict_types = 1);
require_once('../Classes/session.class.php');
$session = new Session();
require_once('../Database/connection.db.php');
require_once('../Classes/restaurant.class.php');
require_once('../Classes/menu.class.php');
require_once('../Classes/dish.class.php');
require_once('../Classes/order.class.php');
require_once('../Templates/common.tpl.php');
require_once('../Templates/dish.tpl.php');
require_once('../Classes/user.class.php');
$db = getDatabaseConnection('sqlite:../Database/database.db');
$dish = Dish::getDish($db, intval($_GET['id']));
$menu = Menu::getMenu($db, $dish->menu);
$restaurant = Restaurant::getRestaurant($db, $menu->restaurant);
if(!isset($_SESSION['id'])){
header('Location: info.php');
}
else{
drawHeader($session);
drawDish($session,$restaurant->id, $restaurant->name, $dish);
drawFooter();
}
?>