forked from crazyman10123/mapveto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
specPicks.php
76 lines (76 loc) · 2.2 KB
/
specPicks.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
<?php
include 'dbConn.php';
$mapCon = createDBConn();
$matchID = $_POST['matchID'];
$checkMap = $mapCon->query(
"SELECT BanOne, BanTwo, BanThree, BanFour, BanFive, BanSix, BanPickOne, BanPickTwo, BanPickThree
FROM `Matches`
WHERE MatchID = '$matchID'"
);
$checkMatchType = $mapCon->query(
"SELECT MatchType FROM Matches WHERE MatchID = '$matchID'"
);
$checkMatchType = $checkMatchType->fetch_assoc();
$matchType = $checkMatchType['MatchType'];
$checkMap = $checkMap->fetch_assoc();
foreach($checkMap as $key => $tmap) {
if(empty($tmap)) {
break;
}
if($tmap == "Dust 2") {
$tmap = "dust2";
$mapname = "Dust 2";
} else {
$mapname = $tmap;
}
if($matchType=="BO3") {
if($key=="BanThree" || $key=="BanFour" || $key=="BanPickOne") {
$pickType="picked";
} else {
$pickType = "banned";
}
} else {
if($key=="BanPickOne") {
$pickType = "picked";
} else {
$pickType = "banned";
}
}
if($key=="BanOne") {
echo '$("#one").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanTwo") {
echo '$("#two").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanThree") {
echo '$("#three").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanFour") {
echo '$("#four").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanFive") {
echo '$("#five").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanSix") {
echo '$("#six").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
if($key=="BanPickOne") {
echo '$("#seven").attr("id", "'.$tmap.'");';
echo '$("#'.$tmap.'").addClass("'.$pickType.'");';
echo '$("#'.$tmap.'").html("'.$mapname.'");';
}
}
$mapCon->close();
?>