-
Notifications
You must be signed in to change notification settings - Fork 0
/
product-details.php
339 lines (252 loc) · 10.5 KB
/
product-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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<?php
session_start();
if (!isset($_SESSION['furnitureuser']))
{
$my_rand_strng = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), -15);
$_SESSION['furnitureuser']=$my_rand_strng;
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Product Details | Furnituredecor</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/prettyPhoto.css" rel="stylesheet">
<link href="css/price-range.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<style>
.img-hover img {
-webkit-transition: all .3s ease; /* Safari and Chrome */
-moz-transition: all .3s ease; /* Firefox */
-o-transition: all .3s ease; /* IE 9 */
-ms-transition: all .3s ease; /* Opera */
transition: all .3s ease;
}
.img-hover img:hover {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform:translateZ(0) scale(1.20); /* Safari and Chrome */
-moz-transform:scale(1.20); /* Firefox */
-ms-transform:scale(1.20); /* IE 9 */
-o-transform:translatZ(0) scale(1.20); /* Opera */
transform:translatZ(0) scale(1.20);
}
.grayscale {
-webkit-filter: brightness(1.10) grayscale(100%) contrast(90%);
-moz-filter: brightness(1.10) grayscale(100%) contrast(90%);
filter: brightness(1.10) grayscale(100%);
}
</style>
</head><!--/head-->
<body>
<header id="header"><!--header-->
<?php include('header.html');?>
</header><!--/header-->
<section>
<div class="container">
<div class="row">
<div class="header-middle">
<div class="product-details"><!--product-details-->
<?php
include('connection.php');
$name=$_GET['id'];
try {
$sql = $conn->prepare("SELECT * FROM product where id='$name' ");
$sql->execute();
while($result = $sql->fetch(PDO::FETCH_ASSOC)){
$result123=$result["path"];
$id=$result["id"];
$name=$result["name"];
$cate=$result["category"];
$price=$result["price"];
$qty=$result["stock"];
$deta= $result["details"];
}
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
<div class="col-sm-5">
<div class="view-product">
<img src="<?php echo $result123; ?>" alt="" data-target="#myModal" data-toggle="modal" id="orgimg">
</div>
<?php
$a=0;
$n=stripos("$name","-");
if($n>1)
{
$abc=str_split("$name",$n);
$sname=$abc[0];
}
else
{
$sname=$name;
}
try {
$sql1 = $conn->prepare("SELECT * FROM product where name like '%$sname%' and category='$cate' ");
$sql1->execute();
$count = $sql1->rowCount();
if($count>1)
{
echo '<div id="similar-product" class="carousel" data-ride="carousel">';
echo '<div class="carousel-inner">';
while($result1 = $sql1->fetch(PDO::FETCH_ASSOC)){
$result11=$result1["path"];
$id1=$result1["id"];
$name1=$result1["name"];
$cate1=$result1["category"];
$price1=$result1["price"];
$qty1=$result1["stock"];
$deta1= $result1["details"];
if($a==0)
{
echo '<div class="item active"><table><tr><td>';
echo '<img src="'.$result11.'" height="100px" width="100px" onmouseover=cdisp("'.$result11.'") onclick="cname('.$id1.')" /><td></tr>';
echo '<tr><td>            '.$name1.'</td></tr></table>';
echo "</div>";
$a=1;
}
else
{
echo '<div class="item"><table><tr><td>';
echo '<img src="'.$result11.'" height="100px" width="100px" onmouseover=cdisp("'.$result11.'") onclick="cname('.$id1.')" /><td></tr>';
echo '<tr><td>            '.$name1.'</td></tr></table>';
echo "</div>";
}
}
echo "</div>";
echo '<a class="left item-control" href="#similar-product" data-slide="prev" style="left:25%">';
echo '<i class="fa fa-angle-left"></i>';
echo '</a>';
echo '<a class="right item-control" href="#similar-product" data-slide="next" style="right:40%">';
echo '<i class="fa fa-angle-right"></i>';
echo '</a>';
echo '</div>';
}
}
catch(PDOException $e) {
echo $e->getMessage();
}
?>
<script>
function cdisp(val)
{
var a=val;
document.getElementById("orgimg").src=a;
document.getElementById("max").src=a;
}
function cname(val)
{
var a=val;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("disp").innerHTML =this.responseText;
}
};
xhttp.open("GET", "chaproduct.php?q="+a, true);
xhttp.send();
}
</script>
</div><div id="disp">
<div class="col-sm-7"><form action="addcart.php" method="post">
<div class="product-information"><!--/product-information-->
<h2>Category:<?php echo $cate; ?></h2>
<h5 id="txt">Product name:<?php echo $name; ?></h5>
<p>Web ID: <input style="border:none;" id="id" type="text" name="id" value="<?php echo $id;?>"><img src="images/product-details/rating.png" alt="" /></p>
<span>
<span>RS ₹<?php echo $price;?></span>
<label>Quantity:</label>
<input type="text" value="1" name="qty" /><br>
<button type="submit" class="btn btn-fefault cart" name="submit" value="cart">
<i class="fa fa-shopping-cart"></i>
Add to Cart
</button> 
<button type="submit" class="btn btn-fefault cart" name="submit" value="list">
<i class="fa fa-star"></i>
Add to wishlist
</button>
<div tabindex="-1" class="modal fade" id="myModal" role="dialog" aria-hidden="true" aria-labelledby="myModalLabel" style="padding-left:10px;">
<img src="<?php echo $result123; ?>" alt="" height="600px" width="800px" id="max" style="margin: 0;position: absolute;top: 50%;left: 50%;margin-right: -50%;transform: translate(-50%, -50%)">
</div>
</span>
<p><b>Product Details:</b></p><p><?php echo nl2br($deta);?></p>
<p>Payment : Cash On delivery.</p>
<p>Delivery : Within 10 Days.</p>
<p>**Shipping Charges </b>May apply outside Tamilnadu.</p>
<!--<p><b>Availability:</b> In Stock</p>
<p><b>Condition:</b> New</p>
<p><b>Brand:</b>Furnituredecor</p><br>-->
</form>
</div><!--/product-information-->
</div></div>
</div><!--/product-details-->
<div class="category-tab shop-details-tab"><!--category-tab-->
<div class="col-sm-12">
<ul class="nav nav-tabs">
<li class="active"><a href="#details" data-toggle="tab">Reviews</a></li>
<li><a href="#reviews" data-toggle="tab">Feed Back</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane fade active in" id="details" >
<p><?php
$sql = $conn->prepare("SELECT * FROM feedback where id=$id ORDER BY RAND() LIMIT 3 ");
$sql->execute();
while($result = $sql->fetch(PDO::FETCH_ASSOC)){
echo "<b>Name:</b>".$result["name"]."<br>";
echo "<b>Review:</b>".$result["note"]."<br>";
echo "<b>Ratings:</b>".$result["ratings"]."<br>";
}?>
</p>
</div>
<div class="tab-pane fade" id="reviews" >
<div class="col-sm-12">
<form action="addfeedback.php" method="post">
<p>Write your review
<textarea name="feedback"></textarea>
<input type="hidden" name="product" value="<?php echo $name; ?>" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<b>Rating: </b> <input type="checkbox" name="rat[]" value="1" id="1" onmouseover="cal(1)"> <input type="checkbox" name="rat[]" value="2" id="2" onmouseover="cal(2)"> <input type="checkbox" name="rat[]" value="3" id="3" onmouseover="cal(3)"> <input type="checkbox" name="rat[]" value="4" id="4" onmouseover="cal(4)"> <input type="checkbox" name="rat[]" value="5" id="5" onmouseover="cal(5)">
<input style="background-color:#43C6DB;" type="submit" class="btn btn-default pull-right" name="Add" value="Submit">
</form>
</div>
</div>
</div>
</div><!--/category-tab-->
</div>
</div>
</div>
</section>
<footer id="footer">
<?php include('footer.html');?>
</footer><!--/Footer-->
<script>
function cal(check)
{
document.getElementById(check).checked = true;
}
</script>
<link rel="stylesheet" href="pop/new3.css">
<script src="pop/jquery.min.js"></script>
<script src="pop/new3.css"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.scrollUp.min.js"></script>
<script src="js/price-range.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js"></script>
</body>
</html>