コード例 #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
 public static function sqlGetAllItems($using_pages = false, $current_page = '1', $items_on_page = '5', $controller_search = '', array $custom_where = array())
 {
     if ($sql = parent::sqlGetAllItems($using_pages, $current_page, $items_on_page, $controller_search, $custom_where)) {
         foreach ($sql as $key => $val) {
             // nazwa kategorii prawa jazdy
             $sql[$key]['drive_category_name'] = ClassDriveCategories::sqlGetItemNameByIdParent($val['id_drive_category']);
             // Zmiana daty na polski format
             $sql[$key]['date_start'] = date('d.m.Y', strtotime($val['date_start']));
             $sql[$key]['date_end'] = date('d.m.Y', strtotime($val['date_end']));
         }
     }
     return $sql;
 }