-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_products.php
152 lines (119 loc) · 3.38 KB
/
all_products.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
<!DOCTYPE>
<?php
include("function/function.php");
?>
<html>
<head>
<link rel="stylesheet" href="styles/main.css" type="text/css" media="all">
</head>
<body>
<!-- main container start here !-->
<div class="main_wrapper">
<!--header start here !-->
<div class="header_wrapper">
<div id="logo" ><a href="dex.php" id="logo_style"><pre style="text-align:center ;"><b>S</b></pre></a></div>
<div id="banner" >
</div>
</div>
<!--header ends here!-->
<!-- navigation bar start!-->
<div class="menubar">
<ul id="menu">
<li><a href="dex.php">Home</a></li>
<li><a href="all_products.php">All Products</a></li>
<li><a href="#"><?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' style='color:white; text-decoration:none;'>My Account</a>";
}
else{
echo"<a href='customer/my_account.php' style='color:white;text-decoration:none;'>My Account</a>";
}
?></a></li>
<li><a href="cart.php">Shopping Cart</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#"><?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' style='color:white; text-decoration:none;'>Login</a>";
}
else{
echo"<a href='logout.php' style='color:white;text-decoration:none;'>Logout</a>";
}
?></a></li>
</ul>
<div id="form">
<form method="get" action="results.php" enctype="multipart/form-data">
<input type="text" name="user_query" placeholder="search a product"/>
<input type="submit" name"search" value="Search"/>
</form>
</div>
</div>
<!-- navigation end!-->
<!--content wrapper start!-->
<div class="content_wrapper">
<!--sidebar!-->
<div class="sidebar">
<div class="sidebar_title">Categories</div>
<ul id="cats">
<?php getCats();?>
</ul>
<div class="sidebar_title">Brands</div>
<ul id="cats">
<?php getBrands();?>
</ul>
</div>
<div id="content_area">
<div id="shopping_cart">
<span style=" font-size:10px;padding:10;" ><h1><center>
<?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>";
}
?>
<br><b style="color:skyblue">Shopping Cart:</b> TOTAL ITEMS:<?php total_items();?> TOTAL PRICE: <?php total_price();?><a href="cart.php" style="text-decoration:none">Go to cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php' style='color:skyblue; text-decoration:none;'>Login</a>";
}
else{
echo"<a href='logout.php' style='color:white;text-decoration:none;'>Logout</a>";
}
?>
</h1></center></span>
</div>
<div id="products_box">
<?php
$get_pro="select * from products ";
$run_pro=mysqli_query($con,$get_pro);
while($row_pro=mysqli_fetch_array($run_pro)){
$pro_id=$row_pro['product_id'];
$pro_cat=$row_pro['product_cat'];
$pro_brand=$row_pro['product_brand'];
$pro_title=$row_pro['product_title'];
$pro_price=$row_pro['product_price'];
$pro_image=$row_pro['product_image'];
echo"
<div id='single_product'>
<h3>$pro_title</h3>
<img src='admin_area/product_images/$pro_image' width='180' height='180'/>
<p><b>$ $pro_price</b></p>
<a href='details.php?pro_id=$pro_id'style='float:left;'>Details</a>
<a href='dex.php?pro_id=$pro_id'><button style='float:right'>Add to Cart</button></a>
</div>
";
}
?>
</div>
</div>
</div>
<!-- content wrapper end!-->
<div class="footer">
<h2 style="text-align:center;
padding-top:30px;">© my site</h2>
</div>
</div>
<!--main container end here!-->
</body>
</html>