예제 #1
0
 protected function getPageList($item)
 {
     $this->actions();
     // strony
     $this->controller_name = 'prawo-jazdy';
     $this->using_pages = true;
     $this->count_items = ClassSoldierLanguage::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}: Prawo jazdy";
     // ladowanie funkcji
     $this->load_select2 = true;
     $this->load_datetimepicker = true;
     $this->load_js_functions = true;
     // pobieranie wszystkich rekordow
     $this->tpl_values['items'] = ClassSoldierDriveLicense::sqlGetAllItems($this->using_pages, $this->current_page, $this->items_on_page, '', array('id_soldier' => $item->id));
     $this->tpl_values['id_soldier'] = $item->id;
     // pobieranie statusow zaawansowania jezyka
     $this->tpl_values['drive_categories'] = ClassDriveCategories::sqlGetAllItemsNameById(NULL, false, true);
     // ladowanie strony z lista
     return $this->loadTemplate('/soldier/drive-licenses');
 }
예제 #2
0
 protected function getPageList($item)
 {
     $this->actions();
     // strony
     $this->controller_name = 'szkoly-wyzsze';
     $this->using_pages = true;
     $this->count_items = ClassSoldierLanguage::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}: Szkoły wyższe";
     // ladowanie funkcji
     $this->load_select2 = true;
     $this->load_datetimepicker = true;
     $this->load_js_functions = true;
     // pobieranie wszystkich rekordow
     $this->tpl_values['items'] = ClassSoldierSchool::sqlGetAllItems($this->using_pages, $this->current_page, $this->items_on_page, '', array('id_soldier' => $item->id));
     // id zolnierza
     $this->tpl_values['id_soldier'] = $item->id;
     // pobieranie tytulow zawodowych
     $this->tpl_values['academic_degrees'] = ClassAcademicDegree::sqlGetAllItemsNameById(NULL, false, true);
     // ladowanie strony z lista
     return $this->loadTemplate('/soldier/schools');
 }
예제 #3
0
 protected function delete()
 {
     // ladowanie klasy
     $item = new ClassSoldierLanguage(ClassTools::getValue('id_language'));
     $item->id_soldier = ClassTools::getValue('id_soldier');
     // sprawdza czy klasa zostala poprawnie zaladowana
     if ($item->load_class) {
         // usuwanie
         if ($item->delete()) {
             // komunikat
             $this->alerts['success'] = "Poprawnie usunięto język: <b>{$item->name}</b>";
             return;
         } else {
             // bledy w przypadku problemow z usunieciem
             $this->alerts['danger'] = $item->errors;
             return;
         }
     }
     $this->alerts['danger'] = 'Język nie istnieje';
     $_POST = array();
     return;
 }
예제 #4
0
파일: ClassSoldier.php 프로젝트: s9271/SEW3
 public function getLanguages()
 {
     $items = ClassSoldierLanguage::sqlGetAllItems(false, '1', '100', '', array('id_soldier' => $this->id));
     if ($items && is_array($items) && count($items) > 0) {
         return $items;
     }
     return false;
 }