-
Notifications
You must be signed in to change notification settings - Fork 2
/
details.php
265 lines (179 loc) · 6.92 KB
/
details.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
<!DOCTYPE>
<?php
session_start();
include("functions/functions.php");
?>
<html>
<head>
<title>My Online Shop</title>
<meta charset="utf-8">
<meta name="viewport" content="width=1000px, initial-scale=1">
<link rel="stylesheet" href="styles/style.css" media="all" />
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body background="images/ecommerce2.jpg">
<!--Main Container starts here-->
<div class="main_wrapper">
<!--Header starts here-->
<div class="header_wrapper">
<a href="index.php"><img id="logo" src="images/logo_new.jpg" /> </a>
<img id="banner" src="images/jet-1.gif" />
</div>
<!--Header ends here-->
<!--Navigation Bar starts-->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="all_products.php">All Products</a></li>
<li><a href="customer/my_account.php">My Account</a></li>
<li><a href="customer_register.php">Sign Up</a></li>
<li><a href="cart.php">Shopping Cart</a></li>
</ul>
<form class="navbar-form navbar-left" action="results.php" enctype="multipart/form-data" method="get">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="user_query">
<div class="input-group-btn">
<button class="btn btn-default" type="submit" name="search">
<i class="glyphicon glyphicon-search"></i>
</button>
</div>
</div>
</form>
</div>
</nav>
<!--Navigation Bar ends-->
<!--Content wrapper starts-->
<div class="content_wrapper">
<nav id="sidebar">
<div class="sidebar-header"><h3>Categories</h3></div>
<ul class="list-unstyled components">
<?php getCats(); ?>
</ul>
<div class="sidebar-header"><h3>Brands</h3></div>
<ul class="list-unstyled components">
<?php getBrands(); ?>
</ul>
<div class="sidebar-header"><h3>Filter</h3></div>
<ul class="list-unstyled components">
<form action='index.php' method='post' style="margin:0 auto;">
<table align='center'>
<tr>
<td><span style='color:white;'>Select Category</span></td>
<td align="right">
<select name='filter_cat' class="form-control">
<option value='0'>All</option>
<?php
include('includes/db.php');
$get_cat = 'select * from categories';
$run_cat = mysqli_query($con, $get_cat);
while($row_cat=mysqli_fetch_array($run_cat)){
$cat_id = $row_cat['cat_id'];
$cat_title = $row_cat['cat_title'];
echo "
<option value='$cat_id'>$cat_title</option>
";
}
?>
</select>
</tr><br>
<tr>
<td><span style='color:white;'>Select Brand</span></td>
<td align="right">
<select name='filter_brand' class="form-control">
<option value='0'>All</option>
<?php
include('includes/db.php');
$get_brand = 'select * from brands';
$run_brand = mysqli_query($con, $get_brand);
while($row_brand=mysqli_fetch_array($run_brand)){
$brand_id = $row_brand['brand_id'];
$brand_title = $row_brand['brand_title'];
echo "
<option value='$brand_id'>$brand_title</option>
";
}
?>
</select>
</tr>
<tr>
<td><span style='color:white;'>Order</span></td>
<td align="right"><select name='order' class="form-control">
<option value='1'>Price Low to High</option>
<option value='2'>Price High to Low</option>
</select></td>
</tr>
</table><br>
<input type='submit' name='filter' value='Filter' class="btn btn-success" style="margin : 0 65px;">
</form>
</ul>
</nav>
<div id="content_area">
<div id="shopping_cart">
<span style="float:right; font-size:18px; padding:5px; line-height:40px;">
<?php
if(isset($_SESSION['customer_email'])){
echo "<b>Welcome:</b>" . $_SESSION['customer_email'] . "<b style='color:yellow;'>Your</b>" ;
}
else {
echo "<b>Welcome Guest:</b>";
}
?>
<b style="color:yellow">Shopping Cart -</b> Total Items: <?php total_items();?> Total Price: <?php total_price(); ?> <a href="cart.php" class="btn btn-info btn-lg" style="font-size:11px"><span class="glyphicon glyphicon-shopping-cart" style="font-size:10px"></span> Shopping Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' ><button type='button' class='btn btn-info' >Login</button></a>";
}
else {
echo "<a href='logout.php' ><button type='button' class='btn btn-info' >Logout</button></a>";
}
?>
</span>
</div>
<div id="products_box" >
<?php
if(isset($_GET['pro_id'])){
$product_id = $_GET['pro_id'];
$get_pro = "select * from products where product_id='$product_id'";
$run_pro = mysqli_query($con, $get_pro);
while($row_pro=mysqli_fetch_array($run_pro)){
$pro_id = $row_pro['product_id'];
$pro_title = $row_pro['product_title'];
$pro_price = $row_pro['product_price'];
$pro_image = $row_pro['product_image'];
$pro_desc = $row_pro['product_desc'];
echo "
<div id='single_product' style='margin-left: 150px; width: 430px;' >
<h3>$pro_title</h3>
<img src='admin_area/product_images/$pro_image' width='400' height='300' />
<p><b> $ $pro_price </b></p>
<p>$pro_desc </p>
<a href='index.php?add_cart=$pro_id'><button style='float:right' type='button' class='btn btn-success'>Add to Cart</button></a>
</div>
";
}
}
?>
</div>
</div>
</div>
<!--Content wrapper ends-->
<div id="footer">
<h2 style="text-align:center; padding-top:30px;">E-Commerce DBMS Project<br>Made By Mohit Gupta, Rahul Singh Rawat and Saif Haque<br>© All Rights Reserved.</h2>
</div>
</div>
<!--Main Container ends here-->
</body>
</html>
<?php
echo "<script>
$(document).ready(function() {
var height = Math.max($('#content_area').height(), $('#sidebar').height());
$('#sidebar').height(height);
$('#content_area').height(height);
})</script>";
?>