Exemple #1
0
 public static function sqlGetBadgesWithRanks()
 {
     if (!($ranks = ClassBadgeType::sqlGetAllItemsNameById(NULL, false, true))) {
         return false;
     }
     $array = array();
     foreach ($ranks as $key => $rank) {
         $array[$key]['name'] = $rank;
         if ($types = self::sqlGetBadgesByRankId($key)) {
             foreach ($types as $type) {
                 $array[$key]['childs'][$type['id_badge']] = $type['name'];
             }
         }
     }
     return $array;
 }
Exemple #2
0
 protected function getSearchDefinition()
 {
     // $ranks = ClassBadge::getRanks();
     // $form_ranks = array();
     // foreach($ranks as $rank){
     // $form_ranks[$rank['id_badge_rank']] = $rank['name'];
     // }
     $form_ranks = ClassBadgeType::sqlGetAllItemsNameById(NULL);
     $form_values = array('class' => 'ClassBadge', 'controller' => $this->search_controller, 'form' => array('id_badge' => array('class' => 'table_id', 'type' => 'text'), 'name' => array('class' => 'table_name', 'type' => 'text'), 'id_badge_type' => array('class' => 'table_rank', 'type' => 'select', 'options' => $form_ranks), 'active' => array('class' => 'table_status', 'type' => 'select', 'options' => array('0' => 'Wyłączony', '1' => 'Włączony')), 'actions' => array('class' => 'table_akcje')));
     return $form_values;
 }