-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewMessages.php
More file actions
70 lines (54 loc) · 2.01 KB
/
viewMessages.php
File metadata and controls
70 lines (54 loc) · 2.01 KB
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
60
61
62
63
64
65
66
67
68
69
70
<?php
session_name("name");
session_start();
if ($_SESSION['userType'] != 3)
header("Location: main.php");
require 'layout.php';
include 'model.php';
?>
<link rel="stylesheet" type="text/css" href="css/viewMessages.css">
<div class="left-sidebar" id="left-sidebar">
<a href="#" id="close-sidebar" class="fas fa-arrow-left"></a>
<a href="picnics.php" class="fas fa-thumbtack"> Latest Picnics</a>
<a href="news.php" class="fas fa-newspaper"> News</a>
<?php if (isset($_SESSION['userType']) && $_SESSION['userType'] == 2) { ?>
<a href="#" class="fas fa-shopping-cart" id="openCart"> Cart <span id="openCart-span" class="fas fa-sort-down" style="float: right"></span></a>
<div class="purchase" id="purchase">
<?php $customer = getCustomerIdByEmail($_SESSION['email']);
$cid = 0;
if ($i = $customer->fetch())
$cid = $i['cid'];
$order = getPurchase($cid);
?>
<ul><?php
while ($i = $order->fetch()) {
echo "<li>" . $i['pid'] . " | " . $i['title'] . "</li>";
echo "<small>" . $i['invoice'] . " <strong class='fas fa-shekel-sign'></strong></small>";
echo "<hr>";
}
?> </ul><?php
?>
</div>
<?php } ?>
</div>
<script type="text/javascript">
var role = <?=$_SESSION['userType']?>;
if (role ==2) {
document.getElementById('openCart').addEventListener('click', function (event) {
event.preventDefault();
openAndCloseCart();
});
}
</script>
<script type="text/javascript">
document.getElementById('close-sidebar').addEventListener('click', function (event) {
event.preventDefault();
closeSlidMenu();
});
</script>
<?php
printMessages();
?>
<?php
require 'footer.php';
?>