-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwatchlist.php
More file actions
168 lines (138 loc) · 8.5 KB
/
watchlist.php
File metadata and controls
168 lines (138 loc) · 8.5 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
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
<?php
session_start();
require "connection.php";
if (isset($_SESSION["u"])) {
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Watchlist | mkshop</title>
<link rel="stylesheet" href="bootstrap.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="resourses/logo.svg" />
</head>
<body>
<div class="container-fluid">
<div class="row">
<?php include "header.php";
?>
<div class="col-12">
<div class="row">
<div class="col-12 border border-1 border-primary rounded mb-2">
<div class="row">
<div class="col-12">
<label class="form-label fs-1 fw-bolder">Watchlist ♥</label>
</div>
<div class="col-12 col-lg-6">
<hr />
</div>
<div class="col-12">
<div class="row">
<div class="offset-lg-2 col-12 col-lg-6 mb-3">
<input type="text" class="form-control" placeholder="Search in Watchlist..." />
</div>
<div class="col-12 col-lg-2 mb-3 d-grid">
<button class="btn btn-primary">Search</button>
</div>
</div>
</div>
<div class="col-12">
<hr />
</div>
<div class="col-11 col-lg-2 border-0 border-end border-1 border-dark" >
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="home.php">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Watchlist</li>
</ol>
</nav>
<nav class="nav nav-pills flex-column">
<a class="nav-link active" aria-current="page" href="#">My Watchlist</a>
<a class="nav-link" href="#">My Cart</a>
<a class="nav-link" href="#">Recents</a>
</nav>
</div>
<?php
$watclist_rs = Database::search("SELECT * FROM `watchlist` WHERE
`users_email`='" . $_SESSION["u"]["email"] . "'");
$watchlist_num = $watclist_rs->num_rows;
if ($watchlist_num == 0) {
?>
<!-- empty view -->
<div class="col-12 col-lg-9">
<div class="row">
<div class="col-12 emptyView"></div>
<div class="col-12 text-center">
<label class="form-label fs-1 fw-bold">You have no items in your Watchlist yet.</label>
</div>
<div class="offset-lg-4 col-12 col-lg-4 d-grid mb-3">
<a href="home.php" class="btn btn-warning fs-3 fw-bold">Start Shopping</a>
</div>
</div>
</div>
<!-- empty view -->
<?php
} else {
for ($x = 0; $x < $watchlist_num; $x++) {
$watchlist_data = $watclist_rs->fetch_assoc();
?>
<!-- have products -->
<div class="col-12 col-lg-9">
<div class="row">
<div class="card mb-3 mx-0 mx-lg-2 col-12">
<div class="row g-0">
<div class="col-md-4">
<img src="resourses/empty.svg" class="img-fluid rounded-start" style="height: 200px;" />
</div>
<div class="col-md-5">
<div class="card-body">
<h5 class="card-title fs-2 fw-bold text-primary">Apple iPhone 14</h5>
<span class="fs-5 fw-bold text-black-50">Colour : blue</span>
|
<span class="fs-5 fw-bold text-black-50">Condition : Used</span>
<br />
<span class="fs-5 fw-bold text-black-50">Price :</span>
<span class="fs-5 fw-bold text-black">Rs. 100000 .00</span>
<br />
<span class="fs-5 fw-bold text-black-50">Quantity :</span>
<span class="fs-5 fw-bold text-black">2 Items available</span>
<br />
<span class="fs-5 fw-bold text-black-50">Seller :</span>
<br />
<span class="fs-5 fw-bold text-black">Lahiru</span>
</div>
</div>
<div class="col-md-3 mt-5">
<div class="card-body d-lg-grid">
<a href="#" class="btn btn-outline-success mb-2">Buy Now</a>
<a href="#" class="btn btn-outline-warning mb-2">Add to Cart</a>
<a href="#" onclick="removeFromWatchlist(<?php echo $watchlist_data['id']; ?>);"
class="btn btn-outline-danger">Remove</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- have products -->
<?php
}
}
?>
</div>
</div>
</div>
</div>
<?php include "footer.php"; ?>
</div>
</div>
<script src="bootstrap.bundle.js"></script>
<script src="script.js"></script>
</body>
</html>
<?php
}
?>