Skip to content

Commit 27b08d3

Browse files
committed
Add RSVP Support
1 parent 8b91d59 commit 27b08d3

4 files changed

Lines changed: 99 additions & 18 deletions

File tree

actions/raids.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,14 @@
184184
$level = ltrim($key, 'egg_');
185185
$gym_id = ($_POST['gym_id'] != 'ALL') ? $_POST['gym_id'] : NULL;
186186

187-
$stmt = $conn->prepare("INSERT INTO egg ( id, ping, clean, template, distance, team, level, profile_no, gym_id)
188-
VALUES ( ?, ?, ? , ?, ?, 4, ?, ?, ?)");
187+
$stmt = $conn->prepare("INSERT INTO egg ( id, ping, clean, template, distance, team, level, profile_no, gym_id, rsvp_changes)
188+
VALUES ( ?, ?, ?, ?, ?, 4, ?, ?, ?, ?)");
189189
if (false === $stmt) {
190190
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=AE1&sql=$stmt->error");
191191
exit();
192-
}
193-
$rs = $stmt->bind_param("ssisiiis", $_SESSION['id'], $_POST['content'], $clean, $template, $_POST['distance'], $level, $_SESSION['profile'], $gym_id);
192+
}
193+
194+
$rs = $stmt->bind_param("ssisiiisi", $_SESSION['id'], $_POST['content'], $clean, $template, $_POST['distance'], $level, $_SESSION['profile'], $gym_id, $_POST['rsvp']);
194195
if (false === $rs) {
195196
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=AE2&sql=$stmt->error");
196197
exit();
@@ -213,13 +214,13 @@
213214
$level = ltrim($key, 'raid_');
214215
$gym_id = ($_POST['gym_id'] != 'ALL') ? $_POST['gym_id'] : NULL;
215216

216-
$stmt = $conn->prepare("INSERT INTO raid ( id, ping, clean, template, pokemon_id, distance, team, level, form, profile_no, gym_id)
217-
VALUES ( ?, ?, ? , ?, 9000, ?, 4, ?, 0, ?, ?)");
217+
$stmt = $conn->prepare("INSERT INTO raid ( id, ping, clean, template, pokemon_id, distance, team, level, form, profile_no, gym_id, rsvp_changes)
218+
VALUES ( ?, ?, ? , ?, 9000, ?, 4, ?, 0, ?, ?, ?)");
218219
if (false === $stmt) {
219220
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=AR1&sql=$stmt->error");
220221
exit();
221222
}
222-
$rs = $stmt->bind_param("ssisiiis", $_SESSION['id'], $_POST['content'], $clean, $template, $_POST['distance'], $level, $_SESSION['profile'], $gym_id);
223+
$rs = $stmt->bind_param("ssisiiisi", $_SESSION['id'], $_POST['content'], $clean, $template, $_POST['distance'], $level, $_SESSION['profile'], $gym_id, $_POST['rsvp']);
223224
if (false === $rs) {
224225
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=AR2&sql=$stmt->error");
225226
exit();
@@ -245,13 +246,13 @@
245246
if (isset($arr[3])) { $boss_mega = $arr[3];}
246247
$gym_id = ($_POST['gym_id'] != 'ALL') ? $_POST['gym_id'] : NULL;
247248

248-
$stmt = $conn->prepare("INSERT INTO raid ( id, ping, clean, template, pokemon_id, distance, team, level, form, profile_no, gym_id)
249-
VALUES ( ?, '', ? , ?, ? , ?, 4, 9000, ?, ?, ?)");
249+
$stmt = $conn->prepare("INSERT INTO raid ( id, ping, clean, template, pokemon_id, distance, team, level, form, profile_no, gym_id, rsvp_changes)
250+
VALUES ( ?, '', ? , ?, ? , ?, 4, 9000, ?, ?, ?, ?)");
250251
if (false === $stmt) {
251252
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=ARM1&sql=$stmt->error");
252253
exit();
253254
}
254-
$rs = $stmt->bind_param("sisiiiis", $_SESSION['id'], $clean, $template, $boss_id, $_POST['distance'], $boss_form, $_SESSION['profile'], $gym_id);
255+
$rs = $stmt->bind_param("sisiiiisi", $_SESSION['id'], $clean, $template, $boss_id, $_POST['distance'], $boss_form, $_SESSION['profile'], $gym_id, $_POST['rsvp']);
255256
if (false === $rs) {
256257
header("Location: $redirect_url?type=display&page=raid&return=sql_error&phase=ARM2&sql=$stmt->error");
257258
exit();

locales/fr.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,5 +483,9 @@
483483
"Level 3 Shadow":"Obscurs Niveau 3",
484484
"Level 4 Shadow":"Obscurs Niveau 4",
485485
"Shadow Legendary":"Obscurs Légendaires",
486-
"showcase":"Epreuve"
486+
"showcase":"Epreuve",
487+
"Alarm when raid matches":"Alarmes de raid uniquement",
488+
"Alarm when raid matches + RSVP changes": "Alarmes de raid + RSVP",
489+
"Alarm on RSVP changes only": "Alarmes RSVP uniquement",
490+
"RSVP Only": "Uniquement RSVP"
487491
}

pages/add/raid.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@
2323
<?php $default_distance = default_distance('raid'); ?>
2424
<?php include "./include/add_area_distance.php"; ?>
2525

26+
<!-- RSVP¨ Picker -->
27+
<div class="form-row align-items-center">
28+
<div class="col-sm-12 my-1">
29+
30+
<div class="input-group">
31+
<div class="input-group-prepend">
32+
<div class="input-group-text"><?php echo i8ln("RSVP"); ?></div>
33+
</div>
34+
35+
<select class="form-control selectpicker" data-toggle="dropdown" id="rsvp" name="rsvp" data-live-search="true" data-width="100px">
36+
37+
<option value="0" data-tokens="0"><?php echo i8ln("Alarm when raid matches"); ?></option>
38+
<option value="1" data-tokens="1"><?php echo i8ln("Alarm when raid matches + RSVP changes"); ?></option>
39+
<option value="2" data-tokens="2"><?php echo i8ln("Alarm on RSVP changes only"); ?></option>
40+
41+
</select>
42+
</div>
43+
</div>
44+
</div>
45+
2646
<!-- Gym Picker -->
2747
<div class="form-row align-items-center">
2848
<div class="col-sm-12 my-1">

pages/display/raid.php

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ class="btn btn-danger"><?php echo i8ln("DELETE"); ?></a>
148148

149149
if ($row['distance'] <> '0') {
150150
?>
151-
<li
152-
class="list-group-item d-flex justify-content-between align-items-center">
151+
<li class="list-group-item d-flex justify-content-between align-items-center">
153152
<?php echo i8ln("DISTANCE"); ?>
154153
<?php if ( @$distance_map <> "True" ) { ?>
155154
<span
@@ -179,17 +178,41 @@ class="badge badge-primary badge-pill"><?php echo $row['distance']; ?>
179178
</div>
180179
<?php } ?>
181180
<?php }
182-
if ($row['ping'] <> '') {
181+
if ($row['rsvp_changes'] == 1) {
182+
?>
183+
<li class="list-group-item justify-content-between align-items-center">
184+
<?php echo i8ln("Raids + RSVP"); ?><br>
185+
</li>
186+
<?php }
187+
if ($row['ping'] <> '') {
183188
?>
184189
<li
185190
class="list-group-item justify-content-between align-items-center">
186191
<?php echo i8ln("PING"); ?><br>
187192
<div class="bg-secondary text-break text-white p-1 rounded">
188193
<span class="small"><?=$row['ping']?></span>
189194
</div>
190-
</li>
195+
</li>
196+
191197
<?php }
192-
if ($row['clean'] == '1' && $all_raid_cleaned == '0') {
198+
if ($row['rsvp_changes'] == '1') {
199+
?>
200+
<div class="mb-2">
201+
<span
202+
class="badge badge-pill badge-info w-100"><?php echo i8ln("Raids + RSVP"); ?></span>
203+
</div>
204+
205+
<?php }
206+
if ($row['rsvp_changes'] == '2') {
207+
?>
208+
<div class="mb-2">
209+
<span
210+
class="badge badge-pill badge-info w-100"><?php echo i8ln("RSVP Only"); ?></span>
211+
</div>
212+
<?php }
213+
214+
215+
if ($row['clean'] == '1' && $all_raid_cleaned == '0') {
193216
?>
194217
<div class="mb-2">
195218
<span
@@ -349,8 +372,25 @@ class="list-group-item justify-content-between align-items-center">
349372
<div class="bg-secondary text-break text-white p-1 rounded">
350373
<span class="small"><?=$row['ping']?></span>
351374
</div>
352-
</li>
353-
<?php }
375+
</li>
376+
377+
<?php }
378+
if ($row['rsvp_changes'] == '1') {
379+
?>
380+
<div class="mb-2">
381+
<span
382+
class="badge badge-pill badge-info w-100"><?php echo i8ln("Raids + RSVP"); ?></span>
383+
</div>
384+
385+
<?php }
386+
if ($row['rsvp_changes'] == '2') {
387+
?>
388+
<div class="mb-2">
389+
<span
390+
class="badge badge-pill badge-info w-100"><?php echo i8ln("RSVP Only"); ?></span>
391+
</div>
392+
393+
<?php }
354394
if ($row['clean'] == '1' && $all_raid_cleaned == '0') {
355395
?>
356396
<div class="mb-2">
@@ -519,6 +559,22 @@ class="badge badge-primary badge-pill"><?php echo $row['distance']; ?>
519559
</div>
520560
<?php } ?>
521561

562+
<?php }
563+
if ($row['rsvp_changes'] == '1') {
564+
?>
565+
<div class="mb-2">
566+
<span
567+
class="badge badge-pill badge-info w-100"><?php echo i8ln("Raids + RSVP"); ?></span>
568+
</div>
569+
570+
<?php }
571+
if ($row['rsvp_changes'] == '2') {
572+
?>
573+
<div class="mb-2">
574+
<span
575+
class="badge badge-pill badge-info w-100"><?php echo i8ln("RSVP Only"); ?></span>
576+
</div>
577+
522578
<?php
523579
}
524580
if ($row['clean'] == '1' && $all_raid_cleaned == '0') {

0 commit comments

Comments
 (0)