-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
297 lines (286 loc) · 10.8 KB
/
index.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<?php
require_once 'config/config.php';
if (isset($_SESSION["user"])) {
$id = $_SESSION["user"];
$result = query("SELECT * FROM users WHERE id_user = $id")[0];
if ($result['roles'] == 'ADMIN') {
header("Location: admin");
} elseif($result["roles"] == 'OWNER') {
header("Location: owner");
}
}
if (isset($_SESSION["driver"])) {
header("Location: driver");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="description" content="" />
<meta name="author" content="" />
<title>Toko Galon Online</title>
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet" />
<link href="assets/style/main.css" rel="stylesheet" />
<style>
.store-adventeges {
padding: 40px;
background-color: #F7F7E8;
}
</style>
</head>
<body>
<!-- navbar -->
<nav
class="navbar navbar-expand-lg navbar-light navbar-store fixed-top navbar-fixed-top"
data-aos="fade-down"
>
<div class="container">
<a href="index.php" class="navbar-brand">
<img src="assets/images/logo.jpg" class="w-50" alt="logo" />
</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarResponsive"
aria-controls="navbarResponsive"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a href="index.php" class="nav-link">Home</a>
</li>
<li class="nav-item">
<a href="products.php" class="nav-link">Pesan</a>
</li>
<li class="nav-item">
<a href="about.php" class="nav-link">Tentang</a>
</li>
<?php
if (!isset($_SESSION["login"]) && !isset($_SESSION["user"])) : ?>
<li class="nav-item">
<a href="register.php" class="nav-link">Sign Up</a>
</li>
<li class="nav-item">
<a
href="login.php"
class="btn btn-success nav-link px-4 text-white"
>Sign In</a
>
</li>
<?php else: ?>
<li class="nav-item dropdown">
<?php
$id = $_SESSION["user"];
$user = query("SELECT * FROM users WHERE id_user = $id")[0];
?>
<a
href="#"
class="nav-link font-weight-bold"
id="navbarDropdown"
role="button"
data-toggle="dropdown"
>
<!-- <img
src="../assets/images/user_pc.png"
alt="profile"
class="rounded-circle mr-2 profile-picture"
/> -->
Hi, <?= $user["name"]; ?>
</a>
<div class="dropdown-menu">
<?php if ($user["roles"] == 'ADMIN') : ?>
<a href="admin" class="dropdown-item">
Dashboard
</a>
<?php else : ?>
<a href="user" class="dropdown-item">
Dashboard
</a>
<?php endif; ?>
<div class="dropdown-divider"></div>
<a href="logout.php" class="dropdown-item">logout</a>
</div>
</li>
<li class="nav-item">
<?php
$id = $user["id_user"];
$carts = rows("SELECT * FROM carts WHERE user_id = $id");
?>
<?php if ($carts >= 1) : ?>
<a href="cart.php" class="nav-link d-inline-block">
<img
src="assets/images/shopping-cart-filled.svg"
alt="cart-empty"
/>
<div class="cart-badge"><?= $carts; ?></div>
</a>
<?php else : ?>
<a href="cart.php" class="nav-link d-inline-block">
<img
src="assets/images/icon-cart-empty.svg"
alt="cart-empty"
/>
</a>
<?php endif; ?>
</li>
<?php endif;?>
</ul>
</div>
</div>
</nav>
<!-- akhir navbar -->
<!-- page content -->
<div class="page-content page-home" data-aos="zoom-in">
<section class="store-landing">
<div class="container">
<div class="row align-items-center justify-content-between">
<div class="col-md-5">
<img src="assets/images/bg-landing-removebg-preview.png" class="w-100" alt="" />
</div>
<div class="col-md-6">
<h1 style="font-weight: bold; margin-bottom: 15px;">AQUAZA</h1>
<p class="store-subtitle-landing" style="line-height: 28px; color: rgb(146, 146, 146);">
AQUAZA merupakan platform website yang melayani pesan-antar galon berbasis online di lingkungan sekitar Kampus 2 Universitas Siliwangi Tasikmalaya guna memudahkan warga sekitar untuk membeli galon tanpa keluar rumah ;)
</p>
<a href="products.php" class="btn btn-success px-4 py-2 mt-4"
><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-cart-fill" viewBox="0 0 20 20">
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .491.592l-1.5 8A.5.5 0 0 1 13 12H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg> Order Now</a
>
</div>
</div>
</div>
</section>
<section class="store-adventeges" style="margin-top: 100px;" id="adventeges">
<div class="container">
<div class="row">
<div class="col-12">
<div class="title-adventeges" style="text-align: center; font-size: 24px; font-weight: 600; margin-bottom: 20px;">Kelebihan Menggunakan Website Ini</div>
</div>
</div>
<div class="row">
<div
class="col-6 col-md-4"
data-aos="fade-down"
data-aos-delay="100"
>
<div class="card mb-4">
<div class="card-body">
<div class="row justify-content-center align-content-center">
<div class="col-10 col-md-4">
<div class="adventeges-thumbnail mb-lg-0 mb-2">
<img
src="assets/images/fast.svg"
class="w-100"
alt=""
/>
</div>
</div>
<div class="col-md-8">
<div
class="adventege-description text-center text-lg-left"
>
<div class="title-text">Faster Process</div>
<div class="subtitle-text">
Proses lebih cepat karena menggunakan sistem komputer
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="col-6 col-md-4"
data-aos="fade-down"
data-aos-delay="200"
>
<div class="card mb-4">
<div class="card-body">
<div class="row justify-content-center align-content-center">
<div class="col-10 col-md-4">
<div class="adventeges-thumbnail mb-lg-0 mb-2">
<img
src="assets/images/money.svg"
class="w-100"
alt=""
/>
</div>
</div>
<div class="col-md-8">
<div
class="adventege-description text-center text-lg-left"
>
<div class="title-text">Energy Saving</div>
<div class="subtitle-text">
Menghemat energi karena tidak perlu beranjak dari tempat
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="col-6 col-md-4"
data-aos="fade-down"
data-aos-delay="300"
>
<div class="card mb-4">
<div class="card-body">
<div class="row justify-content-center align-content-center">
<div class="col-10 col-md-4">
<div class="adventeges-thumbnail mb-lg-0 mb-2">
<img src="assets/images/env.svg" class="w-100" alt="" />
</div>
</div>
<div class="col-md-8">
<div
class="adventege-description text-center text-lg-left"
>
<div class="title-text">Time Efficiency</div>
<div class="subtitle-text">
Waktu lebih efisien karena bisa memesan dimana saja
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- akhir slider -->
<!-- footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-12">
<p class="pt-4 pb-2">
© 2023 Copyright by AQUAZA. All Rights Reserved.
</p>
</div>
</div>
</div>
</footer>
<!-- akhir footer -->
<!-- Bootstrap core JavaScript -->
<script src="assets/vendor/jquery/jquery.slim.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>
<script>
AOS.init();
</script>
<script src="assets/js/navbar-scroll.js"></script>
</body>
</html>