1
0

staff-roster.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. require_once($_SERVER['DOCUMENT_ROOT'] . "/modules/core/header.php");
  3. require_once($_SERVER['DOCUMENT_ROOT'] . "/modules/core/staff.php");
  4. if($adminlevel != 1337)
  5. {
  6. die("no access");
  7. }
  8. if(!isset($link))
  9. {
  10. $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
  11. if($link === false)
  12. {
  13. die("ERROR: Could not connect. " . mysqli_connect_error());
  14. }
  15. }
  16. ?>
  17. <router-outlet _ngcontent-tnh-c136="" class="router-outlet"></router-outlet>
  18. <app-settings _nghost-tnh-c144="">
  19. <div class="content-header">
  20. <h3>Staff Roster</h3></div>
  21. <div class="content">
  22. <table class="cs-1">
  23. <thead>
  24. <tr>
  25. <th>Roles</th>
  26. <th>Name</th>
  27. <th>Discord</th>
  28. <th>Forum</th>
  29. <!--<th>Characters</th>-->
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php
  34. $user_check_query = "SELECT Username, Email, Forum, Admin, Discord FROM accounts WHERE Admin > 0 OR Admin = -1 ORDER BY Admin DESC";
  35. $result = mysqli_query($link, $user_check_query);
  36. $rowcount = $result->num_rows;
  37. if($rowcount > 0)
  38. {
  39. while($result2 = mysqli_fetch_array($result, MYSQLI_ASSOC))
  40. {
  41. $Discord = $result2['Discord'];
  42. if(strlen($Discord) > 0)
  43. {
  44. $apiURLBase = 'https://discordapp.com/api/users/@me';
  45. $user = apiRequest_custom($apiURLBase, $Discord);
  46. }
  47. ?>
  48. <tr *ngFor="let member of members">
  49. <td><?php echo playerRank($result2['Username'], $result2['Admin']); ?></td>
  50. <td> <a href="./admin/accounts/<?php echo $result2['Username']; ?>" target="_blank" class="strongish"> <?php echo $result2['Username']; ?> </a> </td>
  51. <!--<td *ngIf="member.discord_token"> <img src="https://cdn.discordapp.com/avatars/427916747501469698/e65339059c494f2bbc1bd9775b1cc3ef.png?size=16" *ngIf="member.discord_token.discord_avatar"> ᴄʜᴏᴘᴀ#<span class="color-grey">2512</span> </td>-->
  52. <?php if(strlen($Discord) > 0) { ?>
  53. <td><img *ngIf="player.account.discord_token.discord_avatar" src="https://cdn.discordapp.com/avatars/<?php echo $user->id; ?>/<?php echo $user->avatar; ?>.png?size=16" height="16"> <?php echo $user->username; ?><span class="color-grey">#<?php echo $user->discriminator; ?></span></td>
  54. <?php } else { ?>
  55. <td>Not connected</td>
  56. <?php } ?>
  57. <td><?php echo (strlen($result2['Forum']) > 0 ? $result2['Forum'] : 'Not connected'); ?></td>
  58. <!--<td class="color-grey" style="font-size: 0.8em">{{ member.characterNames }}</td>-->
  59. </tr>
  60. <?php
  61. }
  62. }
  63. ?>
  64. </tbody>
  65. </table>
  66. </div>
  67. </app-settings>