Пример #1
0
 protected function getPageList($item)
 {
     global $login;
     $this->actions();
     // strony
     $this->controller_name = 'wyposazenie';
     $this->using_pages = true;
     $this->count_items = ClassSoldier2Equipment::sqlGetCountItems('', array('id_soldier' => $item->id));
     $this->current_page = ClassTools::getValue('number_page') ? ClassTools::getValue('number_page') : '1';
     // tytul strony
     $this->tpl_title = "{$item->name} {$item->surname}: Wyposażenie";
     // ladowanie funkcji
     $this->load_js_functions = true;
     // pobieranie wszystkich rekordow
     $this->tpl_values['items'] = ClassSoldier2Equipment::sqlGetSoldierEquipments($item->id);
     // id zolnierza
     $this->tpl_values['id_soldier'] = $item->id;
     // prawa zalogowanego uzytkownika
     $this->tpl_values['id_login_permission'] = $login->auth_user['id_permission'];
     // ladowanie strony z lista
     return $this->loadTemplate('/soldier/equipments');
 }
Пример #2
0
 public function getEquipments()
 {
     $items = ClassSoldier2Equipment::sqlGetSoldierEquipments($this->id);
     if ($items && is_array($items) && count($items) > 0) {
         $array = false;
         foreach ($items as $key => $item) {
             if ($item['returned'] == '1') {
                 continue;
             }
             $array[$key] = $item;
         }
         if ($array) {
             return $array;
         }
     }
     return false;
 }