Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
  2. ?><h1>Support in-game</h1><?php
  3. $cache = new Cache('engine/cache/support');
  4. if ($cache->hasExpired()) {
  5. // Fetch all staffs in-game.
  6. $staffs = support_list();
  7. // Fetch group ids and names from config.php
  8. $groups = $config['ingame_positions'];
  9. // Loops through groups, separating each group element into an ID variable and name variable
  10. foreach ($groups as $group_id => $group_name) {
  11. // Loops through list of staffs
  12. if (!empty($staffs))
  13. foreach ($staffs as $staff) {
  14. if ($staff['group_id'] == $group_id) $srtGrp[$group_name][] = $staff;
  15. }
  16. }
  17. if (!empty($srtGrp)) {
  18. $cache->setContent($srtGrp);
  19. $cache->save();
  20. }
  21. } else {
  22. $srtGrp = $cache->load();
  23. }
  24. $writeHeader = true;
  25. if (!empty($srtGrp)) {
  26. foreach (array_reverse($srtGrp) as $grpName => $grpList) {
  27. ?>
  28. <table id="supportTable" class="table table-striped">
  29. <?php if ($writeHeader) {
  30. $writeHeader = false; ?>
  31. <tr class="yellow">
  32. <th width="30%">Group</th>
  33. <th width="40%">Name</th>
  34. <th width="30%">Status</th>
  35. </tr>
  36. <?php
  37. }
  38. foreach ($grpList as $char) {
  39. if ($char['name'] != $config['website_char']) {
  40. echo '<tr>';
  41. echo "<th width='30%'>". $grpName ."</th>";
  42. echo '<th width="40%"><a href="characterprofile.php?name='. $char['name'] .'">'. $char['name'] .'</a></th>';
  43. echo "<th width='30%'>". online_id_to_name($char['online']) ."</th>";
  44. echo '</tr>';
  45. }
  46. }
  47. ?>
  48. </table>
  49. <?php
  50. }
  51. }
  52. echo'</table>'; include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement