Exemplo n.º 1
0
 public function search()
 {
     if (!Util::has_authority(10)) {
         $this->error(3);
     }
     $key = Util::fetch_get('key');
     if ($key != null) {
         $user_table = new UserTable();
         $result = $user_table->select_with_login($key);
         if ($result != false) {
             $user_type_table = new UserTypeTable();
             $types = $user_type_table->select_all();
             $view_data = array('has_key' => true, 'has_result' => true, 'user' => $result, 'types' => $types);
         } else {
             $view_data = array('has_key' => true, 'has_result' => false);
         }
         $this->my_render('search', $view_data);
     } else {
         $this->my_render('search');
     }
 }