-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.php
More file actions
84 lines (54 loc) · 1.82 KB
/
project.php
File metadata and controls
84 lines (54 loc) · 1.82 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--Statement of Authorship: This webapp if designed by Ayodeji Eniabire Student ID: 000878946 on October 23, 2022-->
<title>Booze Nation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="a4css.css" type="text/css">
</head>
<body>
<header>
<h1>BOOZE NATION ONLINE STORE</h1>
<h3>Welcome to Booze Nation Online Store </h3>
</header>
</body>
</html>
<?PHP
include_once "function_storage.php";
include_once "database.php";
session_start();
if (isset($_GET['remove_item']) ) {
echo '<script>alert("are you sure")</script>';
foreach ($_SESSION['cart'] as $key =>$value) {
if ($value == $_GET['remove_item']) {
unset($_SESSION['cart'][$key]);
break;
}
}
header('Location: http://localhost/Assignment1/project.php');
}
if (isset($_GET['select_category'])){
createSubCategory($_GET['select_category']);
}
$database = readDataFile('/Users/theyji/Sites/Assignment1/Catlog.json');
?>
<?php
echo('<div class="grid-container">');
echo('<div class="category">');
echo('<h3> Categories</h3>');
echo ("<a href=javascript:cat_select('All');>All Category</a>");
echo ("<a href=javascript:cat_select('Beer');>Beer</a>");
echo ("<a href=javascript:cat_select('Whisky');>Whisky</a>");
echo ("<a href=javascript:cat_select('Wine');>Wine</a>");
echo('</div>');
echo('<div id="itemlist">');
echo('<h3> Product List </h3>');
createCatlog($database);
echo('</div>');
echo('<div id="cart">');
echo('<h3> Shopping Cart</h3>');
makeCart();
echo('</div>');
echo('</div>');
?>