-
Notifications
You must be signed in to change notification settings - Fork 0
/
products.php
194 lines (171 loc) · 7.04 KB
/
products.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?php
include "includes/common.php";
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<!--
-->
<html>
<head>
<title>E-Store|Products</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css">
<script type="text/javascript" src="bootstrap/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/css.css" type="text/css">
</head>
<body>
<?php
include 'includes/header.php';
include 'includes/check-if-added.php';
?>
<div class="container-fluid"><br><br><br>
<div class="row">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 1</h4>
</div>
<div class="thumbnail">
<img src="img/1.jpg">
<div class="caption">
<p>Apple iPhone X 64GB. Rs.70,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(1)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=1" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 2</h4>
</div>
<div class="thumbnail">
<img src="img/2.jpg">
<div class="caption">
<p>Apple iPhone XS 64 GB. Rs.88,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(2)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=2" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 3</h4>
</div>
<div class="thumbnail">
<img src="img/3.jpg">
<div class="caption">
<p>Apple iPhone XR 64 GB. Rs.53,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(3)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=3" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 4</h4>
</div>
<div class="thumbnail">
<img src="img/4.jpg">
<div class="caption">
<p>Apple iPhone 11 64 GB. Rs.70,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(4)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=4" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 5</h4>
</div>
<div class="thumbnail">
<img src="img/5.jpg">
<div class="caption">
<p>Apple iPhone 11 Pro 64 GB. Rs.1,10,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(5)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=5" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Mobile 6</h4>
</div>
<div class="thumbnail">
<img src="img/6.jpg">
<div class="caption">
<p>Apple iPhone 11 Pro Max 64 GB. Rs.1,30,000</p>
<?php
//We have created a function to check whether this particular product is added to cart or not.
if (check_if_added_to_cart(6)) { //This is same as if(check_if_added_to_cart !=0)
echo '<a href="#" class="btn btn-block btn-success" disabled>Added to cart</a>';
} else {
?>
<a href="cart-add.php?id=6" name="add" value="add" class="btn btn-block btn-primary">Add to cart</a>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>