-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.php.txt
59 lines (55 loc) · 2.23 KB
/
show.php.txt
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
50
51
52
53
54
55
56
57
58
59
<?php
require_once('menu.php');
require_once('data.php');
$menuName = $_GET['name'];
$menu = Menu::findByName($menus, $menuName);
$menuReviews = $menu->getReviews($reviews);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Progate</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href='https://fonts.googleapis.com/css?family=Pacifico|Lato' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="review-wrapper">
<div class="review-menu-item">
<img src="<?php echo $menu->getImage() ?>" class="menu-item-image">
<h3 class="menu-item-name"><?php echo $menu->getName() ?></h3>
<?php if ($menu instanceof Drink): ?>
<p class="menu-item-type"><?php echo $menu->getType() ?></p>
<?php else: ?>
<?php for ($i = 0; $i < $menu->getSpiciness(); $i++): ?>
<img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/php/chilli.png" class='icon-spiciness'>
<?php endfor ?>
<?php endif ?>
<p class="price">$<?php echo $menu->getTaxIncludedPrice() ?></p>
</div>
<div class="review-list-wrapper">
<div class="review-list">
<div class="review-list-title">
<img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/php/review.png" class='icon-review'>
<h4>Reviews</h4>
</div>
<?php foreach ($menuReviews as $review): ?>
<?php $user = $review->getUser($users) ?>
<div class="review-list-item">
<div class="review-user">
<?php if ($user->getGender() == 'male'): ?>
<img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/php/male.png" class='icon-user'>
<?php else: ?>
<img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/php/female.png" class='icon-user'>
<?php endif ?>
<p><?php echo $user->getName() ?></p>
</div>
<p class="review-text"><?php echo $review->getBody() ?></p>
</div>
<?php endforeach ?>
</div>
</div>
<a href="index.php">← Back to Menu</a>
</div>
</body>
</html>