-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetails.php
More file actions
121 lines (106 loc) · 3.04 KB
/
Copy pathdetails.php
File metadata and controls
121 lines (106 loc) · 3.04 KB
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
<?php
include("inc/header.php");
?>
<?php
if (isset($_GET['pdid'])) {
$pdid = $_GET['pdid'];
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['submit'])) {
$quant = $_POST['quantity'];
if ($quant>0) {
$addcart = $ct->addToCart($quant, $pdid);
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['compare'])) {
$csid = Session::get('csid');
$prodId = $_POST['prodId'];
$insertCom = $pd->insertCompare($csid,$prodId);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['wishlist'])) {
$csid = Session::get('csid');
$insertCom = $pd->saveToWishlist($csid,$pdid);
}
?>
<div class="main">
<div class="content">
<div class="section group">
<?php
$singlePd = $pd->getSingleProduct($pdid);
if ($singlePd) {
while ($row = $singlePd->fetch_assoc()) {
?>
<div class="cont-desc span_1_of_2">
<div class="grid images_3_of_2">
<img src="admin/<?php echo $row['image'];?>" alt="" />
</div>
<div class="desc span_3_of_2">
<h2><?php echo $row['productName'];?></h2>
<p><?php echo $fm->textShorten($row['body'],100);?></p>
<div class="price">
<p>Price: <span>$<?php echo $row['price']; ?></span></p>
<p>Category: <span><?php echo $row['catName']; ?></span></p>
<p>Brand:<span><?php echo $row['brandName']; ?></span></p>
</div>
<div class="add-cart">
<form action="" method="post">
<input type="number" class="buyfield" name="quantity" value="1"/>
<input type="submit" class="buysubmit" name="submit" value="Buy Now"/>
</form><br>
<span style="color:red"><?php
if (isset($addcart)) {
echo $addcart;
}
?>
</span>
</div>
<?php
if (isset($insertCom)) {
echo $insertCom;
}
?>
<?php
if (Session::get('cslogin') == true) {
?>
<div class="add-cart">
<form action="" method="post">
<input type="hidden" name="prodId" value="<?php echo $row['pid']; ?>"/>
<input type="submit" class="buysubmit" name="compare" value="Add to Compare"/>
</form><br>
</div>
<div class="add-cart">
<form action="" method="post">
<input type="submit" class="buysubmit" name="wishlist" value="Save To wishlist"/>
</form><br>
</div>
<?php } ?>
</div>
<div class="product-desc">
<h2>Product Details</h2>
<p><?php echo $row['body'];?></p>
</div>
</div>
<?php
}
}
?>
<div class="rightsidebar span_3_of_1">
<h2>CATEGORIES</h2>
<ul>
<?php
$allCat = $cat->getAllcat();
if ($allCat) {
while ($rows = $allCat->fetch_assoc()) {
?>
<li><a href="productbycat.php?catid=<?php echo $rows['catId'];?>"><?php echo $rows['catName'];?></a></li>
<?php
}
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php
include("inc/footer.php");
?>