Example #1
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $user = isset($_GET['user']) ? trim($_GET['user']) : NULL;
     $type = isset($_GET['type']) ? trim($_GET['type']) : NULL;
     $this->_edit = isset($_GET['edit']) ? trim($_GET['edit']) : NULL;
     $this->_planet = isset($_GET['planet']) ? trim($_GET['planet']) : NULL;
     $this->_moon = isset($_GET['moon']) ? trim($_GET['moon']) : NULL;
     $parse['alert'] = '';
     if ($user != '') {
         if (!$this->check_user($user)) {
             $parse['alert'] = AdministrationLib::save_message('error', $this->_lang['us_nothing_found']);
             $user = '';
         } else {
             // save the data
             if (isset($_POST['send_data']) && $_POST['send_data']) {
                 $this->save_data($type);
             }
             $this->_user_query = parent::$db->queryFetch("SELECT u.*,\n\t\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\t\tp.*,\n\t\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\t\tse.*,\n\t\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\t\tr.*\n\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\tFROM " . USERS . " AS u\n\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\tINNER JOIN " . SETTINGS . " AS se ON se.setting_user_id = u.user_id\n\t\t\t\t\t                                   \t\t\t\tINNER JOIN " . PREMIUM . " AS p ON p.premium_user_id = u.user_id\n\t\t\t\t\t                                   \t\t\t\tINNER JOIN " . RESEARCH . " AS r ON r.research_user_id = u.user_id\n\t\t\t\t\t           \t\t\t\t\t\t\t\t\t\tWHERE (u.user_id = '{$this->_id}') LIMIT 1;");
         }
     }
     // physical delete
     if (isset($_GET['mode']) && $_GET['mode'] == 'delete' && $this->_user_query['user_authlevel'] != 3) {
         parent::$users->delete_user($this->_user_query['user_id']);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['us_user_deleted']);
     }
     $parse['type'] = $type != '' ? $type : 'info';
     $parse['user'] = $user != '' ? $user : '';
     $parse['status'] = $user != '' ? '' : ' disabled';
     $parse['status_box'] = $user != '' && $this->_id != $this->_current_user['user_id'] ? '' : ' disabled';
     $parse['tag'] = $user != '' ? 'a' : 'button';
     $parse['user_rank'] = AdministrationLib::return_rank($this->_authlevel);
     $parse['content'] = $user != '' && $type != '' ? $this->get_data($type) : '';
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template("adm/users_view"), $parse));
 }