-
Notifications
You must be signed in to change notification settings - Fork 1
/
history.php
52 lines (47 loc) · 867 Bytes
/
history.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
50
51
52
<?php
$TITLE="Home";
require_once "header.php";
?>
<?php
//Print out
$mostVisited = $_COOKIE["mostVisited"];
$lastFive = $_COOKIE["lastFive"];
arsort($mostVisited);
asort($lastFive);
echo "
<table class=\"table\">
<tr>
<th> The most visited products: </th>
<th> The last five visited products: </th>
</tr>
<tr>
";
if(isset($mostVisited)) {
echo "
<td>
<ul>";
foreach ($mostVisited as $key => $value) {
echo "
<li> $key </li>";
}
echo "
</ul>
</td>";
}
if(isset($lastFive)) {
echo "
<td>
<ul>";
foreach ($lastFive as $key => $value) {
echo "
<li> $key </li>";
}
echo "
</ul>
</td>";
}
echo "
</tr>
</table>";
?>
<?php require_once "footer.php"; ?>