-
Notifications
You must be signed in to change notification settings - Fork 0
/
shop.php
257 lines (155 loc) · 6.23 KB
/
shop.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
<?php
$active='Shop';
include("includes/header.php");
if(isset($_SESSION['customer_email']))
{
$session_email = $_SESSION['customer_email'];
$select_customer = "select * from customer where customer_email='$session_email'";
$run_customer = mysqli_query($con,$select_customer);
$row_customer = mysqli_fetch_array($run_customer);
$customer_id = $row_customer['customer_id'];
}
?>
<div id="content">
<div class="container">
<div class="bc-icons-2">
<nav aria-label="breadcrumb">
<ol class="breadcrumb blue-grey lighten-4">
<li class="breadcrumb-item"><a class="black-text" href="#">Home</a><i
class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
<li class="breadcrumb-item"><a class="black-text" href="#">Shop</a><i
class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
<li class="breadcrumb-item active">Accessories</li>
</ol>
</nav>
</div>
<!-- col-md-3 Finish -->
<div class="col-md-9"><!-- col-md-9 Begin -->
<?php
if(!isset($_GET['p_cat'])){
if(!isset($_GET['cat'])){
echo "
<div class='box'><!-- box Begin -->
<h1 '>Shop</h1>
<p>
With the increasing number of websites that have found their way into our daily lives, substantial resources are invested in enhancing user experience beyond mere functionality. <br>Optimizing flow—the psychological state of deep focus while conducting a fluent activity—seems a promising approach, resulting in a win–win situation for both users and website operators.<br><br>
</p>
</div>
";
}
}
?>
<div class="row" style='margin:15px;'><!-- row Begin -->
<?php
if(!isset($_GET['p_cat'])){
if(!isset($_GET['cat'])){
$per_page=6;
if(isset($_GET['page'])){
$page = $_GET['page'];
}else{
$page=1;
}
$start_from = ($page-1) * $per_page;
$get_products = "select * from products order by 1 DESC LIMIT $start_from,$per_page";
$run_products = mysqli_query($con,$get_products);
while($row_products=mysqli_fetch_array($run_products)){
$pro_id = $row_products['product_id'];
$pro_title = $row_products['product_title'];
$pro_price = $row_products['product_price'];
$pro_img1 = $row_products['product_img1'];
$pro_img2 = $row_products['product_img2'];
$pro_desc = $row_products['product_desc'];
$product_color = $row_products['product_color'];
$product_company = $row_products['product_company'];
echo "
<div class='col-md-4 col-sm-6' >
<div class='product-grid5'>
<div class='product-image5 rounded'>
<a href='details.php'>
<img class='pic-1' src='admin-dashboard/product_images/$pro_img1'>
<img class='pic-2' src='admin-dashboard/product_images/$pro_img2'>
</a>
<ul class='social'>
<li><a href='details.php?pro_id=$pro_id' data-tip='Add to Cart'><i class='fa fa-shopping-cart'></i></a></li>
</ul>
<a href='details.php?pro_id=$pro_id' class='select-options'><i class='fa fa-arrow-right'></i> Select Options</a>
</div>
<div class='product-content'>
<h3 class='title text-center'><a href='details.php?pro_id=$pro_id'>$pro_title</a></h3>
<div class='price text-center' style='color:blue','font-style:bold'> Rs. $pro_price </div>
<div class='price text-center'style='color:red','font-style:italic'> $pro_desc </div>
</div>
</div>
</div>
";
}
?>
</div>
</div>
<div class="col-md-3"><!-- col-md-3 Begin -->
<?php
include("includes/sidebar.php");
?>
</div>
</div><!-- row Finish -->
<center>
<ul class="pagination"><!-- pagination Begin -->
<?php
$query = "select * from products";
$result = mysqli_query($con,$query);
$total_records = mysqli_num_rows($result);
$total_pages = ceil($total_records / $per_page);
echo "
<li>
<a href='shop.php?page=1'> ".'First Page'." </a>
</li>
";
for($i=1; $i<=$total_pages; $i++){
echo "
<li>
<a href='shop.php?page=".$i."'> ".$i." </a>
</li>
";
};
echo "
<li>
<a href='shop.php?page=$total_pages'> ".'Last Page'." </a>
</li>
";
}
}
?>
</ul><!-- pagination Finish -->
</center>
<div class="row">
<?php
getpcatpro();
getpcat();
?>
</div>
</div><!-- col-md-9 Finish -->
</div><!-- container Finish -->
</div><!-- #content Finish -->
<?php
include("footer.php");
?>
<script src="js/jquery-331.min.js"></script>
<script src="js/bootstrap-337.min.js"></script>
<style>
.bc-icons-2 .breadcrumb-item + .breadcrumb-item::before {
content: none; }
.bc-icons-2 .breadcrumb-item.active {
color: #455a64;
}
.blue-grey{
color: red;
}
.breadcrumb{
background-color: yellow;
font-size: 15px;
}
.breadcrumb-item{
margin:7px;
padding:0px;
font-size: 13px;
}</style>