-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
422 lines (361 loc) · 15.9 KB
/
search.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
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<?php
include 'connection/connection.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Team #6459 | Scout App</title>
<!-- Favicon -->
<link rel="shortcut icon" href="FRCLogo2.png" type="image/x-icon">
<!-- Custom styles -->
<link rel="stylesheet" href="./css/style.min.css">
</head>
<body>
<div class="layer"></div>
<!-- ! Body -->
<a class="skip-link sr-only" href="#skip-target">Skip to content</a>
<div class="page-flex">
<!-- ! Sidebar -->
<aside class="sidebar">
<div class="sidebar-start">
<div class="sidebar-head">
<a href="index.html" class="logo-wrapper" title="Home">
<span class="sr-only">Home</span>
<span class="icon logo" aria-hidden="true"></span>
<div class="logo-text">
<span class="logo-title">Team #6459</span>
<span class="logo-subtitle">Scout App</span>
</div>
</a>
<button class="sidebar-toggle transparent-btn" title="Menu" type="button">
<span class="sr-only">Toggle menu</span>
<span class="icon menu-toggle" aria-hidden="true"></span>
</button>
</div>
<div class="sidebar-body">
<ul class="sidebar-body-menu">
<li>
<a class="active" href="index.html"><span class="icon home" aria-hidden="true"></span>Scout App Anasayfa</a>
</li>
<li>
<a class="show-cat-btn" href="##">
<span class="icon document" aria-hidden="true"></span>Raporlar
<span class="category__btn transparent-btn" title="Open list">
<span class="sr-only">Open list</span>
<span class="icon arrow-down" aria-hidden="true"></span>
</span>
</a>
<ul class="cat-sub-menu">
<li>
<a href="Rapor.php">Yeni Rapor</a>
</li>
<li>
<a href="cameraphoto.php">Robot Fotoğrafı Çek</a>
</li>
</ul>
<a class="show-cat-btn" href="##">
<span class="icon document" aria-hidden="true"></span>Arama
<span class="category__btn transparent-btn" title="Open list">
<span class="sr-only">Open list</span>
<span class="icon arrow-down" aria-hidden="true"></span>
</span>
</a>
<ul class="cat-sub-menu">
<li>
<a href="searchteam.php">Takım Ara</a>
</li>
<li>
<a href="searchwithmatchid.php">Maç Numarası ile Ara</a>
</li>
<li>
<a href="searcholdteam.php">Eski Yıllarla Takımları Arama</a>
</li>
</ul>
<a class="show-cat-btn" href="##">
<span class="icon document" aria-hidden="true"></span>FRC 2022
<span class="category__btn transparent-btn" title="Open list">
<span class="sr-only">Open list</span>
<span class="icon arrow-down" aria-hidden="true"></span>
</span>
</a>
<ul class="cat-sub-menu">
<li>
<a href="Manuel.php">Manual
</a>
</li>
</ul>
</div>
</div>
<style type="text/css">.top-cat-list__subtitlep {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
font-size: 12px;
line-height: 1.2;
letter-spacing: -0.4px;
color: #59ff00;
background-color: #000000;
}
</style>
<style type="text/css">.top-cat-list__titlez {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
font-weight: 600;
font-size: 16px;
line-height: 1.2;
letter-spacing: -0.4px;
color: #ff0000;
margin-bottom: 4px;
background-color: #000000;
}
.grid-object{
max-width: 10%;
height: auto;
background-size: cover;
}
</style>
</aside>
<div class="main-wrapper">
<!-- ! Main nav -->
<nav class="main-nav--bg">
<div class="container main-nav">
<div class="main-nav-end">
<button class="sidebar-toggle transparent-btn" title="Menu" type="button">
<span class="sr-only">Toggle menu</span>
<span class="icon menu-toggle--gray" aria-hidden="true"></span>
</button>
<button class="theme-switcher gray-circle-btn" type="button" title="Switch theme">
<span class="sr-only">Switch theme</span>
<i class="sun-icon" data-feather="sun" aria-hidden="true"></i>
<i class="moon-icon" data-feather="moon" aria-hidden="true"></i>
</button>
</div>
</div>
</nav>
<?php
$code ='py veriçekme.py '.$_POST["teamid"].'';
$command = escapeshellcmd($code);
$output = shell_exec($command);
$lastoutput=explode('|', $output);
?>
<?php
?>
<!-- ! Main -->
<main class="main users chart-page" id="skip-target">
<div class="container">
<h2 class="main-title">Team <?php echo $_POST["teamid"]; ?> için sonuçlar</h2>
<a style="background-color: green" class="form-btn primary-default-btn transparent-btn" href="https://www.thebluealliance.com/team/<?php echo $_POST["teamid"]; ?>">Takımın The Blue Alliance Sayfasına Git</a>
<div class="row">
<div class="col-lg-3" style="flex: 0 0 100%;max-width: 100%;">
<article class="white-block">
<?php
$teamid = $_POST["teamid"];
$psql = "SELECT * FROM robotphoto where pteamid = '$teamid' ";
$presult = $conn->query($psql);
if ($presult->num_rows > 0) {
// output data of each row
while($row = $presult->fetch_assoc()) {
$robotphoto = $row["robotphoto"];
$drivetrain = $row["drivetrain"];
}
}
else{
echo "Fotoğraf yok";
}
?>
<img id="canvasimg" style="width: min-content;height: 450px;display:none;">
<br>
<h2 class="main-title"><?php echo sprintf("Drive Train: %s", $drivetrain); ?></h2>
<div class="top-cat-list__titlez">Rankings</div>
<div class="top-cat-list__subtitlep"><?php
for ($i = 0; $i < count($lastoutput)-1; ++$i) {
$tamveriler=explode(';',$lastoutput[$i]);
for ($x = 0; $x < count($tamveriler); ++$x) {
echo "$tamveriler[$x]<br>";
}
echo "<br>";
}
?></div>
<ul class="top-cat-list">
<script type="text/javascript">
var dataURL = "<?php echo $robotphoto; ?>";
document.getElementById("canvasimg").style.border = "2px solid";
document.getElementById("canvasimg").src = dataURL;
document.getElementById("canvasimg").style.display = "inline";
</script>
<?php
$sql = "SELECT * FROM data where teamid = '$teamid' ";
$result = $conn->query($sql);
$total = 0;
$objecttotal = 0;
$count = 0;
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$count = $count + 1;
$total = $total + $row["totalpoint"];
$objecttotal=$objecttotal + $row["objecttotal"];
?>
<li>
<a href="details.php?id=<?php echo $row["id"]; ?>" >
<br>
<div style="margin:auto;" id="grid-col-1">
<?php
$grid = explode(",", $row["grid"]);
for ($i = 0; $i < 9; $i++) {
if ($i == 1 || $i == 4 || $i == 7) {
if (intval($grid[$i]) == 1) {
echo('<img id="High' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cube.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="High' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cube.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="High' . ($i+1) . '" class="grid-object" src="img/frc2023cube.jpg" alt="0">');
}
}else{
if (intval($grid[$i]) == 1) {
echo('<img id="High' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cone.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="High' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cone.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="High' . ($i+1) . '" class="grid-object" src="img/frc2023cone.jpg" alt="0">');
}
}
}
?>
</div>
<div style="margin:auto;" id="grid-col-2">
<?php
for ($i = 9; $i < 18; $i++) {
if ($i == 10 || $i == 13 || $i == 16) {
if (intval($grid[$i]) == 1) {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cube.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cube.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" src="img/frc2023cube.jpg" alt="0">');
}
}else{
if (intval($grid[$i]) == 1) {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cone.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" style="background-image: url(img/frc2023cone.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="Mid' . ($i+1) . '" class="grid-object" src="img/frc2023cone.jpg" alt="0">');
}
}
}
?>
</div>
<div style="margin:auto;" id="grid-col-3">
<?php
for ($i = 18; $i < 27; $i++) {
if ($i == 19 || $i == 22 || $i == 24) {
if (intval($grid[$i]) == 1) {
echo('<img id="Low' . ($i+1) . '" class="grid-object" style="background-image: url(img/anythinglogo.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="Low' . ($i+1) . '" class="grid-object" style="background-image: url(img/anythinglogo.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="Low' . ($i+1) . '" class="grid-object" src="img/anythinglogo.jpg" alt="0">');
}
}else{
if (intval($grid[$i]) == 1) {
echo('<img id="Low' . ($i+1) . '" class="grid-object" style="background-image: url(img/anythinglogo.jpg);" src="img/placed.png" alt="0">');
} elseif (intval($grid[$i]) == 2) {
echo('<img id="Low' . ($i+1) . '" class="grid-object" style="background-image: url(img/anythinglogo.jpg);" src="img/oto-placed.png" alt="0">');
} else {
echo('<img id="Low' . ($i+1) . '" class="grid-object" src="img/anythinglogo.jpg" alt="0">');
}
}
}
?>
</div>
<br>
<div class="top-cat-list__subtitle">
Auto Total <span class="warning"><?php echo $row["autototal"]; ?></span>
</div><br>
<div class="top-cat-list__subtitle">
Teleop Total <span class="warning"><?php echo $row["teletotal"]; ?></span>
</div><br>
<div class="top-cat-list__subtitle">
Yerleştirilen Obje <span class="warning"><?php echo $row["objecttotal"]; ?></span>
</div><br>
<div class="top-cat-list__title">
Toplam Puan <span><?php echo $row["totalpoint"] ?></span>
</div><br>
<?php
$Hangar = "";
$Hangar = $row["chargingstationstatus"];
if($Hangar == 0){
$Hangar = "Tırmanma Yok";
}
if($Hangar == 1){
$Hangar = "Taxi";
}
if($Hangar == 2){
$Hangar = "Çıktı Fakat Dengesiz";
}
if($Hangar == 3){
$Hangar = "Çıktı Ve Dengeli";
}
?>
<div class="top-cat-list__subtitle">
Hangar Type <span class="success"><?php echo $Hangar; ?></span>
</div><br>
<div class="top-cat-list__subtitle">
Penalties <span class="success"><?php echo $row["penalties"]; ?></span>
</div>
<div class="top-cat-list__subtitle">
Notes <span class="success"><?php echo $row["notes"]; ?></span>
</div>
</a>
</li>
<?php
}
echo "<br> Ortalama Puanları = ".$total/$count;
echo "<br><br> Ortalama Obje Sayısı = ".$objecttotal/$count;
} else {
echo "0 results";
}
?>
</ul>
</article>
</div>
</div>
</div>
<input type="button" name="" onclick="history.back()" style="background-color: red" class="form-btn primary-default-btn transparent-btn" value="Geri Dön">
</main>
<!-- ! Footer -->
<footer class="footer">
<div class="container footer--flex">
<div class="footer-start">
<p>-Vually-<a href="##" target="_blank"
rel="noopener noreferrer">#Team 6459</a></p>
</div>
</div>
</footer>
</div>
</div>
<!-- Chart library -->
<script src="./plugins/chart.min.js"></script>
<!-- Icons library -->
<script src="plugins/feather.min.js"></script>
<!-- Custom scripts -->
<script src="js/script.js"></script>
</body>
</html>