-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetail.php
136 lines (103 loc) · 3.64 KB
/
detail.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
<?php session_start();
//----------------------------------------------
require_once("includes/header.php");
require_once("includes/error.php");
require_once("dbclass/Dbpdo.class.php");
require_once("functions/misc.php");
require_once("functions/cart.php");
require_once("classes/clsinput.php");
//----------------------------------------------
$submitRecid = input::get('recid');
if ( ! is_numeric( $submitRecid ) ) { exit(); }
$productdetails = getproductdetails($submitRecid);
if ( count($productdetails) == 0 ) { exit(); }
$recid = $submitRecid;
//----------------------------------------------
$submitAction = input::get('action');
//$_SESSION['from'] = $_SERVER['PHP_SELF'];
//$submitFromURL = input::get('from');
$submitFromURL = "";
if ($submitAction == "add") {
if ( checkrecid($submitRecid) != 0 ) {
$physical = 1; //is always physical in this case
add($submitRecid, $submitFromURL, $physical);
}
}
//-----------------------------------------
//Find number of items in the cart
if ( isset($_SESSION['session_cart']) ){
$numberincart = count($_SESSION['session_cart']);
}else{
$numberincart = 0;
}
require_once("includes/menu.php");
?>
<div class="container">
<div class="shoppingproducts">
<div class="row">
<div class="col-md-12">
<p>
<span class="basket-setting"><?php echo($numberincart); ?><a href="viewcart.php"> Basket</a> <i class="fa fa-shopping-basket fa-1x" aria-hidden="true"></i></span>
<br/>
</p>
</div>
</div>
<div class="row">
<div class="col-md-2"> </div>
<div class="col-md-6"><img src="assets/shopping_cart.png" alt="Shopping cart image" class="img-fluid" /></div>
<div class="col-md-4"> </div>
</div>
<div class="row">
<div class="col-md-2"> </div>
<div class="col-md-10"><hr></div>
</div>
<div class="row">
<?php
foreach( $productdetails as $d_row ) {
?>
<div class="col-md-2"> </div>
<div class="col-md-6">
<h2><?php echo( $d_row["item_title"] ); ?></h2>
<div style="float:left;margin-right:10px;margin-bottom:10px;">
<?php
if ($d_row["item_image"] != "") {
?>
<img src="<?php echo( $d_row["item_image"] ); ?>"
class="img-fluid img-thumbnail rounded"
style="max-width:100%; height:auto; padding-top:15px;border: none;"
alt="<?php echo( $d_row["item_title"] ); ?>" />
<?php
}
?>
</div>
<p><?php echo( $d_row["item_description"] ); ?></p>
<?php
if ($d_row["item_description_full"] != "") {
?><p><?php echo( $d_row["item_description_full"] ); ?></p><?php
}
?>
<p class="cost"><?php echo( $d_row["currency"] ); ?> <?php echo( $d_row["mc_gross"] ); ?></p>
<p>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="hidden" name="recid" value="<?php echo($recid); ?>" />
<input type="hidden" name="action" value="add" />
<input type="hidden" name="from" value="<?php echo ($_SERVER['PHP_SELF']); ?>" />
<button type="submit" class="btn btn-info">Add to cart</button>
</form>
</p>
</div>
<div class="col-md-4">
<h4>Most Popular</h4>
</div>
<?php
}
?>
</div>
</div> <!-- End shoppingproducts -->
<?php
require_once("includes/copyright.php");
?>
</div> <!-- End container -->
<?php
require_once("includes/footer.php");
?>