-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
2390 lines (2176 loc) · 103 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
session_start();
ini_set('memory_limit', '-1');
include "functions/chat_functions.php";
// Check if the user is not logged in, then redirect to login page
if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) {
header("Location: login.php");
exit();
}
// Logout functionality
if (isset($_POST["logout"])) {
// Open a connection to the database
$con = mysqli_connect("localhost", "root", "", "webdev");
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
// Prepare the DELETE statement
$stmt = $con->prepare("DELETE FROM online_users WHERE username = ?");
$stmt->bind_param("s", $_SESSION['username']);
$stmt->execute();
$stmt->close();
// Close the connection
mysqli_close($con);
// Destroy the session and redirect to login page
session_destroy();
header("Location: login.php");
exit();
}
if (isset($_POST["refresh"])) {
// Simply return the current count without incrementing or decrementing
echo $count;
exit(); // Exit to prevent further execution of the script
}
// Fetch the avatar_url from the $_SESSION array or use a default avatar URL
if (isset($_SESSION["avatar_url"])) {
$avatar_url = $_SESSION["avatar_url"];
} else {
// Use a default avatar URL if avatar_url is not set
$avatar_url = "img/default_avatar.png"; // Replace "default_avatar.png" with the URL of your default avatar image or just replace the image inside the img folder
$avatar_url2 = "img/system_avatar.png";
}
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// D A T A B A S E F O R F I V E M (I recommend to use 2 different databases for better organization)
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Change this into your Database details that hold your FiveM stuff
$servername = "localhost";
$username = "root";
$password = "";
$database = "db_fivemtest";
$conn = new mysqli($servername, $username, $password, $database);
if ($conn->connect_error) {
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// D A T A B A S E F O R T H E D A S H B O A R D (For the user accounts and more)
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$servername_webdev = "localhost";
$username_webdev = "root";
$password_webdev = "";
$database_webdev = "webdev";
$conn_webdev = new mysqli(
$servername_webdev,
$username_webdev,
$password_webdev,
$database_webdev
);
if ($conn_webdev->connect_error) {
die("Connection to webdev failed: " . $conn_webdev->connect_error);
}
$sqlUsers =
"SELECT identifier, firstname, lastname, job, job_grade, accounts, `group` FROM users";
$resultUsers = $conn->query($sqlUsers);
//
$sqlOwnedVehicles = "SELECT * FROM owned_vehicles";
$resultOwnedVehicles = $conn->query($sqlOwnedVehicles);
//
$sqlCodemFishing = "SELECT * FROM `codem-fishing`";
$resultCodemFishing = $conn->query($sqlCodemFishing);
//
$sqlCodemCrafting = "SELECT * FROM `codem-craft`";
$resultCodemCrafting = $conn->query($sqlCodemCrafting);
//
$sqlCompanyMoney = "SELECT * FROM company_money";
$resultCompanyMoney = $conn->query($sqlCompanyMoney);
//
$sqlLiveCall = "SELECT * FROM codem_livecall";
$resultLiveCall = $conn->query($sqlLiveCall);
//
$sqlGeparkteAutos = "SELECT * FROM vehicle_parking";
$resultGeparkteAutos = $conn->query($sqlGeparkteAutos);
//
$sqlGangStashes = "SELECT * FROM t1ger_gangs";
$resultGangStashes = $conn->query($sqlGangStashes);
//
$sqlPlayerInventory = "SELECT * FROM ox_inventory";
$resultPlayerInventory = $conn->query($sqlPlayerInventory);
//
$sqlSpeedCams = "SELECT * FROM speedcams_profit";
$resultSpeedCams = $conn->query($sqlSpeedCams);
//
$sqlTigerMechanic = "SELECT * FROM t1ger_mechanic";
$resultTigerMechanic = $conn->query($sqlTigerMechanic);
//
$sqlOKOKBilling = "SELECT * FROM okokbilling";
$resultOKOKBilling = $conn->query($sqlOKOKBilling);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// S E R V E R S T A T U S & O N L I N E P L A Y E R S
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Here you need to set your server_id from trackyserver.com, i use it to fetch the server status, online players & voting
$server_id = "YOUR_SERVER_ID_FROM_TRACKYSERVER.COM";
$url = "https://api.trackyserver.com/widget/index.php?id=" . $server_id;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// I C O N S F O R T H E A C C O U N T S I N T H E U S E R T A B L E
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$accountIcons = [
"bank" => '<i class="fas fa-piggy-bank"></i>',
"black_money" => '<i class="fas fa-money-bill-alt"></i>',
"cosmo" => '<i class="fas fa-globe"></i>',
"money" => '<i class="fas fa-money-bill"></i>',
];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function formatIcon($account)
{
global $accountIcons;
return $accountIcons[$account];
}
//
function formatAccountValue($account, $value)
{
return formatIcon($account) . ": " . $value;
}
//
function formatAccounts($jsonString)
{
// Decode the JSON string into an associative array
$accounts = json_decode($jsonString, true);
// Format the accounts data
$formattedAccounts = "";
foreach ($accounts as $account => $value) {
$formattedAccounts .= formatAccountValue($account, $value) . ", ";
}
// Remove the trailing comma and space
$formattedAccounts = rtrim($formattedAccounts, ", ");
return $formattedAccounts;
}
function totalAccounts($conn) {
// Get users
$resultUsers = $conn->query("SELECT accounts FROM users");
$totalAccounts = [
"bank" => 0,
"black_money" => 0,
"cosmo" => 0,
"money" => 0,
];
// Loop through each user
while ($row = $resultUsers->fetch_assoc()) {
// Decode the JSON string into an associative array
$accounts = json_decode($row["accounts"], true);
// Add the account values to the total
foreach ($accounts as $account => $value) {
$totalAccounts[$account] += $value;
}
}
return $totalAccounts;
}
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// S T A R T O F H T M L
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="img/favicon.png"><!-- icon that is shown in the browser tab -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="css/main.css"><!-- main css file, other get imported in there -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<script src="https://kit.fontawesome.com/9d1f4cdd15.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/todo.js"></script>
<script type="text/javascript" src="js/chatstatistics.js"></script>
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<audio id="mySound" src="audio/button-click2.mp3" style="display:none"></audio>
<audio id="mySound2" src="audio/button-click.mp3" style="display:none"></audio>
<!-- React.js -->
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap-grid.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Extras -->
<link rel="manifest" href="manifest.json">
<title>Rogue-V | Dashboard</title>
</head>
<!-- Navigation -->
<section class="page-section bg-dark-lighter" id="navigation">
<div class="container relative">
<!-- Navigation grid -->
<div class="navigation-grid">
<!-- Navigation -->
<a href="https://roguev.de" target="_blank">
<div class="navigation-item animate-init" data-anim-type="fade-in" data-anim-delay="100">
<div class="navigation-item-descr dark">
<div class="navigation-item-name">
<i class="fa-solid fa-globe todoicon"></i>Homepage
</div>
<div class="navigation-item-role glow-text2">
Gelange zurück auf die Hauptseite von Rogue-V
</div>
</div>
</div>
</a>
<!-- End Navigation -->
<!-- Navigation -->
<a href="https://roguev.de" target="_blank">
<div class="navigation-item animate-init" data-anim-type="fade-in" data-anim-delay="100">
<div class="navigation-item-descr dark">
<div class="navigation-item-name">
<i class="fa-solid fa-users todoicon"></i>Forum
</div>
<div class="navigation-item-role glow-text2">
Gelange zu unserem Forum
</div>
</div>
</div>
</a>
<!-- End Navigation -->
<!-- Navigation -->
<a href="https://roguev.de" target="_blank">
<div class="navigation-item animate-init" data-anim-type="fade-in" data-anim-delay="300">
<div class="navigation-item-descr dark">
<div class="navigation-item-name">
<i class="fa-solid fa-server todoicon"></i>txAdmin
</div>
<div class="navigation-item-role glow-text2">
Gelange auf das txAdmin Dashboard
</div>
</div>
</div>
</a>
<!-- End Navigation -->
<!-- Navigation -->
<a href="https://roguev.de" target="_blank">
<div class="navigation-item animate-init" data-anim-type="fade-in" data-anim-delay="300">
<div class="navigation-item-descr dark">
<div class="navigation-item-name">
<i class="fa-solid fa-ticket todoicon"></i>Ticketsystem
</div>
<div class="navigation-item-role glow-text2">
Siehe dir alle Tickets an, bearbeite oder schließe Sie
</div>
</div>
</div>
</a>
<!-- End Navigation -->
</div>
<!-- End navigation Grid -->
</div>
</section>
<!-- End navigation Section -->
<header class="image-header">
<div class="header-content">
<h1><img src="https://i.ibb.co/smLg902/Untitled-1.gif" alt="Logo" class="logo-image">ROGUEV - DASHBOARD</h1>
<div class="subheader-text">Willkommen im Rogue-V Dashboard! Behalte die Wirtschaft sowie weitere wichtige Datenbankeinträge im Blick.</div>
<div class="logo-image-text">made with<i class="fa-solid fa-heart fa-beat icon-image-text" style="color: #fc5458;"></i>by push.42</div>
</div>
</header>
<body>
<noscript>Du musst Javascript aktiviert haben.</noscript>
<div id="particles-js"></div>
<section class="user-serverpanel">
<div class="server-status-container2">
<div class="header-info-right">
<!-- Display the user's avatar using the $avatar_url variable -->
<img src="<?php echo $avatar_url; ?>" alt="Avatar" style="width: 50px; height: 50px; border-radius: 50%;">
<?php echo "Willkommen zurück, " . $_SESSION["username"] . "<br>"; ?>
<a href="#" id="settings-icon"> <!-- Link to the settings page -->
<i class="fa-solid fa-cog form-icons" style="color: #ffffff;"></i> <!-- Replace with your settings icon -->
</a>
<form method="post" action="">
<button type="submit" name="logout" id="header-info-right-login" class="fancy-button">Abmelden</button>
</form>
</div>
</div>
<!-- Hidden modal container -->
<div id="avatar-modal" class="modal">
<div class="account-settings-modal">
<span class="close-icon" id="close-modal">×</span>
<h2><i class="fa-solid fa-user-gear labelicon"></i>Kontoeinstellungen</h2>
<form id="avatar-form" method="post" action="functions/update_avatar.php">
<label><i class="fa-solid fa-image labelicon"></i>Avatar (URL):</label>
<input type="text" name="new_avatar_url" placeholder="www.dein-link.de/image.png" >
<label><i class="fa-solid fa-signature labelicon"></i>Benutzername:</label>
<input type="text" placeholder="Gib deinen neuen Benutzernamen ein" name="new_username" >
<input type="submit" name="update_avatar" value="> Avatar ändern">
<input type="submit" name="update_username" value="> Benutzername ändern">
</form>
</div>
</div>
<div class="online-users-count" id="onlineUsersCount">
<span class="online-badge"></span>Staff Online: <span id="onlineUsersCounter"></span>
</div>
<div class="server-status-container">
<div class="server-status-section">
<h2><i class="fas fa-server gameservericon" style="color: #007bff;"></i>FiveM Serverstatus</h2>
</div>
<div class="server-status">
<div class="status-circle" id="serverStatusCircle"></div>
<span id="serverStatusText">Serverstatus: Fetching...</span>
</div>
<div class="countdown-timer-t">Nächster Neustart:</div>
<div id="countdown-timer"></div></br>
<button class="player-list-button" id="playerListButton">Verbundene Spieler</button>
<div class="player-list-modal" id="playerListModal">
<h2>Verbundene Spieler</h2>
<?php if ($result) {
echo "<p><strong>Spielerzahl: </strong> " .
$result["playerscount"] .
"</p>";
if (isset($result["playerslist"])) {
echo "<ul>";
}
echo "</ul>";
} else {
echo "<p>Serverinformationen können nicht abgerufen werden.</p>";
} ?>
<!-- Player list will be dynamically populated using JavaScript -->
<ul id="playerList"></ul>
<button class="close-button" id="closeButton">Schließen</button>
</div>
<div class="modal-overlay"></div>
</div>
</div>
</div>
</section>
<div class="info-box">
<h2>Dashboard | Informationen</h2>
<p>Hier kannst Du die Daten unserer FiveM Gameserver einsehen, ohne direkten Zugriff auf die Datenbank zu haben. Keine Sorge, Du kannst hier nichts verändern – diese Funktionen sind derzeit nur für bestimmte Ränge geplant und werden noch entwickelt.</p>
<p>Unser Server befindet sich derzeit noch im Umbau und ist für die Öffentlichkeit offline. Die Änderungen, die wir vornehmen, werden einige Zeit in Anspruch nehmen, da wir nicht nur den Servernamen und das Logo ändern, sondern auch das gesamte Konzept des Servers.</p>
<p>Du kannst dich weiterhin einloggen und die neuesten Informationen abrufen, während wir an der Verbesserung des Servers arbeiten. Wir sind begeistert von den kommenden Änderungen und hoffen, dass Du sie genauso lieben wirst wie wir!</p>
<p>Vielen Dank, dass Du Teil der ROGUEV-Community bist!</p>
<p>Dein Entwickler-navigation von ROGUEV</p>
</div>
<div class="title2"><i class="fa-solid fa-crown title2icon"></i>Hall of Fame</div>
<div class="new-sections-container" style="display: flex; justify-content: space-between;">
<div class="new-section-1" style="flex: 1;">
<!-- Left box content goes here -->
<img src="img/active.gif" alt="Active" class="activechat"><img>aktivste/r
</div>
<div class="equalsymbol"><i class="fa-solid fa-equals fa-beat"></i></div>
<div class="new-section-2" style="flex: 1;">
<!-- Right box content goes here -->
</div>
</div>
</div>
</div>
<div class="chatbox-container">
<div class="announcements">
<marquee behavior="scroll" direction="left">
<!-- Announcement messages go here -->
<span>📢 Willkommen im navigationchat, bitte haltet euch auch hier an die Regeln und verhaltet euch dementsprechend.</span>
<span><i class="fa-brands fa-discord title3icon"></i>dsc.gg/roguev</span>
<span><i class="fa-solid fa-code title3icon"></i>Chat entwickelt von push42</span>
<span><i class="fa-solid fa-wrench title3icon"></i>Der Chat bekommt regelmäßige Updates</span>
<span><i class="fa-solid fa-face-grin-tongue-wink title3icon"></i>Emoji-Button wird demnächst eingebaut!</span>
</marquee>
</div>
<div class="chatbox">
<div class="chat-overview">
<div class="overview-buttons">
<button id="joinchat-button" class="fancy-button" onclick="updateActiveUsers(chatJoined ? 'leave' : 'join')">Chat beitreten
</button>
</div>
<div class="online-symbol"></div>
<div class="welcome-message">
<p class="glowing-text">Chat ist Online!</p>
</div>
<p>
<span id="active-users">2</span> neue Nachrichten
</p>
<p>
<span id="total-messages">0</span> Nachrichten gesendet
</p>
</div>
<div class="message-container" id="message-container">
<!-- Chat messages go here -->
</div>
<div class="overlay">
<span class="icon"><i class="fa-solid fa-eye-slash fa-beat" style="color: #1e90ff;"></i></span>
</div>
<div class="input-container">
<input type="text" id="message-input" placeholder="Schreibe eine Nachricht...">
<p>Übrig: <span id="remaining-characters">75</span></p>
<button id="send-button">Nachricht senden</button>
</div>
</div>
</div>
<div class="todo-container">
<h2 class="title"><i class="fa-regular fa-circle-check todoicon"></i>To-Do Liste</h2>
<div class="input-wrapper">
<input type="text" id="task-input" placeholder="Neue Aufgabe hinzufügen...">
<button id="add-task-button">Hinzufügen</button>
</div>
<ul id="task-list"></ul>
</div>
<div class="wirtschafts-header"><i class="fa-solid fa-chart-simple fa-bounce wheadericon"></i>Wirtschaftsübersicht</div>
<div class="wirtschafts-subheader">Erhalte einen Überblick über die Wirtschaft auf Rogue-V</div>
<div class="wirtschafts-container">
<?php
$totalAccounts = totalAccounts($conn);
$icons = [
"bank" => '<i class="fas fa-building-columns box-icon"></i>',
"black_money" => '<i class="fas fa-sack-dollar box-icon"></i>',
"cosmo" => '<i class="fas fa-bitcoin-sign box-icon"></i>',
"money" => '<i class="fas fa-money-bill-1 box-icon"></i>',
];
foreach ($totalAccounts as $account => $total) {
echo "<div class=\"box\">";
echo $icons[$account];
echo "<p class=\"box-text\">" . ucfirst($account) . "</p>";
echo "<p class=\"box-total\">Total: " . $total . "</p>";
echo "</div>";
}
?>
</div>
<div class="logo-imagetext2"></div>
<div class="spacer01"></div>
<div class="container" id="rvdatenbank">
<div class="users-section">
<h2><i class="fa-solid fa-user fontawesomeicons" style="color: #007bff;"></i>Registrierte Spieler</h2>
<!-- Add search box for users -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-users" placeholder="Suche nach Spielern...">
</div>
<div class="info-accounts">
<i class="fa-solid fa-info info-accounticon fa-lg"></i>Bei den Konten steht das Symbol
<i class="fas fa-building-columns icon-beschreibung1 fa-lg"></i> für Bank,
<i class="fas fa-sack-dollar icon-beschreibung2 fa-lg"></i> für Schwarzgeld,
<i class="fas fa-bitcoin-sign icon-beschreibung3 fa-lg"></i> für Crypto &
<i class="fas fa-money-bill-1 icon-beschreibung4 fa-lg"></i> für Bargeld.
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultUsers->num_rows > 0) {
echo '<table id="users-table">';
echo "<tr><th>Konten</th><th>Identifier</th><th>Vorname</th><th>Nachname</th><th>Beruf</th><th>Rang</th><th>Gruppe</th></tr>";
while ($row = $resultUsers->fetch_assoc()) {
// Convert the JSON string to an array
$accounts = json_decode($row["accounts"], true);
$formattedAccounts = "";
foreach ($accounts as $account => $value) {
// Define the Font Awesome icon for each account
$icons = [
"bank" =>
'<i class="fas fa-building-columns icon-beschreibung1"></i>',
"black_money" =>
'<i class="fas fa-sack-dollar icon-beschreibung2"></i>',
"cosmo" =>
'<i class="fas fa-bitcoin-sign icon-beschreibung3"></i>',
"money" =>
'<i class="fas fa-money-bill-1 icon-beschreibung4"></i>',
];
// Append the account icon and value with a line break
$formattedAccounts .=
$icons[$account] . " : " . $value . "<br>";
}
echo "<tr>";
echo "<td>" . $formattedAccounts . "</td>";
echo "<td>" . $row["identifier"] . "</td>";
echo "<td>" . $row["firstname"] . "</td>";
echo "<td>" . $row["lastname"] . "</td>";
echo "<td>" . $row["job"] . "</td>";
echo "<td>" . $row["job_grade"] . "</td>";
echo "<td>" . $row["group"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="owned-vehicles-section">
<h2><i class="fa-solid fa-car fontawesomeicons" style="color: #007bff;"></i>Fahrzeuge von Usern</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-vehicles" placeholder="Suche nach Fahrzeugen...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultOwnedVehicles->num_rows > 0) {
echo '<table id="vehicles-table">';
echo "<tr><th>Besitzer</th><th>Kennzeichen</th><th>Klasse</th><th>Garage</th><th>Abschlepphof</th></tr>";
while ($row = $resultOwnedVehicles->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["owner"] . "</td>";
echo "<td>" . $row["plate"] . "</td>";
echo "<td>" . $row["type"] . "</td>";
echo "<td>" . $row["parking"] . "</td>";
echo "<td>" . $row["location"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="parked-vehicles-section">
<h2><i class="fa-solid fa-car fontawesomeicons" style="color: #007bff;"></i>Ausgeparkte Fahrzeuge</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-parked-vehicles" placeholder="Nach einem Fahrzeug suchen...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultGeparkteAutos->num_rows > 0) {
echo '<table id="parked-vehicles-table">';
echo "<tr><th>Kennzeichen</th><th>Position X</th><th>Position Y</th><th>Position Z</th></tr>";
while ($row = $resultGeparkteAutos->fetch_assoc()) {
echo "<tr>";
$tuningData = json_decode($row["tuning"], true); // Decode the JSON data into an array
$firstWord = explode("-", $tuningData[0])[0]; // Get the first word from the first element of the array
echo "<td>" . $firstWord . "</td>";
echo "<td>" . $row["posX"] . "</td>";
echo "<td>" . $row["posY"] . "</td>";
echo "<td>" . $row["posZ"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="codem-fishing-section">
<h2><i class="fa-solid fa-fish fontawesomeicons" style="color: #007bff;"></i>Angeln</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-fishing" placeholder="Suche nach Spielern...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultCodemFishing->num_rows > 0) {
echo '<table id="fishing-table">';
echo "<tr><th>Identifier</th><th>Level</th><th>XP</th><th>IC-Name</th></tr>";
while ($row = $resultCodemFishing->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["identifier"] . "</td>";
echo "<td>" . $row["level"] . "</td>";
echo "<td>" . $row["xp"] . "</td>";
echo "<td>" . $row["playername"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="codem-crafting-section">
<h2><i class="fa-solid fa-hammer fontawesomeicons" style="color: #007bff;"></i>Crafting</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-crafting" placeholder="Suche nach Spielern...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultCodemCrafting->num_rows > 0) {
echo '<table id="crafting-table">';
echo "<tr><th>Identifier</th><th>Level</th><th>XP</th></tr>";
while ($row = $resultCodemCrafting->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["identifier"] . "</td>";
echo "<td>" . $row["level"] . "</td>";
echo "<td>" . $row["xp"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="company-money-section">
<h2><i class="fa-solid fa-money-check-dollar fontawesomeicons" style="color: #007bff;"></i>Firmenkonten</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-company" placeholder="Suche nach Firmen...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultCompanyMoney->num_rows > 0) {
echo '<table id="company-table">';
echo "<tr><th>Firma</th><th>Kontostand</th></tr>";
while ($row = $resultCompanyMoney->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["money"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="live-call-section">
<h2><i class="fa-solid fa-headset fontawesomeicons" style="color: #007bff;"></i>Livesupport (über ESC)</h2>
<!-- Add search box for owned vehicles -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-livecall" placeholder="Supportfall suchen...">
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultLiveCall->num_rows > 0) {
echo '<table id="livecall-table">';
echo "<tr><th>IC Name</th><th>Nachricht</th><th>Datum</th></tr>";
while ($row = $resultLiveCall->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["playername"] . "</td>";
// Decode the JSON data
$messageData = json_decode($row["message"], true);
// Check if "message" exists in the decoded data
if (isset($messageData["message"])) {
$message = $messageData["message"];
} else {
// Fallback to the original message if "message" field is not found
$message = $row["message"];
}
echo "<td>" . $message . "</td>";
echo "<td>" . $row["date"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="gangstashes-section">
<h2><i class="fa-solid fa-hands-asl-interpreting fontawesomeicons" style="color: #007bff;"></i>Gangübersicht</h2>
<!-- Add search box for users -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-gangstashes" placeholder="Suche nach Spielern...">
</div>
<div class="info-accounts">
<i class="fa-solid fa-info info-accounticon fa-lg"></i>In der Spalte "Deaktiviert?" steht 0 für NEIN, 1 für JA.
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultGangStashes->num_rows > 0) {
echo '<table id="vehicles-table">';
echo "<tr><th>Gang / Fraktion</th><th>Gang Notirity</th><th>Gangkonto</th><th>Gangleitung</th><th>Deaktiviert?</th></tr>";
while ($row = $resultGangStashes->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["name"] . "</td>";
echo "<td>" . $row["notoriety"] . "</td>";
echo "<td>" . $row["cash"] . "</td>";
echo "<td>" . $row["leader"] . "</td>";
echo "<td>" . $row["disabled"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo '<p><i class="fa-solid fa-magnifying-glass fontawesomeicons" style="color: #007bff;"></i>Noch keine Einträge..</p>';
} ?>
</div>
</div>
<div class="inventory-section">
<h2><i class="fa-solid fa-box-open fontawesomeicons" style="color: #007bff;"></i>Inventare</h2>
<!-- Add search box for users -->
<div class="search-box">
<i class="fa-solid fa-magnifying-glass" style="color: #ffffff;"></i>
<input type="text" id="search-inventory" placeholder="Suche nach einem Inventar...">
</div>
<div class="info-inventory">
<i class="fa-solid fa-info info-accounticon fa-lg"></i>Hier kannst du alle Gegenstände einsehen die sich in einem Lager / Inventar befinden. Für Gegenstände mit dem <i class="fas fa-box icon-beschreibung3"></i> wurden die Symbole noch nicht angepasst.
</div>
<!-- Wrap the table in a scrollable container -->
<div class="table-container">
<?php if ($resultPlayerInventory->num_rows > 0) {
echo '<table id="inventory-table">';
echo "<tr><th>Identifier</th><th>Bezeichnung</th><th>Inhalt</th></tr>";
while ($row = $resultPlayerInventory->fetch_assoc()) {
// Check if 'data' key exists in the row
if (isset($row["data"])) {
// Convert the JSON string to an array
$data = json_decode($row["data"], true);
$formattedInventory = "";
if (is_array($data)) {
// Construct the formatted inventory entry
foreach ($data as $item) {
if (
isset($item["name"]) &&
isset($item["count"])
) {
// Define the Font Awesome icon based on the item name
$icon = "";
// Check for different item name prefixes and set the corresponding icon
if (
strpos($item["name"], "WEAPON_") === 0
) {
$icon =
'<i class="fas fa-gun icon-beschreibung5"></i>';
} elseif (
strpos($item["name"], "ammo-") === 0
) {
$icon =
'<i class="fas fa-battery-three-quarters icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "joint_") === 0
) {
$icon =
'<i class="fas fa-joint icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "drug_") === 0
) {
$icon =
'<i class="fas fa-tablets icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "money") === 0
) {
$icon =
'<i class="fas fa-dollar icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "diamond") === 0
) {
$icon =
'<i class="fas fa-gem icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "washed_") === 0
) {
$icon =
'<i class="fas fa-gem icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "stone") === 0
) {
$icon =
'<i class="fas fa-gem icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "washpan") === 0
) {
$icon =
'<i class="fas fa-gem icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "waffen_") === 0
) {
$icon =
'<i class="fas fa-screwdriver icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "police_") === 0
) {
$icon =
'<i class="fas fa-person-military-pointing icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "cd") === 0
) {
$icon =
'<i class="fas fa-compact-disc icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "medbag") === 0
) {
$icon =
'<i class="fas fa-suitcase-medical icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "medikit") === 0
) {
$icon =
'<i class="fas fa-suitcase-medical icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "defib") === 0
) {
$icon =
'<i class="fas fa-suitcase-medical icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "lighter") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "at_") === 0
) {
$icon =
'<i class="fas fa-circle-plus icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "tailor") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "woodenrod") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "spray") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "grubber") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "meth") === 0
) {
$icon =
'<i class="fas fa-tablets icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "boombox") === 0
) {
$icon =
'<i class="fas fa-music icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "hammer") === 0
) {
$icon =
'<i class="fas fa-hammer icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "pickaxe") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "pipette") === 0
) {
$icon =
'<i class="fas fa-eye-dropper icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "handsaw") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "shovel") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "woodaxe") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "crowbar") === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos(
$item["name"],
"heckenscheere"
) === 0
) {
$icon =
'<i class="fas fa-wrench icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "juwerlycore") ===
0
) {
$icon =
'<i class="fas fa-gem icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "hacking") === 0
) {
$icon =
'<i class="fas fa-microchip icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "usb") === 0
) {
$icon =
'<i class="fas fa-microchip icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "dongle") === 0
) {
$icon =
'<i class="fas fa-microchip icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "black_usb") === 0
) {
$icon =
'<i class="fas fa-microchip icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "vpn") === 0
) {
$icon =
'<i class="fas fa-microchip icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "weed") === 0
) {
$icon =
'<i class="fas fa-cannabis icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "papes") === 0
) {
$icon =
'<i class="fas fa-cannabis icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "duenger") === 0
) {
$icon =
'<i class="fas fa-cannabis icon-beschreibung6"></i>';
} elseif (
strpos($item["name"], "handcuffs") === 0
) {
$icon =
'<i class="fas fa-handcuffs icon-beschreibung6"></i>';