-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasket.php
executable file
·85 lines (62 loc) · 2 KB
/
basket.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
<?php
include_once("includes/session.php");
include_once("includes/databaseConnect.php");
include_once("pageHeader.php");
$isEmpty = true;
?>
<div class="container">
<h1>Košík</h1>
<table class="table">
<tr>
<th>Obrázok</th>
<th>Kód</th>
<th>Názov</th>
<th>Cena</th>
<th>Množstvo</th>
<th>Zmazať</th>
</tr>
<?php
$basket_id = $_COOKIE['shopping_cart_id'];
$SQL = "
SELECT
basket.id,
products.product_code,
products.product_name,
products.product_img_name,
products.price,
quantity
FROM `basket` inner join products on basket.product_code = products.product_code
where basket.basket_id='$basket_id'
";
$results = $connection->query($SQL);
if ($results) {
while ($obj = $results->fetch_object()) {
echo '<tr>';
echo '<td><img src="images/' . $obj->product_img_name . '" width="80" height="80" /></td>'; //
echo '<td>' . $obj->product_code . '</td>'; //
echo '<td>' . $obj->product_name . '</td>'; //
echo '<td>' . $obj->price . '</td>'; //
echo '<td>' . $obj->quantity . '</td>';
echo '<td><a class="btn btn-default" href="productDelete.php?id=' . $obj->id . '"><i class="fa fa-times"></i></a></td>';
echo '</tr>';
$isEmpty = false;
}
}
?>
</table>
</div>
<div class="container">
<div class="clearfix">
<a class="pull-left btn btn-default" href="products.php"><i class="fa fa-angle-double-left"></i> Pokračovať v
nákupe</a>
<?php
if ( !$isEmpty ) {
echo '<a class="pull-right btn btn-default" href="order.php">Objednať <i class="fa fa-angle-double-right"></i></a>';
}
?>
</div>
</div>
<?php
include_once("pageFooter.php");
include_once("includes/databaseClose.php");
?>