-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathARS.php
More file actions
257 lines (219 loc) · 8.85 KB
/
Copy pathARS.php
File metadata and controls
257 lines (219 loc) · 8.85 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Arsenal</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/ARS.jpg" class="im">
<div id="a3">
<h1 class="t1">23/24 Arsenal Home Kit</h1>
<p class="det">The Arsenal 23/24 Home Jersey celebrates the team's unique anniversary with lightning bolts and gold details. Created for loyal club supporters, the jersey features sweat-wicking AEROREADY technology to keep you feeling dry, while a woven badge shows off your team pride.</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/ARAa.jpg" class="im">
<div id="a3">
<h1 class="t1">23/24 Arsenal Away Kit</h1>
<p class="det">Arsenal's identity gets a modern update in the Arsenal 23/24 Away Shirt. Flowing over a bright yellow background, black meandering graphics suggest the continuous motion of supporters in N7 on match days.</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">€ 80.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=='ARS_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 ('ARS_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 ('ARS_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 ('ARS_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 ('ARS_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 ('ARS_H', '$l2', 90, 0,0,0,0,'$l2')";
mysqli_query($conn, $cc);
}
}
}
else {
while ($row=mysqli_fetch_assoc($res)) {
$c=$row['name'];
if ($c=='ARS_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 ('ARS_A', '$l2', 80, '$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 ('ARS_A', '$l2', 80, 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 ('ARS_A', '$l2', 80, 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 ('ARS_A', '$l2', 80, 0,0,0,'$l2',0)";
mysqli_query($conn, $cc);
}
else {
$cc="INSERT INTO kits (name, no, price, S, M, L, XL, XXL)
VALUES ('ARS_A', '$l2', 80, 0,0,0,0,'$l2')";
mysqli_query($conn, $cc);
}
}
}
}
mysqli_close($conn);
?>