forked from bbdoc/PoracleWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_raids.php
327 lines (276 loc) · 14.3 KB
/
add_raids.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
<?php
include "./header.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, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title><?php echo $title; ?> - Add Raids</title>
<link rel="icon" type="image/x-icon" href="favicon.png" />
<!-- Custom fonts for this template-->
<link href="node_modules/@fortawesome/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/custom-bootstrap.css?v=<?=time();?>" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/css/bootstrap4-toggle.min.css"
rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css?v=<?=time();?>">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[type='checkbox']").change(function() {
var maxAllowed = 100;
var cnt = $("input[type='checkbox']:checked").length;
if (cnt > maxAllowed) {
$(this).prop("checked", "");
alert('Sorry, you cannot select more than ' + maxAllowed + ' Pokemons at a time!');
}
});
});
$(document).ready(function() {
$(window).keydown(function(event) {
if (event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});
</script>
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<nav class="navbar fixed-top navbar-expand navbar-dark topbar mb-4 static-top shadow"
style="background-color: #000000;">
<a class="navbar-brand" href="<?php echo $redirect_url; ?>"><?php echo $title; ?></a>
<!-- Topbar Navbar -->
<ul class="navbar-nav ml-auto">
<!-- Nav Item - User Information -->
<li class="nav-item dropdown no-arrow" id="Dropdown">
<a class="nav-link dropdown-toggle" href="#" data-toggle="modal"
data-target="#profileSettingsModal">
<span
class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo $_SESSION['username']; ?></span>
<img class="img-profile rounded-circle" src="<?php echo $avatar ?>">
</a>
</li>
<div class="topbar-divider d-none d-sm-block"></div>
<!-- Nav Item - Logout -->
<li class="nav-item dropdown no-arrow">
<a class="nav-link dropdown-toggle" href="#" data-toggle="modal" data-target="#logoutModal">
<i class="fas fa-sign-out-alt fa-fw"></i>
</a>
</li>
</ul>
</nav>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid col-lg-8 col-md-12">
<!-- Profile Settings Modal -->
<?php include "./modal/profile_settings_modal.php"; ?>
<!-- Page Heading -->
<div class="row">
<div class="col">
<div class="alert alert-secondary text-center" role="alert">
<strong><?php echo i8ln("NEW RAID ALARM"); ?></strong>
</div>
</div>
</div>
<form action='./form_action.php' method='POST'>
<?php if ($disable_location <> "True") { ?>
<div class="form-row align-items-center">
<div class="col-sm-12 my-1">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text"><?php echo i8ln("Distance"); ?></div>
</div>
<input type="number" id='distance' name='distance' value='0' min='0'
class="form-control text-center">
<div class="input-group-append">
<span class="input-group-text"><?php echo i8ln("meters"); ?></span>
</div>
</div>
</div>
</div>
<?php } else { ?>
<input type="hidden" id='distance' name='distance' value='0' min='0'>
<?php } ?>
<div class="form-row align-items-center">
<div class="col-sm-12 my-1">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<?php
if ($row['clean'] == 0) {
$checked0 = 'checked';
} else {
$checked0 = '';
}
if ($row['clean'] == 1) {
$checked1 = 'checked';
} else {
$checked1 = '';
}
$clean_0_checked = 0;
$clean_1_checked = 0;
if ($all_raid_cleaned == "1") {
$clean_1_checked = 'checked';
} else {
$clean_0_checked = 'checked';
}
?>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text"><?php echo i8ln("Clean"); ?></div>
</div>
</div>
<label class="btn btn-secondary">
<input type="radio" name="clean" id="clean_0" value="clean_0"
<?php echo $clean_0_checked; ?>>
<?php echo i8ln("No"); ?>
</label>
<label class="btn btn-secondary">
<input type="radio" name="clean" id="clean_1" value="clean_1"
<?php echo $clean_1_checked; ?>>
<?php echo i8ln("Yes"); ?>
</label>
</div>
</div>
</div>
<hr>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page"><?php echo i8ln("Select Egg Levels you want to add"); ?>
</li>
</ol>
</nav>
<div class='selectionList'>
<ul>
<?php
$eggs = explode(',', "1,3,5,6");
foreach ($eggs as &$egg) {
?>
<li class='text-center'><input type='checkbox' name='egg_<?php echo $egg; ?>'
id='egg_<?php echo $egg; ?>' />
<label for='egg_<?php echo $egg; ?>'>
<img src='<?php echo $imgUrl; ?>/egg<?php echo $egg; ?>.png' />
<br><?php echo i8ln("Eggs"); ?><br><?php echo i8ln("Level"); ?> <?php echo $egg; ?>
</label>
</li>
<?php
}
?>
</ul>
</div>
<hr>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page"><?php echo i8ln("Select Raid Levels you want to add"); ?>
</li>
</ol>
</nav>
<div class='selectionList'>
<ul>
<?php
$raids = explode(',', "1,3,5,6");
foreach ($raids as &$raid) {
?>
<li class='text-center'><input type='checkbox' name='raid_<?php echo $raid; ?>'
id='raid_<?php echo $raid; ?>' />
<label for='raid_<?php echo $raid; ?>'>
<img src='<?php echo $imgUrl; ?>/egg<?php echo $raid; ?>.png' />
<br><?php echo i8ln("Raids"); ?><br><?php echo i8ln("Level"); ?> <?php echo $raid; ?>
</label>
</li>
<?php
}
?>
</ul>
</div>
<hr>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-current="page"><?php echo i8ln("Select the Raid Bosses you want to add"); ?>
</li>
</ol>
</nav>
<div class='selectionList'>
<ul>
<?php
#$bosses = explode(',', $raid_bosses);
#foreach ($bosses as &$boss) {
$bosses = get_raid_bosses();
foreach ($bosses as $key => $boss) {
$arr = explode("_", $boss);
$boss_id = $arr[0];
$boss_form = $arr[1];
$boss_mega = $arr[2];
if ($boss_mega == 2) {
$mega_name = "Mega X";
} else if ($boss_mega == 3) {
$mega_name = "Mega Y";
} else {
$mega_name = "";
}
$pokemon_name = get_mons($boss_id);
?>
<li class='text-center'><input type='checkbox'
name='mon_<?php echo $boss_id; ?>_<?php echo $boss_form; ?>'
id='mon_<?php echo $boss_id; ?>_<?php echo $boss_form; ?>' />
<label for='mon_<?php echo $boss_id; ?>_<?php echo $boss_form; ?>'>
<?php
$img=$imgUrl."/pokemon_icon_".$boss.".png";
if (false === @file_get_contents("$img", 0, null, 0, 1)) {
$img=$imgUrl."/pokemon_icon_".$boss_id."_00.png";
}
?>
<img src='<?php echo $img; ?>' />
<br>
<?php echo str_pad($boss_id, 3, "0", STR_PAD_LEFT); ?>
<br>
<?php echo $pokemon_name; ?>
<br>
<?php echo $mega_name; ?>
</label>
</li>
<?php
}
?>
</ul>
</div>
<div class="float-right mb-3 mt-3">
<input class="btn btn-primary" type='submit' name='add_raid' value='<?php echo i8ln("Submit"); ?>'>
<a href='<?php echo $redirect_url ?>'>
<button type="button" class="btn btn-secondary"><?php echo i8ln("Cancel"); ?></button>
</a>
</div>
</form>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Logout Modal-->
<?php include "./modal/logout_modal.php"; ?>
<!-- Bootstrap core JavaScript-->
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="node_modules/jquery.easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/scripts.js"></script>
<script src="https://cdn.jsdelivr.net/gh/gitbrent/[email protected]/js/bootstrap4-toggle.min.js"></script>
</body>
</html>