-
Notifications
You must be signed in to change notification settings - Fork 0
/
leadScoutForm.php
624 lines (544 loc) · 22.4 KB
/
leadScoutForm.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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<title>Lead Scout Form</title>
<html lang="en">
<?php include('navbar.php'); ?>
<body class="bg-body">
<div class="container row-offcanvas row-offcanvas-left">
<div class="well column col-lg-12 col-sm-12 col-xs-12" id="content">
<div class="row pt-3 pb-3 mb-3 justify-content-md-center">
<!-- Left column -->
<div class="col-md-6 col-sm-12 col-xs-12 gx-3">
<div class="card">
<div class="card-body">
<div id='ourMatches'></div>
<div class="input-group mb-3">
<select class="form-select" id="writeCompLevel" aria-label="Comp Level Select">
<option value="qm">QM</option>
<option value="sf">SF</option>
<option value="f">F</option>
</select>
<input id="writeMatchNumber" type="text" class="form-control" placeholder="Match Number" aria-label="writeMatchNumber">
<button id="loadMatch" type="button" class="btn btn-primary">Load Match</button>
</div>
<h3 id='matchBanner'>Match:</h3>
</div>
</div>
</div>
</div>
<div class="row pt-3 pb-3 mb-3 justify-content-md-center">
<div class="col-6 gx-3">
<div class="card">
<div class="card-body">
<h3>Team List</h3>
<table class="table table-striped">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Color</th>
<th scope="col">Team #</th>
</tr>
</thead>
<tbody id="rawAllianceRows">
</tbody>
</table>
</div>
</div>
</div>
<div class="col-6 gx-3">
<div class="card">
<div class="card-body">
<h3>Rank</h3>
<table class="table table-striped">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Color</th>
<th scope="col">Team #</th>
</tr>
</thead>
<tbody id="sortedAllianceRank">
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row pt-78 pb-3 mb-3 justify-content-md-center">
<button id="submitData" type="button" class="btn btn-success">Submit Ranking</button>
</div>
<div class="row pt-3 pb-3 mb-3 gap-0 row-gap-3">
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-danger">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingRed1">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picRed1Accordian" aria-expanded="true" aria-controls="picRed1Accordian">
<h4><div id='teamHeadingRed1'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picRed1Accordian" class="accordion-collapse collapse" aria-labelledby="headingRed1">
<div id='picRed1' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-danger'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataRed1'></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-danger">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingRed2">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picRed2Accordian" aria-expanded="true" aria-controls="picRed2Accordian">
<h4><div id='teamHeadingRed2'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picRed2Accordian" class="accordion-collapse collapse" aria-labelledby="headingRed2">
<div id='picRed2' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-danger'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataRed2'></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-danger">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingRed3">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picRed3Accordian" aria-expanded="true" aria-controls="picRed3Accordian">
<h4><div id='teamHeadingRed3'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picRed3Accordian" class="accordion-collapse collapse" aria-labelledby="headingRed3">
<div id='picRed3' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-danger'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataRed3'></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row pt-3 pb-3 mb-3 justify-content-md-center gap-0 row-gap-3">
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-primary">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingBlue1">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picBlue1Accordian" aria-expanded="true" aria-controls="picBlue1Accordian">
<h4><div id='teamHeadingBlue1'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picBlue1Accordian" class="accordion-collapse collapse" aria-labelledby="headingBlue1">
<div id='picBlue1' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-primary'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataBlue1'></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-primary">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingBlue2">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picBlue2Accordian" aria-expanded="true" aria-controls="picBlue2Accordian">
<h4><div id='teamHeadingBlue2'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picBlue2Accordian" class="accordion-collapse collapse" aria-labelledby="headingBlue2">
<div id='picBlue2' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-primary'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataBlue2'></tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-sm-12 col-xs-12 gx-3">
<div class="card text-bg-primary">
<div class="card-body">
<div class="accordion-item">
<h2 class="accordion-header" id="headingBlue3">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#picBlue3Accordian" aria-expanded="true" aria-controls="picBlue3Accordian">
<h4><div id='teamHeadingBlue3'>Team</div></h4>
<div class="">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
</svg>
</div>
</button>
</h2>
<div id="picBlue3Accordian" class="accordion-collapse collapse" aria-labelledby="headingBlue3">
<div id='picBlue3' class="accordion-body">
</div>
</div>
</div>
<div class='overflow-auto'>
<table class='table text-bg-primary'>
<thead>
<th scope="col">Avg Auto Pieces</th>
<th scope="col">Auto Speaker</th>
<th scope="col">Avg Telop Pieces</th>
<th scope="col">Avg Telop Speaker</th>
<th scope="col">Avg Telop Amp</th>
<th scope="col">Telop Climb %</th>
<th scope="col">Telop Harmony or Trap %</th>
</thead>
<tbody id='dataBlue3'></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<?php include("footer.php"); ?>
<script type="text/javascript" src="js/sortable.min.js"></script>
<script type="text/javascript" src="js/charts.js"></script>
<script type="text/javascript" src="js/matchDataProcessor.js"></script>
<script>
var validBlueTeams = 0;
var validRedTeams = 0
var avgBluePoints = 0;
var avgRedPoints = 0;
var avgBlueGamePieces = 0;
var avgRedGamePieces = 0;
var avgAutoBlueChargeStationPoints = 0;
var avgTeleopBlueChargeStationPoints = 0;
var avgAutoRedChargeStationPoints = 0;
var avgTeleopRedChargeStationPoints = 0;
var icon_svg = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrows-move" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M7.646.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 1.707V5.5a.5.5 0 0 1-1 0V1.707L6.354 2.854a.5.5 0 1 1-.708-.708l2-2zM8 10a.5.5 0 0 1 .5.5v3.793l1.146-1.147a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 .708-.708L7.5 14.293V10.5A.5.5 0 0 1 8 10zM.146 8.354a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L1.707 7.5H5.5a.5.5 0 0 1 0 1H1.707l1.147 1.146a.5.5 0 0 1-.708.708l-2-2zM10 8a.5.5 0 0 1 .5-.5h3.793l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L14.293 8.5H10.5A.5.5 0 0 1 10 8z"/></svg>';
var currentMatch = 0;
var compLevel = "";
function clearData(){
console.log("clearing");
$('#dataRed1').html('')
$('#dataRed2').html('')
$('#dataRed3').html('')
$('#dataBlue1').html('')
$('#dataBlue2').html('')
$('#dataBlue3').html('')
$('#rawAllianceRows').html('');
$('#sortedAllianceRank').html('');
$('#matchBanner').html('Match:');
}
function augmentTeamDataSummary(data, elementSuffix){
var matchCount = 0;
var avgAutoPiece = 0;
var avgAutoSpeaker = 0;
var avgTelopPiece = 0;
var avgTeleopSpeaker = 0;
var avgTeleopAmp = 0;
var avgTeleopClimb = 0;
var avgTeleopHarmonyOrTrap = 0;
for (var i = 0; i != data.length; i++){
var match = data[i];
matchCount++;
avgAutoPiece += getAutoPieces(match);
avgAutoSpeaker += getSpeakerAuto(match);
avgTelopPiece += getTeleopPieces(match);
avgTeleopSpeaker += getSpeakerTeleop(match) + getSpeakerAmplifiedTeleop(match);
avgTeleopAmp += getAmpTeleop(match);
avgTeleopClimb += getClimb(match) + getSpotlighted(match) ? 1 : 0;
avgTeleopHarmonyOrTrap += getHarmony(match) ? 1 : 0;
}
if (matchCount > 0){
avgAutoPiece = (avgAutoPiece / matchCount);
avgAutoSpeaker = (avgAutoSpeaker / matchCount);
avgTelopPiece = (avgTelopPiece / matchCount);
avgTeleopSpeaker = (avgTeleopSpeaker / matchCount);
avgTeleopAmp = (avgTeleopAmp / matchCount);
avgTeleopClimb = (100 * avgTeleopClimb / matchCount);
avgTeleopHarmonyOrTrap = (100 * avgTeleopHarmonyOrTrap / matchCount);
var rows = [
`<tr>`,
` <td scope='col'>${avgAutoPiece}</td>`,
` <td scope='col'>${avgAutoSpeaker}</td>`,
` <td scope='col'>${avgTelopPiece}</td>`,
` <td scope='col'>${avgTeleopSpeaker}</td>`,
` <td scope='col'>${avgTeleopAmp}</td>`,
` <td scope='col'>${avgTeleopClimb}%</td>`,
` <td scope='col'>${avgTeleopHarmonyOrTrap}%</td>`,
`</tr>`
].join('');
$(`#data${elementSuffix}`).html(rows);
}
}
function createTeamDataSummary(alliance, index, teamNumber){
var elementSuffix = `${alliance}${index}`;
$(`#teamHeading${elementSuffix}`).html(teamNumber);
// Load pics.
$(`#pic${elementSuffix}`).html('');
$.get('readAPI.php', {
'getTeamPictureFilenames': teamNumber
}).done(function(data) {
var pics = JSON.parse(data);
if (pics.length > 0){
$(`#pic${elementSuffix}`).html(`<img src='${pics[0]}' class='d-block w-100'>`);
}
});
$.get('readAPI.php', {
'readAllTeamMatchData': teamNumber
}).done(function(data) {
var data = JSON.parse(data);
augmentTeamDataSummary(data, elementSuffix);
});
}
function createDataSummaries(matchInfo){
var redTeams = matchInfo['alliances']['red']['team_keys'];
var blueTeams = matchInfo['alliances']['blue']['team_keys'];
for(var i = 0; i != redTeams.length; i++){
createTeamDataSummary('Red', i+1, strTeamToIntTeam(redTeams[i]));
}
for(var i = 0; i != blueTeams.length; i++){
createTeamDataSummary('Blue', i+1, strTeamToIntTeam(blueTeams[i]));
}
}
function strTeamToIntTeam(team) {
return parseInt(team.replace(/^(frc)/, ''));
}
function getTimeStringFromNumber(timeNumber){
var date = new Date(timeNumber * 1000);
var hours = date.getHours();
var suff = "AM";
if (hours > 12) {
hours = hours - 12;
suff = "PM"
}
var minutes = "0" + date.getMinutes();
return hours + ":" + minutes.substr(-2) + " " + suff;
}
function loadData(compLevel, matchNumber){
console.log(compLevel);
console.log(matchNumber);
clearData();
$('#matchBanner').html(`Match: ${compLevel}${matchNumber}`);
$.get('tbaAPI.php', {
'getMatchData': 1,
'number' : matchNumber,
'level' : compLevel
}).done(function(data) {
var match = JSON.parse(data);
createDataSummaries(match);
});
}
function loadUserTeamList(){
$.get('tbaAPI.php', {
'getUserMatches': 1
}).done(function(data) {
matches = JSON.parse(data);
var rows = [];
for(const match of matches){
var level = match[0];
var num = match[1];
rows.push(`<a href='./matchStrategy.php?level=${level}&match=${num}'><span class="badge text-bg-primary" style="margin-right:5px; margin-bottom:5px;" >${level}${num}</span></a>`)
}
$('#ourMatches').html(rows.join(''));
});
}
function stripTeamTags(teamList) {
var out = []
for (let i = 0; i != teamList.length; i++) {
var team = teamList[i];
team = team.toUpperCase();
team = team.replace("FRC", "");
out.push(parseInt(team, 10));
}
return out;
}
function addRawRow(color, team){
var classItem = color == 'Red' ? 'table-danger' : 'table-info';
var rows = [
`<tr data-team='${team}' class='${classItem}'>`,
` <td scope='row' class='pickHandle'>${icon_svg}</td>`,
` <td scope='row'>${color}</td>`,
` <td scope='row'>${team}</td>`,
`</tr>`
].join('');
$('#rawAllianceRows').append(rows);
}
function loadMatch(number, level){
currentMatch = number;
compLevel = level;
clearData();
$.get("tbaAPI.php", {
'getMatchData': 1,
'number' : number,
'level' : level
}).done(function(data) {
$('#matchBanner').html(`Match: ${level}${number}`);
data = JSON.parse(data);
var redTeams = stripTeamTags(data['alliances']['red']['team_keys']);
var blueTeams = stripTeamTags(data['alliances']['blue']['team_keys']);
for (let i = 0; i != redTeams.length; i++){addRawRow('Red', redTeams[i]);}
for (let i = 0; i != blueTeams.length; i++){addRawRow('Blue', blueTeams[i]);}
});
}
function getSortedTeams() {
var teamList = [];
for (let tr of $("#sortedAllianceRank tr")) {
teamList.push(Number($(tr).attr("data-team")));
}
return teamList;
}
function checkExists(level, match){
$.get('readAPI.php', {
'readAllLSData': true
}).done(function(data) {
data = JSON.parse(data);
const matchExists = data.some(obj => obj.matchNum == (level + "" + match));
if(matchExists == true){
console.log("Match Already Scouted");
alert("Match Has Already Been Scouted");
}
});
}
function saveRanking(){
$.get("writeAPI.php", {
match: compLevel + "" + currentMatch,
saveAllianceRank: JSON.stringify(getSortedTeams())
}).done(function(data) {
data = JSON.parse(data);
console.log(data);
if (data['success'] != true){
alert('Data did not submit!');
}
else {
alert("Data successfully submitted!");
clearData();
}
});
}
$(document).ready(function() {
loadUserTeamList();
const url = new URLSearchParams(window.location.search);
if (url.has('level') && url.has('match')){
loadData(url.get('level'), url.get('match'));
}
unsortedTable = new Sortable(document.getElementById('rawAllianceRows'), {
group: 'shared',
animation: 150,
sort: true,
delayOnTouchOnly: true,
fallbackTolerance: 3,
scroll: true,
handle: '.pickHandle'
});
sortedTable = new Sortable(document.getElementById('sortedAllianceRank'), {
group: 'shared',
animation: 150,
sort: true,
delayOnTouchOnly: true,
fallbackTolerance: 3,
scroll: true,
handle: '.pickHandle'
});
});
$('#loadMatch').on('click', function(){
var matchNumber = $("#writeMatchNumber").val();
var compLevel = $("#writeCompLevel").val();
loadData(compLevel, matchNumber);
loadMatch($('#writeMatchNumber').val(), $("#writeCompLevel").val());
checkExists(compLevel, matchNumber);
});
$('#submitData').on('click', function(){
saveRanking();
});
</script>
</html>