コード例 #1
0
ファイル: ClassMilitary.php プロジェクト: s9271/SEW3
 public static function getMilitariesWithGroups()
 {
     // if(!$groups = self::sqlGetGroups()){
     // return false;
     // }
     if (!($groups = ClassMilitaryType::sqlGetAllItemsNameById(NULL))) {
         return false;
     }
     $array = array();
     foreach ($groups as $key => $group) {
         $array[$key]['name'] = $group;
         $array[$key]['childs'] = array();
         if ($types = self::sqlGetMilitariesByGroupId($key)) {
             foreach ($types as $type) {
                 $array[$key]['childs'][$type['id_military']]['name'] = $type['name'] . ', ' . $type['location'];
             }
         }
     }
     return $array;
 }
コード例 #2
0
ファイル: ControllerMilitaries.php プロジェクト: s9271/SEW3
 protected function getSearchDefinition()
 {
     $form_values = array('class' => 'ClassMilitary', 'controller' => $this->search_controller, 'form' => array('id_military' => array('class' => 'table_id', 'type' => 'text'), 'number' => array('class' => 'table_number', 'type' => 'text'), 'name' => array('class' => 'table_name', 'type' => 'text'), 'location' => array('class' => 'table_lokalizacja', 'type' => 'text'), 'id_military_type' => array('class' => 'table_rodzaj', 'type' => 'select', 'options' => ClassMilitaryType::sqlGetAllItemsNameById(NULL)), 'active' => array('class' => 'table_status', 'type' => 'select', 'options' => array('0' => 'Wyłączony', '1' => 'Włączony')), 'actions' => array('class' => 'table_akcje')));
     return $form_values;
 }