Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2. public function administrationList() {
  3.         $gm_status = [];
  4.         $admins = $this->_dbExternal->prepare("SELECT mName FROM " . DB_EXTERNAL_PREFIX . "common.gmlist WHERE mAuthority IN ('IMPLAMENTATOR', 'HIGH_WIZARD', 'GOD', 'LOW_WIZARD')");
  5.         $admins->execute();
  6.  
  7.         if(!empty($admins)) {
  8.             foreach($admins->fetchAll() as $admin) {
  9.                 $is_online = $this->_dbExternal->prepare("SELECT name FROM " . DB_EXTERNAL_PREFIX . "player.online_list WHERE name = :name");
  10.                 $admins->execute([
  11.                     'name' => $admin->mName
  12.                 ]);
  13.  
  14.                 if($is_online->fetch()['name'] != null) {
  15.                     $gm_status[$admin->mName] = 'online';
  16.                 }
  17.                 else {
  18.                     $gm_status[$admin->mName] = 'offline';
  19.                 }
  20.             }
  21.         }
  22.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement