-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstore.php
More file actions
336 lines (282 loc) · 15.1 KB
/
store.php
File metadata and controls
336 lines (282 loc) · 15.1 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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include('./template/_dbconnect.php');
$query = STORE_NAME;
$query = str_replace("-", "'", $query);
$query = str_replace("_", "&", $query);
// echo $query;
$sql2 = "SELECT * FROM store where store_name = \"$query\"";
$result2 = mysqli_query($conn, $sql2);
$row2 = mysqli_fetch_assoc($result2);
$store_name = $row2['store_name'];
$store_description = $row2['store_description'];
$store_img = $row2['store_img'];
$store_meta = $row2['store_meta'];
echo '
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="Description" content="' . $store_description . '" />
<meta name="keywords" content="' . $store_meta . '" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" integrity="sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css" integrity="sha512-sMXtMNL1zRzolHYKEujM2AqCLUR9F2C4/05cdbxjjLSRvMQIciEPCQZo++nk7go3BtSuK9kfa/s+a4f4i5pLkw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://kit.fontawesome.com/595d13cf2d.js" crossorigin="anonymous"></script>
<script data-ad-client="ca-pub-4254949403223799" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<link rel="icon" href="../assets/images/favicon.png" type="image/gif" sizes="32x32">
<link rel="stylesheet" href="assets/css/simplePagination.css" />
<link rel="stylesheet" href="../assets/css/style.css" />
<title> ' . $store_name . ' | AdsAdora | Weekly Ads, Sales and Ads Preview </title>
<style>
/* Modal Style */
.form-title {
margin: -2rem 0rem 2rem;
}
.subscribe-form {
margin: 0rem 0rem 1rem;
}
/* Modal Style Ends */
</style>
';
?>
</head>
<body>
<!-- Header Section -->
<header id="header">
<!-- Navigation Bar -->
<nav class="navbar navbar-expand-lg navbar-dark color-second-bg">
<a href="https://adsadora.com/"><img src="../assets/images/logon.png" style="width: 190px; height: 50px; object-fit:cover; margin-top: -7px;" class="img-fluid" alt="" width="100px"></a>
<!-- <a class="navbar-brand font-rale" href="https://adsadora.com/">AdsAdora</a> -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav m-auto font-rubik">
<li class="nav-item">
<a class="nav-link" href="https://adsadora.com/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../category">Categories</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../stores">Stores</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../weekly-ads">Weekly Ads</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../blog/">Blogs</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" action="search.php" method="GET">
<input class="form-control mr-sm-2" type="search" placeholder="Search for Stores" name="query" aria-label="Search" required>
<button class="btn btn-outline-dark search-store my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<!-- Navigation Bar Ends -->
</header>
<!-- Header Section Ends -->
<!-- Main Section -->
<main id="main-site">
<div class="container my-3" style="min-height: 100vh;">
<?php
include('./template/_store-flyers.php');
?>
<?php
include('./template/_dbconnect.php');
$query = STORE_NAME;
$query = str_replace("-", "'", $query);
$query = str_replace("_", "&", $query);
$sql2 = "SELECT * FROM store where store_name = \"$query\"";
$result2 = mysqli_query($conn, $sql2);
while ($row2 = mysqli_fetch_assoc($result2)) {
$store_name = $row2['store_name'];
$store_description = $row2['store_description'];
$store_img = $row2['store_img'];
$store_meta = $row2['store_meta'];
echo '
<div class="result my-2 p-2">
<h3 style="color:#dc3545;">About ' . $store_name . '</h3>
<div class="d-flex d-flex-row justify-content-between">
<p class="my-4 text-justify">' . $store_description . '</p>
<img src="../admin/image/' . $store_img . '" alt="' . $store_img . '" class="d-flex ml-3 p-2 mt-3" width="150" height="150">
</div>
<hr>
</div>
';
}
?>
</div>
</main>
<!-- Main Section Ends -->
<!-- Footer Section -->
<footer id="footer">
<div class="section">
<div class="container">
<div class="row">
<div class="col-md-3 col-xs-6">
<div class="footer">
<h3 class="footer-title">Subscribe to Offers</h3>
<p>Receive the latest offers by e-mail and don´t miss out on any special offer</p>
<button type="button" class="btn btn-user" data-toggle="modal" style="background-color: #dc3545; color:#fff;" data-target="#exampleModal"><i class="fa fa-envelope mr-2"></i>Subscribe</button>
<!-- <a href="#" class="btn btn-success">Subscribe</a> -->
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="footer">
<h3 class="footer-title">Pages</h3>
<ul class="footer-links">
<li><a href="../about">About Us</a></li>
<li><a href="../contact">Contact Us</a></li>
<li><a href="../privacy">Privacy Policy</a></li>
<li><a href="../terms">Terms</a></li>
<li><a href="../sitemap.xml">Sitemap</a></li>
</ul>
</div>
</div>
<div class="clearfix visible-xs"></div>
<div class="col-md-3 col-xs-6">
<div class="footer">
<h3 class="footer-title">Top Categories</h3>
<ul class="footer-links">
<?php
include('./template/_dbconnect.php');
$sql = "SELECT * FROM `category` ORDER BY RAND() LIMIT 5";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$cat_name = $row['category_name'];
echo '<li><a href="' . $cat_name . '">' . $cat_name . '</a></li>';
}
?>
</ul>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="footer">
<h3 class="footer-title">Top Stores</h3>
<ul class="footer-links">
<?php
include('./template/_dbconnect.php');
$sql = "SELECT * FROM `store` LIMIT 5";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$store_name = $row['store_name'];
echo '<li><a href="' . $store_name . '">' . $store_name . '</a></li>';
}
?>
</ul>
</div>
</div>
<div class="col-md-3 col-xs-6">
<div class="footer">
</div>
</div>
</div>
</div>
</div>
<div class="footer-bottom">
<div class="container">
<p>Copyright © 2021 <a href="../index">AdsAdora.com</a>. All rights reserved. Copying the texts without the written
consent of the site operator is prohibited. </p>
</div>
</div>
</footer>
<!-- Footer Section Ends -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header border-bottom-0">
<!-- <h5 class="modal-title" id="exampleModalLabel" style="text-align: center; justify-content:center;">Modal title</h5> -->
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-title text-center">
<h4>Stay up to date!</h4>
<p>Get special offers directly in your inbox!</p>
</div>
<div class="d-flex justify-content-center">
<form class="form-inline subscribe-form" action="" method="POST">
<div class="form-group">
<label class="sr-only" for="email4">Email</label>
<input type="text" class="form-control mr-2" id="email4" name="email" placeholder="Enter your E-mail">
</div>
<button type="submit" class="btn" name="subscribe" style="background-color: #dc3545; color:#fff;">Subscribe</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php
if (isset($_POST['subscribe'])) {
//check email blank
if (empty($_POST['email'])) {
echo '<script>alert("<span class="text-danger">An email is required</span> </br>")</script>';
//echo "<span class='text-danger'>An email is required</span> </br>";
}
//validate email
elseif (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {
echo '<script>alert("<span class="text-danger">Invalid Email Format </span> </br>")</script>';
// echo "<span class='text-danger'> Invalid Email Format </br> ";
}
//submit email
else {
$email = htmlspecialchars($_REQUEST['email']);
include('./template/_dbconnect.php');
$sql = "INSERT INTO newsletter(email) VALUES ('$email')";
if (mysqli_query($conn, $sql)) {
echo '<script>alert("Thanks for Subscribing!")</script>';
} else {
echo '<script>alert("Error Occured! Network Failure")</script>';
}
}
}
?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js" integrity="sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/elevatezoom/2.2.3/jquery.elevatezoom.min.js" integrity="sha512-UH428GPLVbCa8xDVooDWXytY8WASfzVv3kxCvTAFkxD2vPjouf1I3+RJ2QcSckESsb7sI+gv3yhsgw9ZhM7sDw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twbs-pagination/1.4.2/jquery.twbsPagination.min.js" integrity="sha512-frFP3ZxLshB4CErXkPVEXnd5ingvYYtYhE5qllGdZmcOlRKNEPbufyupfdSTNmoF5ICaQNO6SenXzOZvoGkiIA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/simplePagination.js/1.4/jquery.simplePagination.min.js" integrity="sha512-J4OD+6Nca5l8HwpKlxiZZ5iF79e9sgRGSf0GxLsL1W55HHdg48AEiKCXqvQCNtA1NOMOVrw15DXnVuPpBm2mPg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Custom Javascript -->
<script src="./index.js"></script>
<script>
var record = '<?php echo $record; ?>';
var listOfViews = <?php echo json_encode($listOfView); ?>;
// $('#pagination-demo').twbsPagination({
// totalPages: record,
// visiblePages: 5,
// next: 'Next',
// prev: 'Prev',
// onPageClick: function(event, page) {
// document.getElementById('page-content').innerHTML = listOfViews[page - 1];
// }
// });
$('#pagination-demo').pagination({
items: record,
itemOnPage: 5,
currentPage: 0,
displayedPages: 5,
edges: 1,
cssStyle: 'light-theme',
prevText: '<span aria-hidden="true">«</span>',
nextText: '<span aria-hidden="true">»</span>',
onInit: function() {
document.getElementById('page-content').innerHTML = listOfViews[0];
},
onPageClick: function(event, page) {
document.getElementById('page-content').innerHTML = listOfViews[event - 1];
}
});
</script>
</body>
</html>