-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.php
332 lines (309 loc) · 9.99 KB
/
main.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
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
include 'template/connection.php';
if(!isset($_SESSION['USERNAME']) || !isset($_SESSION['TEAM']) || !isset($_SESSION['GAMEID'])){
header('location:multiplayer.php');
}else{
$_SESSION['SYSTEMS'] = array();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimal-ui" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Iceland|Orbitron" rel="stylesheet">
<link href="css/secgen.css" rel="stylesheet" type="text/css">
<link href="css/map.css" rel="stylesheet" type="text/css">
<script>
sessionStorage.clear();
var user = '<?php echo $_SESSION['USERID'];?>';
var tm1 = '<?php echo $_SESSION['TEAM'];?>';
</script>
<script src="js/dialog.js"></script>
<script src="js/jquery_form.js"></script>
<style>
.modal-content{
width:30%;
height:auto;
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button {
width: 0px;
height: 0px;
}
::-webkit-scrollbar-thumb {
background: #ceb342;
border: 0px none #ffffff;
border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover {
background: #faf434;
}
::-webkit-scrollbar-thumb:active {
background: #000000;
}
::-webkit-scrollbar-track {
background: #abd17d;
border: 0px none #ffffff;
border-radius: 90px;
}
::-webkit-scrollbar-track:hover {
background: #41a428;
}
::-webkit-scrollbar-track:active {
background: #ffff00;
}
::-webkit-scrollbar-corner {
background: transparent;
}
.hintok{
color:green;
}
.hintclose{
color:red;
}
</style>
</head>
<body id="main" style="background:url('images/bgadmin.png');">
<div id="wrapper">
<!-- Left Panel--->
<div class="floating_panel left_panel">
<h1>Submit Flags</h1>
<input type="text" id="flag-check" placeholder="Enter Flag and Press Enter" />
<script src="js/loginpopup.js"></script>
<div class="status">
<marquee><p id="flag-status-p"> </p></marquee>
</div>
</div>
<!-- Right Panel-->
<div class="floating_panel right_panel" id="right_panel">
<?php include 'template/announce.php';?>
</div>
<div class="dropdown">
<button class="dropbtn">View Teams</button>
<div class="dropdown-content">
<?php
include 'template/connection.php';
require 'class/Validator.php';
$c = new Creditional();
$center_panel_result = mysqli_query($connection, "SELECT * FROM team WHERE GAME_ID='".$c->getGameId()."'");
while($center_row = mysqli_fetch_assoc($center_panel_result)){
$team = $center_row['TEAMNAME'];
$teamno = $center_row['TEAM'];
if(isset($_SESSION['TEAM'])){
$sess_team = $_SESSION['TEAM'];
if($teamno == $sess_team){
echo "<a class='my_team view_team_list' href='main.php?team=$sess_team'><span class='team_logo'><img class='team_logo' src='images/flag.svg'/></span>$team</a>";
}else{
echo "<a class='other_team view_team_list' href='main.php?team=$teamno'><span class='team_logo'><img class='team_logo' src='images/flag.svg'/></span>$team</a>";
}
}else{
}
}
?>
</div>
</div>
<div class="systems">
<?php
include 'template/connection.php';
if(isset($_GET['team'])){
$getTeam= preg_replace('[^0-9]', '', urldecode(stripslashes(htmlspecialchars(htmlentities(trim($_GET['team']))))));
$initTeamResult = mysqli_query($connection, "SELECT DISTINCT TEAM FROM ".$c->getGameId()."_secgenflag WHERE TEAM='".$getTeam."'");
if(mysqli_num_rows($initTeamResult) != 0){
if(mysqli_num_rows($initTeamResult) == 1){
$initTeam = $getTeam;
}else{
header('location:main.php?team='.$_SESSION['TEAM']);
}
}else{
//header('location:html/initialise.php');
}
}else{
header('location:main.php?team='.$_SESSION['TEAM']);
}
$ssql = "SELECT DISTINCT VM, IP FROM ".$c->getGameId()."_secgenflag WHERE TEAM='$initTeam'";
$sresult = mysqli_query($connection, $ssql);
$ii = 0;
while($srow = mysqli_fetch_assoc($sresult)){
$vm = $srow['VM'];
$ip = $srow['IP'];
$ii+=1;
$_SESSION['SYSTEMS'][] = $vm;
?>
<div class="grouper">
<div class="grouper_heading">
<p class="vm"><?php echo $vm; ?></p>
<p class="ip"><?php echo $ip; ?></p>
( <input value="VM Options" type="submit" onclick="Vm.menu('<?php echo $vm;?>');"/> )
</div>
<div class="grouper_map" id="<?php echo "grouperId".$ii; ?>">
<?php
include 'template/connection.php';
$sChooseMapCountSql = "SELECT FLAG_POINTS FROM ".$c->getGameId()."_secgenflag WHERE VM='$vm' AND TEAM='$initTeam'";
$sChooseMapCountResult = mysqli_query($connection, $sChooseMapCountSql);
$sChooseMapCount = mysqli_num_rows($sChooseMapCountResult);
if($sChooseMapCount <= 16){
$sSelectMapDistinct = "SELECT DISTINCT W, H, X, Y FROM secgen WHERE C_NO='$sChooseMapCount'";
$sSelectMapDistinctResult = mysqli_query($connection, $sSelectMapDistinct);
while($sSelectMRow = mysqli_fetch_assoc($sSelectMapDistinctResult)){
$x = $sSelectMRow['X'];
$y = $sSelectMRow['Y'];
$w = $sSelectMRow['W'];
$h = $sSelectMRow['H'];
?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.2" viewBox="<?php echo $x." ".$y." ".$w." ".$h?>">
<g>
<?php
$sSelectMapSql = "SELECT * FROM secgen WHERE C_NO='$sChooseMapCount'";
$sSelectMapResult = mysqli_query($connection, $sSelectMapSql);
while($sChooseRow = mysqli_fetch_assoc($sSelectMapResult)){
$sC_ID = $sChooseRow['C_ID'];
$sC_COUNTRY= $sChooseRow['C_COUNTRY'];
$sC_TITLE = $sChooseRow['C_TITLE'];
$sC_D = $sChooseRow['C_D'];
$secgenQuery = mysqli_query($connection, "SELECT STATUS FROM ".$c->getGameId()."_secgenflag WHERE C_ID='$sC_ID' AND TEAM='$initTeam' AND VM='$vm'");
while($secgenStatusRow = mysqli_fetch_assoc($secgenQuery)){
$secgenStatus = $secgenStatusRow['STATUS'];
$session_team = $_SESSION['TEAM'];
if($secgenStatus == 0){
if($session_team == $initTeam){
echo "<path id='$sC_ID' title='$sC_COUNTRY' d='$sC_D' onclick='Alert.menu(\"$sC_ID\",\"$vm\",\"$session_team\");'/>";
}else{
echo "<path id='$sC_ID' title='$sC_COUNTRY' d='$sC_D'/>";
}
}else{
echo "<path fill='#abd17d' id='$sC_ID' title='$sC_COUNTRY' d='$sC_D'/>";
}
}
}
?>
</g>
</svg>
<?php
}
mysqli_close($connection);
}else{
echo "<p class='map_init' id='tssst'>Map Not Initialised (Exceeded Map Limit - Contact Admin)</p>";
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<!--Dialog Code -->
<!-- Left Menu -->
<div id="info_menu" onclick="openNav()">
<span style="font-size:30px;cursor:pointer" onclick="openNav()">☰</span>
</div>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<?php
if(isset($_SESSION['USERNAME']) && isset($_SESSION['TEAM']))
{
?>
<a href="dashboard.php" id="main_logout">Dashboard</a>
<div class="scores side_item">
<div class="side_heading">
<h1>Score Board</h1>
</div>
<span id="div1_inner_body_1"><?php include 'template/userscoreboard.php'; ?></span>
<span id="div1_inner_body_2"><?php include 'template/teamscoreboard.php'; ?></span>
</div>
<div class="logs side_item">
<div class="side_heading">
<h1>Team Activity</h1>
</div>
<div class="team_logs" id="team_logs_scroll">
<div id="div2_inner">
<div id="div2_inner_border">
<?php include 'template/viewlog.php'; ?>
</div>
</div>
</div>
</div>
<div class="chat side_item">
<div class="side_heading">
<h1>Team Chat</h1>
</div>
<div class="chat_history" id="chat_history_scroll">
<div id="div3_inner">
<div id="div3_inner_chat_history">
<?php include 'template/viewchat.php'; ?>
</div>
</div>
</div>
<div class="chat_input">
<input id="div3_chat_input" type="text" placeholder="Enter Message and Press Enter" />
</div>
</div>
<?php
}
?>
</div>
<div id="noooo"></div>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h3 id="dialog-id" class="modal_info"></h3>
<h3 id="dialog-title" class="modal_info"></h3>
</div>
<div class="modal-body">
<div id="moBody">
<h3 class="hintclose">Please wait...</h3>
</div>
<div id="dialog_flag_button">
<button type="fsubmit" id="fsubmit">Get Hint</button>
</div></br>
<div id="moBodyLocked">
</div>
</div>
<div class="modal-footer">
<h3 id="flag_hint">--</h3>
</div>
</div>
</div>
<div id="QModal" class="Qmodal">
<!-- Modal content -->
<div class="Qmodal-content">
<div class="Qmodal-header">
<span class="Qclose">×</span>
<h2 id="vmheader"></h2>
</div>
<div class="Qmodal-body">
<table>
<tr class="tbicon">
<td id="t-run"></td>
<td id="t-start"></td>
<td id="t-stop"></td>
</tr>
</table>
</div>
<div class="Qmodal-footer">
<h4 id="Qmodal-status">Status</h4>
</div>
</div>
</div>
<script src="js/dialog.js"></script>
<script src="js/main_js.js"></script>
<script src="js/main.js"></script>
<script src="noti/notify.js"></script>
<script src="noti/notify.min.js"></script>
</body>
</html>