forked from bbdoc/PoracleWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
1797 lines (1651 loc) · 114 KB
/
index.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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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; ?></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();?>">
</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">
<?php include "topbar.php" ?>
<!-- Begin Page Content -->
<div class="container-fluid col-lg-8 col-md-12">
<?php echo @$admin_alarm; ?>
<!-- Profile Settings Modal -->
<?php include "./modal/profile_settings_modal.php"; ?>
<!-- Success Alerts-->
<?php
if (isset($_GET['return']) && $_GET['return'] == 'success_added_mons') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Added Monster Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_mons') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Updated Monster Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_delete_mons') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Deleted Monster Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_added_raids') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Added Raids Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_raid') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Updated Raid Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_delete_raid') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Deleted Raid Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_delete_raids') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Deleted Eggs & Raids Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_egg') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Updated Egg Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_delete_egg') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Deleted Egg Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_added_quest') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Added Quest Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_quest') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Updated Quest Alarm"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_delete_quest') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Deleted Quest Alarm(s)"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_areas') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Updated List of Areas"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_settings') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Settings updated successfully"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_location') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Location updated successfully"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_mons_distance') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Update Distance on ALL Pokémons"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_raids_distance') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Update Distance on ALL Raids & Eggs"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'success_update_quests_distance') {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?php echo i8ln("Successfully Update Distance on ALL Quests"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'error_update_location') {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<?php echo i8ln("Address not found. Try Again"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'user_not_found') {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<?php echo i8ln("User not found. Try Again"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if ($enabled==0) {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<?php echo i8ln("Your alarms are currently disabled!"); ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
if (isset($_GET['return']) && $_GET['return'] == 'sql_error') {
echo "<div class='alert alert-danger alert-dismissible fade show' role='alert'>";
echo i8ln("You Request couldn't not be handled");
echo i8ln("Error"). " #" . $_GET['phase'];
if ($debug == 'True') {
echo "<br><br>" . $_GET['sql'];
}
?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<?php
}
?>
<!-- Content Row -->
<div class="row">
<!-- Card -->
<?php if (@$disable_areas."-".@$disable_location <> "True-True" ) { ?>
<div class="col-xl-12 col-md-12">
<!-- Areas & Locations -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="row d-flex justify-content-between align-items-center pl-3 pr-3">
<?php if (@$disable_areas <> "True") { ?>
<h6 class="m-0 font-weight-bold text-dark"><?php echo i8ln("AREAS"); ?>
<!-- Button trigger modal -->
<div style="text-align:left; margin-top:5px;">
<button type="button" class="btn btn-success btn-circle btn-md" data-toggle="modal"
data-target="#areasModal">
<i class="fas fa-edit"></i>
</button>
</div>
</h6>
<?php } ?>
<?php if (@$disable_location <> "True") { ?>
<h6 class="m-0 font-weight-bold text-dark"><?php echo i8ln("LOCATION"); ?>
<!-- Button trigger modal -->
<?php
if( isset($_SERVER['HTTPS'] ) ) { $site_is_https = "True"; }
if( isset($site_is_https) && $site_is_https == "True") {
?>
<div style="text-align:right; margin-top:5px;">
<button type="button" class="btn btn-success btn-circle btn-md"
onclick="getLocation()">
<i class="fas fa-map-marker-alt"></i>
</button>
<?php } ?>
<?php if (@$disable_nominatim <> "True") { ?>
<button type="button" class="btn btn-success btn-circle btn-md"
data-toggle="modal" data-target="#locationModal">
<i class="fas fa-edit"></i>
</button>
</div>
<?php } ?>
</h6>
<?php } ?>
</div>
</div>
<div class="card-body">
<?php if (@$disable_areas <> "True") { ?>
<div class="row no-gutters align-items-center">
<div class="col">
<div class="row">
<?php
if ($area == "[]") {
?>
<div class="alert alert-warning w-100 m-3" role="alert">
<?php echo i8ln("You have not set any area yet!"); ?>
</div>
<?php
$areas = "";
} else {
$areas = explode(",", $area);
foreach ($areas as $key => $area) {
$area = str_replace('"', '', $area);
$area = str_replace('[', '', $area);
$area = str_replace(']', '', $area);
?>
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 text-center">
<div class="card bg-dark text-white shadow">
<div class="card-body-areas">
<?php echo strtoupper($area); ?>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<?php } ?>
<?php if (@$disable_location <> "True") { ?>
<div class="row no-gutters align-items-center">
<div class="col">
<div class="row">
<div id="position_error_div" style="display:none;"
class="text-center w-100 m-3">
<div id="PERMISSION_DENIED" style="display:none;"
class="alert alert-danger" role="alert">
<b><?php echo i8ln("Could not set Location"); ?></b>.<br>
<?php echo i8ln("User denied the request for Geolocation"); ?>.
</div>
<div id="POSITION_UNAVAILABLE" style="display:none;"
class="alert alert-danger" role="alert">
<b><?php echo i8ln("Could not set Location"); ?></b>.<br>
<?php echo i8ln("Location information is unavailable"); ?>.
</div>
<div id="TIMEOUT" style="display:none;" class="alert alert-danger"
role="alert">
<b><?php echo i8ln("Could not set Location"); ?></b>.<br>
<?php echo i8ln("The request to get user location timed out"); ?>.
</div>
<div id="UNKNOWN_ERROR" style="display:none;" class="alert alert-danger"
role="alert">
<b><?php echo i8ln("Could not set Location"); ?></b>.<br>
<?php echo i8ln("An unknown error occurred"); ?>.
</div>
<div id="NOT_SUPPORTED" style="display:none;" class="alert alert-danger"
role="alert">
<b><?php echo i8ln("Could not set Location"); ?></b>.<br>
<?php echo i8ln("Geolocation is not supported by this browser"); ?>.
</div>
</div>
<?php
if ($latitude == "0.0000000000" && $longitude == "0.0000000000") {
?>
<div class="alert alert-warning w-100 m-3" role="alert">
<?php echo i8ln("Your location is not set. Distance settings won't be taken into account."); ?>
</div>
<?php
} else {
?>
<div class="alert alert-success w-100 m-3" role="alert">
<?php echo i8ln("Your Location is set to"); ?><br>
<?php
if (@$disable_nominatim <> "True") {
$address=get_address($latitude, $longitude);
echo "<b>".$address."</b><br>";
}
?>
<?php echo "[ ".round($latitude, 4); ?>,
<?php echo round($longitude, 4)." ]"; ?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
<!-- EDIT AREAS Modal -->
<div class="modal fade" id="areasModal" tabindex="-1" role="dialog"
aria-labelledby="areasModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<?php include "./modal/areas_modal.php"; ?>
</div>
</div>
</div>
</div>
<!-- EDIT LOCATION Modal -->
<div class="modal fade" id="locationModal" tabindex="-1" role="dialog"
aria-labelledby="locationModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<?php include "./modal/location_modal.php"; ?>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<hr>
<ul class="nav nav-pills mb-3 mx-auto justify-content-center" id="pills-tab-home" role="tablist">
<?php if (@$disable_mons <> "True") { ?>
<li class="nav-item">
<a class="nav-link active" id="pills-mons-tab" data-toggle="pill" href="#pills-mons" role="tab"
aria-controls="pills-mons" aria-selected="true"><?php echo i8ln("POKÉMONS"); ?></a>
</li>
<?php
}
?>
<?php if (@$disable_raids <> "True") { ?>
<li class="nav-item">
<a class="nav-link" id="pills-raids-tab" data-toggle="pill" href="#pills-raids" role="tab"
aria-controls="pills-raids" aria-selected="false"><?php echo i8ln("RAIDS"); ?></a>
</li>
<?php
}
?>
<?php if (@$disable_quests <> "True") { ?>
<li class="nav-item">
<a class="nav-link" id="pills-quests-tab" data-toggle="pill" href="#pills-quests" role="tab"
aria-controls="pills-quests" aria-selected="false"><?php echo i8ln("QUESTS"); ?></a>
</li>
<?php
}
?>
</ul>
<div class="tab-content mb-5" id="pills-tab-homeContent">
<?php if (@$disable_mons <> "True") { ?>
<div class="tab-pane fade show active" id="pills-mons" role="tabpanel"
aria-labelledby="pills-mons-tab">
<hr>
<!-- Page Heading -->
<div class="text-center">
<div class="breadcrumb justify-content-center">
<h1 class="h3 mb-0 text-gray-800 "><?php echo i8ln("POKÉMONS TRACKED"); ?></h1>
</div>
</div>
<div class="row">
<?php
if ($all_mon_cleaned == '1') {
?>
<div class="col">
<div class="alert alert-info alert-dismissible fade show" role="alert">
<?php echo i8ln("Cleaning activated on"); ?>
<strong><?php echo i8ln("ALL Monsters"); ?></strong>!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
<?php
}
?>
</div>
<div class="row">
<div class="row no-gutters align-items-center p-3">
<a href="./add_mons.php" class="btn btn-success btn-icon-split mr-2 mt-1">
<span class="icon text-white-50">
<i class="fas fa-plus"></i>
</span>
<span class="text"><?php echo i8ln("ADD"); ?></span>
</a>
<a href="#" class="btn btn-danger btn-icon-split mr-2 mt-1" data-toggle="modal"
data-target="#deleteAllMonsModal">
<span class="icon text-white-50">
<i class="fas fa-trash"></i>
</span>
<span class="text"><?php echo i8ln("DELETE ALL"); ?></span>
</a>
<a href="#" class="btn btn-primary btn-icon-split mr-2 mt-1" data-toggle="modal"
data-target="#DistanceMonsModal">
<span class="icon text-white-50">
<i class="fas fa-crosshairs"></i>
</span>
<span class="text"><?php echo i8ln("UPDATE DISTANCE"); ?></span>
</a>
</div>
</div>
<!-- DELETE ALL MONS Modal -->
<div class="modal fade" id="deleteAllMonsModal" tabindex="-1" role="dialog"
aria-labelledby="deleteAllMonsModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteAllMonsModalTitle">
<?php echo i8ln("Delete ALL tracked Mons?"); ?>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<?php echo i8ln("This will delete all your Pokémon Alarms and cannot be undone, are you sure ?"); ?>
</div>
<div class="modal-footer">
<a href="./form_action.php?action=delete_all_mons"
class="btn btn-danger"><?php echo i8ln("DELETE"); ?></a>
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo i8ln("CANCEL"); ?></button>
</div>
</div>
</div>
</div>
<!-- UPDATE MONS DISTANCE MODAL -->
<div class="modal fade" id="DistanceMonsModal" tabindex="-1" role="dialog"
aria-labelledby="DistanceMonsModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<?php include "./modal/distance_pokemons_modal.php"; ?>
</div>
</div>
</div>
<!-- GEN SELECTOR -->
<?php
if (!isset($_GET['gen1']) && !isset($_GET['gen2']) && !isset($_GET['gen3'])
&& !isset($_GET['gen4']) && !isset($_GET['gen5']) && !isset($_GET['gen6']) )
{
$_GET['allgen'] = "active";
// If Tracking More than 50 pokemons, show only ALL
$sql = "select * FROM monsters WHERE id = '" . $_SESSION['id'] . "'";
$result = $conn->query($sql);
if ( $result->num_rows > 50 ) { $gen_selector = "AND pokemon_id = 0";; }
}
if ( @$_GET['gen1'] == "active" ) { $gen_selector = "AND pokemon_id between 1 and 151"; }
if ( @$_GET['gen2'] == "active" ) { $gen_selector = "AND pokemon_id between 152 and 251"; }
if ( @$_GET['gen3'] == "active" ) { $gen_selector = "AND pokemon_id between 252 and 386"; }
if ( @$_GET['gen4'] == "active" ) { $gen_selector = "AND pokemon_id between 387 and 493"; }
if ( @$_GET['gen5'] == "active" ) { $gen_selector = "AND pokemon_id between 494 and 649"; }
if ( @$_GET['gen6'] == "active" ) { $gen_selector = "AND pokemon_id >= 650"; }
?>
<nav aria-label="Gen Selector">
<ul class="pagination justify-content-left ml-1">
<li class="page-item <?php echo @$_GET['allgen']; ?>"><a class="page-link" href="?allgen=active">
<center><?php echo i8ln("ALL"); ?></center></a></li>
<li class="page-item <?php echo @$_GET['gen1']; ?>"><a class="page-link" href="?gen1=active"><center>G1</center></a></li>
<li class="page-item <?php echo @$_GET['gen2']; ?>"><a class="page-link" href="?gen2=active"><center>G2</center></a></li>
<li class="page-item <?php echo @$_GET['gen3']; ?>"><a class="page-link" href="?gen3=active"><center>G3</center></a></li>
<li class="page-item <?php echo @$_GET['gen4']; ?>"><a class="page-link" href="?gen4=active"><center>G4</center></a></li>
<li class="page-item <?php echo @$_GET['gen5']; ?>"><a class="page-link" href="?gen5=active"><center>G5</center></a></li>
<li class="page-item <?php echo @$_GET['gen6']; ?>"><a class="page-link" href="?gen6=active"><center>G6</center></a></li>
</ul>
</nav>
<!-- Content Row -->
<div class="row">
<?php
// Check if User is already tracking something
$sql = "select count(*) count FROM monsters WHERE id = '" . $_SESSION['id'] . "'";
$result = $conn->query($sql);
while ($row = $result->fetch_assoc()) {
$num_mon_tracked = $row['count'];
}
// Show Monsters Alarms
$sql = "select * FROM monsters WHERE id = '" . $_SESSION['id'] . "' " . @$gen_selector ." ORDER BY pokemon_id, form";
$result = $conn->query($sql);
if ($num_mon_tracked == 0) {
echo "<div class='alert alert-warning w-100 m-3' role='alert'>";
echo i8ln("You have not set any Alarm yet!");
echo "</div>";
} else if ($result->num_rows == 0 && isset($_GET['allgen']))
{
echo "<div class='alert alert-warning w-100 m-3' role='alert'>";
echo i8ln("You have not set any Alarm for ALL Pokemons, Please select a Gen!");
echo "</div>";
} else if ($result->num_rows == 0) {
echo "<div class='alert alert-warning w-100 m-3' role='alert'>";
echo i8ln("You have not set any Alarms for this Generation!");
echo "</div>";
}
while ($row = $result->fetch_assoc()) {
// Build a Unique Index
$pkm_unique_id = "mon_" . $row['pokemon_id'] . "_" .
$row['form'] . "_" . $row['distance'] . "_" . $row['gender'] .
$row['min_cp'] . "_" . $row['max_cp'] . "_" .
$row['min_iv'] . "_" . $row['max_iv'] . "_" .
$row['min_level'] . "_" . $row['max_level'] . "_" .
$row['min_weight'] . "_" . $row['max_weight'] . "_" .
$row['atk'] . "_" . $row['def'] . "_" . $row['sta'] . "_" .
$row['max_atk'] . "_" . $row['max_def'] . "_" . $row['max_sta'] . "_" .
$row['great_league_ranking'] . "_" . $row['great_league_ranking_min_cp'] . "_" .
$row['ultra_league_ranking'] . "_" . $row['ultra_league_ranking_min_cp'];
// Check Images only if Form <> Normal and Substitude if necessary
$PkmnImg = "$imgUrl/pokemon_icon_" . str_pad($row['pokemon_id'], 3, "0", STR_PAD_LEFT) . "_" . str_pad($row['form'], 2, "0", STR_PAD_LEFT) . ".png";
if ($row['form'] <> 0) {
if (false === @file_get_contents("$PkmnImg", 0, null, 0, 1)) {
$PkmnImg_50 = "<font style='font-size:42px;'><strong>" . str_pad($row['pokemon_id'], 3, "0", STR_PAD_LEFT) . "</strong></font>";
$PkmnImg_100 = "<font size=8><strong>" . str_pad($row['pokemon_id'], 3, "0", STR_PAD_LEFT) . "</strong></font>";
} else {
$PkmnImg_50 = "<img loading=lazy width=50 src='$PkmnImg'>";
$PkmnImg_100 = "<img loading=lazy width=100 src='$PkmnImg'>";
}
} else {
$PkmnImg_50 = "<img loading=lazy width=50 src='$PkmnImg'>";
$PkmnImg_100 = "<img loading=lazy width=100 src='$PkmnImg'>";
}
?>
<!-- Card -->
<div class="col-xl-3 col-sm-4 col-6 mb-3 cardlist">
<div class="card border-top-dark shadow h-100 py-2">
<div class="card-body d-flex flex-column justify-content-between">
<div class="row no-gutters align-items-center">
<div class="col">
<?php
if ($row['pokemon_id'] == '0') {
?>
<div class="h5 mb-0 mt-2 font-weight-bold text-gray-800 text-center"
style="height: 65px;">
<font style='font-size:32px;'><?php echo i8ln("ALL"); ?></font>
</div>
<?php
} else {
?>
<div class="h5 mb-0 font-weight-bold text-gray-800 text-center">
<?php echo $PkmnImg_50; ?></div>
<?php $pokemon_name=get_mons($row['pokemon_id']); ?>
<?php
$form_name = get_form_name($row['pokemon_id'], $row['form']);
?>
<div>
<span
class="badge badge-primary badge-pill w-100"><?php echo $pokemon_name." ".$form_name; ?></span>
</div>
<?php
}
?>
<ul class="list-group mt-2">
<?php
if ($row['distance'] <> '0') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("DISTANCE"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['distance']; ?></span>
</li>
<?php
}
if ($row['min_iv'] <> '-1' || $row['max_iv'] <> '100') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("IV"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['min_iv']; ?>
-
<?php echo $row['max_iv']; ?></span>
</li>
<?php
} else {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("IV"); ?>
<span
class="badge badge-primary badge-pill"><?php echo i8ln("ALL"); ?></span>
</li>
<?php
}
if ($row['min_cp'] <> '0' || $row['max_cp'] <> '9000') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("CP"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['min_cp']; ?>
-
<?php echo $row['max_cp']; ?></span>
</li>
<?php
}
if ($row['min_level'] <> '0' || $row['max_level'] <> '40') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("LEVEL"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['min_level']; ?>
- <?php echo $row['max_level']; ?></span>
</li>
<?php
}
if ($row['atk'] <> '0' || $row['def'] <> '0' || $row['sta'] <> '0' || $row['max_atk'] <> '15' || $row['max_def'] <> '15' || $row['max_sta'] <> '15') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("STATS"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['atk'] . "/" . $row['def'] . "/" . $row['sta']; ?>
-
<?php echo $row['max_atk'] . "/" . $row['max_def'] . "/" . $row['max_sta']; ?></span>
</li>
<?php
}
if ($row['great_league_ranking'] <> '4096' || $row['great_league_ranking_min_cp'] <> '0') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("GREAT"); ?>
<span
class="badge badge-primary badge-pill">top<?php echo $row['great_league_ranking']; ?>
@<?php echo $row['great_league_ranking_min_cp']; ?></span>
</li>
<?php
}
if ($row['ultra_league_ranking'] <> '4096') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("ULTRA"); ?>
<span
class="badge badge-primary badge-pill">top<?php echo $row['ultra_league_ranking']; ?>
@<?php echo $row['ultra_league_ranking_min_cp']; ?></span>
</li>
<?php
}
if ($row['min_weight'] <> '0' || $row['max_weight'] <> '9000000') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("WEIGHT"); ?>
<span
class="badge badge-primary badge-pill"><?php echo $row['min_weight']; ?>
- <?php
if ($row['max_weight'] == '9000000') {
echo "MAX";
} else {
echo $row['max_weight'];
}
?>
</span>
</li>
<?php
}
?>
<?php
if ($row['gender'] <> '0') {
?>
<li
class="list-group-item d-flex justify-content-between align-items-center">
<?php echo i8ln("GENDER"); ?>
<span class="badge badge-primary badge-pill">
<?php
if ($row['gender'] == '1') { echo i8ln("Male"); }
if ($row['gender'] == '2') { echo i8ln("Female"); }
?>
</span>
</li>
<?php } ?>
</ul>
<?php
if ($row['clean'] == '1' && $all_mon_cleaned == '0') {
?>
<div class="mt-1">
<span
class="badge badge-pill badge-info w-100"><?php echo i8ln("Cleaning Activated"); ?></span>
</div>
<?php
}
?>
</div>
</div>
<div class="row d-flex justify-content-center mt-2">
<div class="row">
<a href="#" class="btn btn-danger btn-circle btn-md m-1"
data-toggle="modal"
data-target="#<?php echo $pkm_unique_id ?>DeleteModal">
<i class="fas fa-trash"></i>
</a>
<a href="#" class="btn btn-success btn-circle btn-md m-1"
data-toggle="modal"
data-target="#<?php echo $pkm_unique_id ?>Modal">
<i class="fas fa-edit"></i>
</a>
</div>
</div>
</div>
</div>
</div>
<!-- EDIT MONSTER Modal -->
<div class="modal fade" id="<?php echo $pkm_unique_id ?>Modal" tabindex="-1" role="dialog"
aria-labelledby="<?php echo $pkm_unique_id ?>ModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<?php include "./modal/pokemons_modal.php"; ?>
</div>
</div>
</div>
<!-- DELETE MONSTER Modal -->
<?php $form=get_form_name($row['pokemon_id'],$row['form']); ?>
<div class="modal fade" id="<?php echo $pkm_unique_id ?>DeleteModal" tabindex="-1"
role="dialog" aria-labelledby="<?php echo $pkm_unique_id ?>DeleteModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="<?php echo $pkm_unique_id ?>DeleteModalTitle">
<?php echo i8ln("Delete tracking for"); ?>
<?php echo get_mons($row['pokemon_id'])." ".$form; ?>
<?php if ( $row['pokemon_id'] == 0 ) { echo i8ln("ALL"); } ?> ?
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<?php echo i8ln("This will delete tracking for"); ?>
<?php echo get_mons($row['pokemon_id'])." ".$form; ?>
<?php if ( $row['pokemon_id'] == 0 ) { echo i8ln("ALL"); } ?>.<br>
<?php echo i8ln("Are you sure?"); ?>
</div>
<div class="modal-footer">
<form action='./form_action.php' method='POST'>
<?php echo "
<input type='hidden' id='type' name='type' value='monsters'>
<input type='hidden' id='pokemon_id' name='pokemon_id' value='" . $row['pokemon_id'] . "'>
<input type='hidden' id='cur_form' name='cur_form' value='" . $row['form'] . "'>
<input type='hidden' id='cur_distance' name='cur_distance' value='" . $row['distance'] . "'>
<input type='hidden' id='cur_min_iv' name='cur_min_iv' value='" . $row['min_iv'] . "'>
<input type='hidden' id='cur_max_iv' name='cur_max_iv' value='" . $row['max_iv'] . "'>
<input type='hidden' id='cur_min_cp' name='cur_min_cp' value='" . $row['min_cp'] . "'>
<input type='hidden' id='cur_max_cp' name='cur_max_cp' value='" . $row['max_cp'] . "'>
<input type='hidden' id='cur_min_level' name='cur_min_level' value='" . $row['min_level'] . "'>
<input type='hidden' id='cur_max_level' name='cur_max_level' value='" . $row['max_level'] . "'>
<input type='hidden' id='cur_min_weight' name='cur_min_weight' value='" . $row['min_weight'] . "'>
<input type='hidden' id='cur_max_weight' name='cur_max_weight' value='" . $row['max_weight'] . "'>
<input type='hidden' id='cur_gender' name='cur_gender' value='" . $row['gender'] . "'>
<input type='hidden' id='cur_atk' name='cur_atk' value='" . $row['atk'] . "'>
<input type='hidden' id='cur_def' name='cur_def' value='" . $row['def'] . "'>
<input type='hidden' id='cur_sta' name='cur_sta' value='" . $row['sta'] . "'>
<input type='hidden' id='cur_max_atk' name='cur_max_atk' value='" . $row['max_atk'] . "'>
<input type='hidden' id='cur_max_def' name='cur_max_def' value='" . $row['max_def'] . "'>
<input type='hidden' id='cur_max_sta' name='cur_max_sta' value='" . $row['max_sta'] . "'>
<input type='hidden' id='cur_great_league_ranking' name='cur_great_league_ranking' value='" . $row['great_league_ranking'] . "'>
<input type='hidden' id='cur_great_league_ranking_min_cp' name='cur_great_league_ranking_min_cp' value='" . $row['great_league_ranking_min_cp'] . "'>
<input type='hidden' id='cur_ultra_league_ranking' name='cur_ultra_league_ranking' value='" . $row['ultra_league_ranking'] . "'>
<input type='hidden' id='cur_ultra_league_ranking_min_cp' name='cur_ultra_league_ranking_min_cp' value='" . $row['ultra_league_ranking_min_cp'] . "'>
" ?>
<input class="btn btn-danger" type='submit' name='delete'
value='<?php echo i8ln("DELETE"); ?>'>
</form>
<button type="button" class="btn btn-secondary"
data-dismiss="modal"><?php echo i8ln("CANCEL"); ?></button>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<!-- Content Row -->
</div>
<?php
} // End of Mons Disable
?>
<?php if (@$disable_raids <> "True") { ?>
<div class="tab-pane fade" id="pills-raids" role="tabpanel" aria-labelledby="pills-raids-tab">
<hr>
<!-- Page Heading -->
<div class="text-center">
<div class="breadcrumb justify-content-center">
<h1 class="h3 mb-0 text-gray-800 "><?php echo i8ln("EGGS & RAIDS TRACKED"); ?></h1>
</div>
</div>
<div class="row">
<?php
if ($all_raid_cleaned == '1') {
?>
<div class="col">
<div class="alert alert-info alert-dismissible fade show" role="alert">
<?php echo i8ln("Cleaning activated on"); ?>
<strong><?php echo i8ln("ALL Raids/Eggs"); ?></strong>!
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
<?php
}
?>
</div>
<div class="row">
<div class="row no-gutters align-items-center p-3">
<a href="./add_raids.php" class="btn btn-success btn-icon-split mr-2 mt-1">
<span class="icon text-white-50">
<i class="fas fa-plus"></i>
</span>
<span class="text"><?php echo i8ln("ADD"); ?></span>
</a>
<a href="#" class="btn btn-danger btn-icon-split mr-2 mt-1" data-toggle="modal"
data-target="#deleteAllRaidEggsModal">