-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdetails.php
196 lines (192 loc) · 7.74 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
<?php include "includes/header.php"; ?>
<?php
if(isset($_GET['pro_id'])){
$pro_id = $_GET['pro_id'];
$get_product = "SELECT * FROM products WHERE product_id = '$pro_id'";
$run_product = mysqli_query($con, $get_product);
$row_pro = mysqli_fetch_array($run_product);
$p_cat_id = $row_pro['p_cat_id'];
$p_title = $row_pro['product_title'];
$p_price = $row_pro['product_price'];
$p_desc = $row_pro['product_disc'];
$p_img1 = $row_pro['product_img1'];
$p_img2 = $row_pro['product_img2'];
$p_img3 = $row_pro['product_img3'];
$get_p_cat = "SELECT * FROM product_categories WHERE p_cat_id = '$p_cat_id'";
$run_p_cat = mysqli_query($con, $get_p_cat);
$row_p_cat = mysqli_fetch_array($run_p_cat);
$p_cat_title = $row_p_cat['p_cat_title'];
}
?>
<div id="content">
<div class="container">
<div class="col-md-12">
<ul class="breadcrumb">
<li>
<a href="index.php">Home</a>
</li>
<li><a href="shop.php">Shop </a></li>
<li><a href="shop.php?p_cat=<?php echo $p_cat_id; ?>"><?php echo $p_cat_title; ?> </a></li>
<li><?php echo $p_title; ?></li>
</ul>
</div>
<div class="col-md-3">
<?php include "includes/sidebar.php";
?>
</div>
<div class="col-md-9">
<div class="row" id="productMain">
<div class="col-sm-6">
<div id="mainImage">
<!-- caurseel starts -->
<div id="myCarousel" class="carousel" data-ride="carousel">
<!-- carousel-indicators starts -->
<ol class="carousel-indicators">
<li dara-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- carousel-indicators ends -->
<!-- carousel-inner start -->
<div class="carousel-inner">
<div class="item active">
<img src="admin_area/product_images/<?php echo $p_img1; ?>" alt="" class="img-responsive">
</div>
<div class="item">
<img src="admin_area/product_images/<?php echo $p_img2; ?>" alt="" class="img-responsive">
</div>
<div class="item">
<img src="admin_area/product_images/<?php echo $p_img3; ?>" alt="" class="img-responsive">
</div>
</div>
<!-- carousel-inner ends -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<!-- left carousel-control Starts -->
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous </span>
</a>
<!-- left carousel-control Ends -->
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<!-- right carousel-control Starts -->
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next </span>
</a>
<!-- right carousel-control Ends -->
</div>
<!-- caurseel ends -->
</div>
</div>
<div class="col-sm-6">
<div class="box">
<h1 class="text-center"><?php echo $p_title; ?></h1>
<?php add_cart(); ?>
<form action="details.php?add_cart=<?php echo $pro_id; ?>" method="post" class="form-horizontal">
<div class="form-group">
<label class="col-md-5 control-label" for="">Product Quntity</label>
<div class="col-md-7">
<select name="product_qty" id="" class="form-control">
<option>Select quntity</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-5 control-label" for="">Product Size</label>
<div class="col-md-7">
<select name="product_size" id="" class="form-control">
<option value="">Select a Size</option>
<option>Small</option>
<option>medium</option>
<option>Large</option>
<option>X Large</option>
</select>
</div>
</div>
<p class="price"><?php echo $p_price; ?>$</p>
<p class="text-center buttons">
<button class="btn btn-primary" type="submit">
<i class="fa fa-shopping-cart"></i>Add to Cart</button>
</p>
</form>
</div>
<div class="row" id="thumbs">
<div class="col-xs-4">
<a href="#" class="thumb">
<img src="admin_area/product_images/<?php echo $p_img1; ?>" alt="" class="img-responsive">
</a>
</div>
<div class="col-xs-4">
<a href="#" class="thumb">
<img src="admin_area/product_images/<?php echo $p_img2; ?>" alt="" class="img-responsive">
</a>
</div>
<div class="col-xs-4">
<a href="#" class="thumb">
<img src="admin_area/product_images/<?php echo $p_img3; ?>" alt="" class="img-responsive">
</a>
</div>
</div>
</div>
</div>
<div class="box" id="details">
<p>
<h4>Product Details</h4>
<p><?php echo $p_desc; ?>
</p>
<h4>Size</h4>
<ul>
<li>Small</li>
<li>Medium</li>
<li>Large</li>
<li>X Large</li>
</ul>
</p>
<hr>
</div>
<!-- Box ends-->
<div id="row same-height-row">
<div class="col-md-3 col-sm-6">
<div class="box same-height headline">
<h3 class="text-center">You may alse like these product</h3>
</div>
</div>
<?php
$query = "SELECT * FROM products ORDER BY rand() LIMIT 0,3";
$result = mysqli_query($con, $query);
while($row = mysqli_fetch_array($result)){
$pro_id = $row['product_id'];
$pro_img1 = $row['product_img1'];
$pro_title = $row['product_title'];
$pro_price = $row['product_price'];
?>
<div class="center-responsive col-md-3 col-sm-6">
<div class="product same-height">
<a href="details.php?pro_id=<?php echo $pro_id; ?>">
<img src="admin_area/product_images/<?php echo $pro_img1; ?>" alt="" class="img-responsive">
</a>
<div class="text">
<h3>
<a href="details.php?pro_id=<?php echo $pro_id; ?>"><?php echo $pro_title; ?></a>
</h3>
<p class="price"><?php echo $pro_price; ?>$</p>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php include "includes/footer.php";
?>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>