-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBHA.php
More file actions
261 lines (222 loc) · 8.92 KB
/
Copy pathBHA.php
File metadata and controls
261 lines (222 loc) · 8.92 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Brighton</title>
<link rel="icon" type="image/png" href="CSS/number-8.png">
<link rel="stylesheet" href="CSS/CHE.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lovers+Quarrel&display=swap" rel="stylesheet">
</head>
<body>
<header>
<?php include("nav.html"); ?>
</header>
<main>
<br>
<br>
<br>
<div class="a1">
<img src="CSS/Kits/BHAH.jpg" class="im">
<div id="a3">
<h1 class="t1">23/24 Brighton Home Kit</h1>
<p class="det">Working with Nike, the design marks the new adventures into the UEFA European League, detailing classic Albion blue and white stripes and featuring blue sleeves and a V-shaped collar. Why not make it personal? Your shirt, your name, your number - add your personalisation before heading to the checkout.</p>
<p class="det1">Size:</p>
<form method="post" class="ff">
<input type="radio" id="s" name="shirt" value="S">
S
<input type="radio" id="m" name="shirt" value="M">
M
<input type="radio" id="l" name="shirt" value="L">
L
<input type="radio" id="xl" name="shirt" value="XL">
XL
<input type="radio" id="xxl" name="shirt" value="XXL">
XXL
<br>
<br>
Select the number of kits
<br>
<br>
<select name="home" id="ss">
<option >1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select>
<br>
<h1 id="pr">€ 90.00</h1>
<button id="but" name="but1">Add To Cart</button>
</form>
</div>
</div>
</div>
<div class="a1">
<img src="CSS/Kits/BHE.jpg" class="im">
<div id="a3">
<h1 class="t1">23/24 Brighton Away Kit</h1>
<p class="det">Ten years on since the popular green and black striped away kit, it's back with an upgrade! Nike have designed an iconic refresh of the 2012/13 away kit, with bold black and green stripes with white pinstripe detailing.</p>
<p class="det1">Size:</p>
<form method="post" class="ff">
<input type="radio" id="s" name="shirt" value="S">
S
<input type="radio" id="m" name="shirt" value="M">
M
<input type="radio" id="l" name="shirt" value="L">
L
<input type="radio" id="xl" name="shirt" value="XL">
XL
<input type="radio" id="xxl" name="shirt" value="XXL">
XXL
<br>
<br>
Select the number of kits
<br>
<br>
<select name="home" id="ss">
<option >1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
</select>
<br>
<h1 id="pr">€ 85.00</h1>
<button id="but" name="but2">Add To Cart</button>
</form>
</div>
</div>
</div>
</main>
<footer>
<?php include("footer.html"); ?>
</footer>
</body>
</html>
<?php
include("Database/db_kits.php");
$sql="SELECT *FROM kits;";
$res=mysqli_query($conn,$sql);
if (isset($_POST['shirt']) || isset($_POST['home'])) {
$l1=$_POST["shirt"];
$l2=$_POST["home"];
$n=0;
if (isset($_POST['but1'])) {
while ($row=mysqli_fetch_assoc($res)) {
$c=$row['name'];
if ($c=='BHA_H') {
$n=1;
if ($l1=='S') {
$ff="UPDATE kits SET no=no+'$l2', S=S+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='M') {
$ff="UPDATE kits SET no=no+'$l2', M=M+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='L') {
$ff="UPDATE kits SET no=no+'$l2', L=L+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='XL') {
$ff="UPDATE kits SET no=no+'$l2', XL=XL+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else {
$ff="UPDATE kits SET no=no+'$l2', XXL=XXL+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
}
}
if ($n==0) {
if ($l1=='S') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_H', '$l2', 90, '$l2',0,0,0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='M') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_H', '$l2', 90, 0,'$l2',0,0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='L') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_H', '$l2', 90, 0,0,'$l2',0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='XL') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_H', '$l2', 90, 0,0,0,'$l2',0)";
mysqli_query($conn, $cc);
}
else {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_H', '$l2', 90, 0,0,0,0,'$l2')";
mysqli_query($conn, $cc);
}
}
}
else {
while ($row=mysqli_fetch_assoc($res)) {
$c=$row['name'];
if ($c=='BHA_A') {
$n=1;
if ($l1=='S') {
$ff="UPDATE kits SET no=no+'$l2', S=S+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='M') {
$ff="UPDATE kits SET no=no+'$l2', M=M+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='L') {
$ff="UPDATE kits SET no=no+'$l2', L=L+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else if ($l1=='XL') {
$ff="UPDATE kits SET no=no+'$l2', XL=XL+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
else {
$ff="UPDATE kits SET no=no+'$l2', XXL=XXL+'$l2' WHERE name='$c';";
mysqli_query($conn,$ff);
}
}
}
if ($n==0) {
if ($l1=='S') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_A', '$l2', 85, '$l2',0,0,0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='M') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_A', '$l2', 85, 0,'$l2',0,0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='L') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_A', '$l2', 85, 0,0,'$l2',0,0)";
mysqli_query($conn, $cc);
}
else if ($l1=='XL') {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_A', '$l2', 85, 0,0,0,'$l2',0)";
mysqli_query($conn, $cc);
}
else {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('BHA_A', '$l2', 85, 0,0,0,0,'$l2')";
mysqli_query($conn, $cc);
}
}
}
}
mysqli_close($conn);
?>