-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdetails.php
109 lines (86 loc) · 2.47 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
<?php include 'inc/header.php';?>
<?php
if(isset($_GET['proid'])){
$id = preg_replace('/[^-a-zA-Z0-9_]/', '', $_GET['proid']);
}
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit']))
{
$quantity = $_POST['quantity'];
$Delivery = $_POST['Delivery'];
$addCart = $ct->addToCart($quantity,$Delivery, $id);
}
?>
<?php
$cmrId = Session::get("cmrId");
$cmr = new Customer();
if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['compare'])){
$productId = $_POST['productId'];
$insertCom = $pd->insertCompareData($productId, $cmrId);
}
?>
<div class="main">
<div class="content">
<div class="section group">
<div class="cont-desc span_1_of_2">
<?php
$getPd = $pd->getSingleProduct($id);
if ($getPd) {
while ($result = $getPd->fetch_assoc()) {
?>
<div class="grid images_3_of_2">
<img src="admin/<?php echo $result['image']; ?>" alt="" />
</div>
<div class="desc span_3_of_2">
<h2><?php echo $result['productName']; ?></h2>
<div class="price">
<p>Price: <span><?php echo $result['price']; ?></span></p>
<p>Category: <span><?php echo $result['catName']; ?></span></p>
</div>
<div class="add-cart">
<form action="" method="post">
<input type="number" class="buyfield" name="quantity" value="1"/>
<select name="Delivery">
<option value="">Select...</option>
<option value="In Restaurant">In Restaurant</option>
<option value="Home Delivery">Home delivery</option>
</select>
<input type="submit" class="buysubmit" name="submit" value="Buy Now"/>
</form>
</div>
<span style = "color:red; font_size:18px;">
<?php
if (isset($addCart)) {
echo $addCart;
}
?>
</span>
<?php
if (isset($insertCom)) {
echo $insertCom;
}
?>
</div>
<div class="product-desc">
<h2>Product Details</h2>
<?php echo $result['body']; ?>
</div>
<?php } } ?>
</div>
<div class="rightsidebar span_3_of_1">
<h2>CATEGORIES</h2>
<ul>
<?php
$getCat = $cat->getAllCat();
if ($getCat) {
while ($result = $getCat->fetch_assoc()) {
?>
<li><a href="productbycat.php?catId=<?php echo $result['catId']; ?>"><?php echo $result['catName']; ?></a></li>
<?php } } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'inc/footer.php';?>