forked from Jmurrietasmith/EqManage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.php
153 lines (147 loc) · 5.34 KB
/
cart.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
<?php
//$test = array("eqID" => '5', "qty" => '6');
//$eqID = 4;
//$qty = 3;
//$_SESSION['cart'] = array(array("eqID" => $eqID, "qty" => $qty));
//array_push($_SESSION['cart'], $test);
//foreach ($_SESSION['cart'] as $temp){
// echo $temp['eqID'];
//}
$max=sizeof($_SESSION['cart']);
//echo $max;
for($i=0; $i<$max; $i++) {
while (list ($key, $val) = each ($_SESSION['cart'][$i])) {
echo "$key -> $val ,";
} // inner array while loop
echo "<br>";
} // outer array for loop
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>
<body class="bg-info">
<div class="container">
<div class="row">
<div class="col-lg-12 col-sm-12 col-12 main-section">
<div class="dropdown">
<button type="button" class="btn btn-info" data-toggle="dropdown">
<i class="fa fa-shopping-cart" aria-hidden="true"></i> Cart <span class="badge badge-pill badge-danger">3</span>
</button>
<div class="dropdown-menu">
<div class="row total-header-section">
<div class="col-lg-6 col-sm-6 col-6">
</div>
<!-- <div class="col-lg-6 col-sm-6 col-6 total-section text-right">-->
<!-- <p>Total: <span class="text-info">$2,978.24</span></p>-->
<!-- </div>-->
</div>
<div class="row cart-detail">
<div class="col-lg-4 col-sm-4 col-4 cart-detail-img">
<img src="https://images-na.ssl-images-amazon.com/images/I/811OyrCd5hL._SX425_.jpg">
</div>
<div class="col-lg-8 col-sm-8 col-8 cart-detail-product">
<p>Sony DSC-RX100M..</p>
<span class="price text-info"> $250.22</span> <span class="count"> Quantity:01</span>
</div>
</div>
<div class="row cart-detail">
<div class="col-lg-4 col-sm-4 col-4 cart-detail-img">
<img src="https://cdn2.gsmarena.com/vv/pics/blu/blu-vivo-48-1.jpg">
</div>
<div class="col-lg-8 col-sm-8 col-8 cart-detail-product">
<p>Vivo DSC-RX100M..</p>
<span class="price text-info"> $500.40</span> <span class="count"> Quantity:01</span>
</div>
</div>
<div class="row cart-detail">
<div class="col-lg-4 col-sm-4 col-4 cart-detail-img">
<img src="https://static.toiimg.com/thumb/msid-55980052,width-640,resizemode-4/55980052.jpg">
</div>
<div class="col-lg-8 col-sm-8 col-8 cart-detail-product">
<p>Lenovo DSC-RX100M..</p>
<span class="price text-info"> $445.78</span> <span class="count"> Quantity:01</span>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12 col-12 text-center checkout">
<button class="btn btn-primary btn-block">Checkout</button>
<button class="btn btn-primary btn-block">Checkout</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<style>
.dropdown{
float:right;
padding-right: 30px;
}
.btn{
border:0px;
margin:10px 0px;
box-shadow:none !important;
}
.dropdown .dropdown-menu{
padding:20px;
top:30px !important;
width:350px !important;
left:-110px !important;
box-shadow:0px 5px 30px black;
height: auto;
max-height: 50vh;
}
.total-header-section{
border-bottom:1px solid #d2d2d2;
}
.total-section p{
margin-bottom:20px;
}
.cart-detail{
padding:15px 0px;
}
.cart-detail-img img{
width:100%;
height:100%;
padding-left:15px;
}
.cart-detail-product p{
margin:0px;
color:#000;
font-weight:500;
}
.cart-detail .price{
font-size:12px;
margin-right:10px;
font-weight:500;
}
.cart-detail .count{
color:#C2C2DC;
}
.checkout{
border-top:1px solid #d2d2d2;
padding-top: 15px;
}
.checkout .btn-primary{
border-radius:50px;
height:50px;
}
.dropdown-menu:before{
content: " ";
position:absolute;
top:-20px;
right:50px;
border:10px solid transparent;
border-bottom-color:#fff;
}
</style>