-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.php
More file actions
301 lines (234 loc) · 11.6 KB
/
Copy pathtesting.php
File metadata and controls
301 lines (234 loc) · 11.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="nikhil.css">
<link rel="stylesheet" href="Ratnakar.css">
<link rel="stylesheet" href="dishant.css">
<link rel="stylesheet" href="loader.css">
<link rel="stylesheet" href="ratan.css">
<title>
पाहुणचार</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="icon" type="img" href="img/logo1.jpeg">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
<style>
.log {
max-width: 100%;
aspect-ratio: 3/3;
object-fit: contain;
}
.d:hover {
transform: scale(0.9);
box-shadow: 5px 5px 10px orange;
transition: all 0.4s ease-in-out;
}
</style>
<body>
<?php
include "inc/header.php";
?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<div class="container-fluid mt-5" style="margin-top: 200px;">
<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12">
<div id="carouselExampleCaptions" class="carousel slide">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0"
class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1"
aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2"
aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/burger.jpg" class="d-block w-100" alt="..." id="carousel1">
<div class="carousel-caption d-none d-md-block">
<h1 id="head">Burger</h1>
<p id="head1">Burgers, juicy and packed with flavorful ingredients, satisfy cravings for
a classic American meal.</p>
</div>
</div>
<div class="carousel-item">
<img src="images/cake.jpeg" class="d-block w-100" alt="..." id="carousel1">
<div class="carousel-caption d-none d-md-block">
<h1 id="head">Cake</h1>
<p id="head1">Cake, a sweet indulgence with layers of moist sponge and creamy frosting,
delights dessert lovers.</p>
</div>
</div>
<div class="carousel-item">
<img src="images/pizza.jpg" class="d-block w-100" alt="..." id="carousel1">
<div class="carousel-caption d-none d-md-block">
<h1 id="head">Pizza</h1>
<p id="head1">Pizza, with its gooey cheese and savory toppings, tantalizes taste buds
with every bite.</p>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</div>
</div>
</div>
<br><br><br>
<!-- Nikhil Page strat here -->
<div class="container">
<h2>Featured Categories</h2>
<div class="container mt-2">
<div class="row">
<?php
include "db.php"; // Include the file containing database connection
// Assuming $conn is your database connection
$sql = "SELECT * FROM `category`WHERE status = 1 ORDER BY id DESC";
$result = $conn->query($sql);
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
// Start of card div
echo '<div class="col-xl-3 mt-3 log2 ms-2 d" style="width: 15.5rem;">';
echo '<div class="card border-0 rounded shadow">';
echo '<a href="All_pizzas.php" class="text-decoration-none text-dark">';
echo '<div class="card-body mb-2">';
echo '<img src="upload/' . $row['user_image'] . '" class="card-img-top log1">';
echo '<h5 class="fw-bold text-center mb-0">' . $row['title'] . '</h5>';
// echo '<p class="text-center mt-0">15</p>';
echo '</div>'; // End of card-body
echo '</a>';
echo '</div>'; // End of card
echo '</div>'; // End of col
}
} else {
echo "zero result";
}
?>
</div> <!-- End of row -->
</div> <!-- End of container -->
</div> <!-- End of container -->
<!-- Ratnakar Page strat here -->
<div class="container mt-5">
<h2 class="mb-5">Popular Products</h2>
<div class="row">
<?php
// Check if the connection is successful
if ($conn) {
// Query to fetch products
$data = "SELECT * FROM add_product WHERE status = 1 ORDER BY id DESC";
$data_show = mysqli_query($conn, $data);
// Check if the query was successful
if ($data_show) {
// Loop through each product
while ($show = mysqli_fetch_array($data_show)) {
?>
<div class="col-xl-3 col-lg-3 col-md-3 col-sm-12 mt-3 d">
<div class="card border-0 rounded shadow">
<a href="page.php?id=<?php echo $show['id']; ?>" class="text-decoration-none text-dark">
<img src="upload/<?php echo $show['thumb1']; ?>" class="card-img-top log"
alt="<?php echo $show['ptitle']; ?> image">
<div class="card-body" id="product<?php echo $show['id']; ?>">
<h5 class="card-title"><?php echo $show['ptitle']; ?></h5>
<h5>₹<?php echo $show['price']; ?> </h5>
</a>
<div class="quantity">
<button onclick="decrement('quantity_product<?php echo $show['id']; ?>')">-</button>
<input type="text" id="quantity_product<?php echo $show['id']; ?>" name="quantity_product<?php echo $show['id']; ?>" value="1">
<button onclick="increment('quantity_product<?php echo $show['id']; ?>')">+</button>
</div>
<div class="add-to-cart-btn">
<form action="add_to_cart.php" method="post">
<input type="hidden" name="product_id" value="<?php echo $show['id']; ?>">
<!-- Update the value of the hidden input field to reflect the selected quantity -->
<input type="hidden" name="quantity" value="1" id="quantity_hidden_product<?php echo $show['id']; ?>">
<button type="submit" class="btn-style" onclick="updateQuantity(<?php echo $show['id']; ?>)">Add to Cart</button>
</form>
</div>
</div>
</div>
</div>
<?php
}
} else {
echo "Error executing query: " . mysqli_error($conn);
}
// Close the database connection
mysqli_close($conn);
} else {
echo "Error connecting to the database: " . mysqli_connect_error();
}
?>
</div>
</div>
<section class="home" id="Home">
<div class="content">
<h3>Fresh And <span>100% Pure</span> Produts For You</h3>
<p>This Website Is Totally Designed By पाहुणचार So That Everyone Can Easily Orderd Their Products And Use
100% Pure Foods In Their Own Day To Day Life</p>
<a href="#" class="btn">Order Now</a>
</div>
</section>
<?php
include "inc/footer.php";
?>
<script>
jQuery(function ($) {
var path = window.location.href;
// because the 'href' property of the DOM element is the absolute path
$('ul a').each(function () {
if (this.href === path) {
$(this).addClass('active');
}
});
I
});
</script>
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<script src="script.js"></script>
<script src="nikhil.js"></script>
<script src="ratnakar.js"></script>
<script src="loader.js"></script>
<div class="loader">
<img src="/PahuncharHMP2/loader.gif" alt="">
</div>
<script>
function updateQuantity(productId) {
var selectedQuantity = document.getElementById('quantity_product' + productId).value;
document.getElementById('quantity_hidden_product' + productId).value = selectedQuantity;
}
</script>
<script>
function increment(id) {
var input = document.getElementById(id);
var value = parseInt(input.value, 10);
value = isNaN(value) ? 0 : value;
value++;
input.value = value;
}
function decrement(id) {
var input = document.getElementById(id);
var value = parseInt(input.value, 10);
value = isNaN(value) ? 0 : value;
if (value > 1) {
value--;
input.value = value;
}
}
</script>
</body>
</html>