Exemple #1
0
 function category()
 {
     $bo_table = $this->input->post('bo_table');
     if (!IS_MEMBER || !$bo_table) {
         show_404();
     }
     $bo = $this->Basic_model->get_board($bo_table, 'bo_table,bo_admin,bo_subject');
     if (!isset($bo['bo_table'])) {
         alert_close('존재하지 않는 게시판 입니다.');
     }
     $member = unserialize(MEMBER);
     if ($member['mb_id'] != $bo['bo_admin']) {
         show_404();
     }
     define('CSS_SKIN', 'category');
     $type = 'bo_' . $bo_table;
     $this->load->model('Categoryform_model');
     $bc = $this->Categoryform_model->list_result($type);
     $code_html = FALSE;
     if ($bc) {
         $t_code = $s_code = array();
         foreach ($bc as $row) {
             $code_exp = explode('-', $row['code']);
             if (!isset($code_exp[1])) {
                 $t_code[$code_exp[0]] = $row['ca_name'];
             } else {
                 $s_code[$code_exp[0]][$code_exp[1]] = $row['ca_name'];
             }
         }
         $this->load->helper('categoryform');
         $code_html = get_categoryform($t_code, $s_code);
     }
     $head = array('title' => $bo['bo_subject']);
     $data = array('bo_table' => $bo_table, 'type' => $type, 'code_html' => $code_html);
     widget::run('head', $head);
     $this->load->view('board/admin_category', $data);
     widget::run('tail');
 }
Exemple #2
0
 function lists($type = '', $tid = '')
 {
     switch ($type) {
         case 'board':
             $bo = $this->Basic_model->get_board($tid, 'bo_table,bo_subject');
             if (!isset($bo['bo_table'])) {
                 alert('존재하지 않는 게시판 입니다.');
             }
             $name = $bo['bo_subject'];
             $type = 'bo_' . $tid;
             break;
         default:
             alert('잘못된 접근입니다.');
             break;
     }
     $bc = $this->Categoryform_model->list_result($type);
     $code_html = FALSE;
     if ($bc) {
         $t_code = $s_code = array();
         foreach ($bc as $row) {
             $code_exp = explode('-', $row['code']);
             if (!isset($code_exp[1])) {
                 $t_code[$code_exp[0]] = $row['ca_name'];
             } else {
                 $s_code[$code_exp[0]][$code_exp[1]] = $row['ca_name'];
             }
         }
         $code_html = get_categoryform($t_code, $s_code);
     }
     // echo '<PRE>';
     // print_r($s_code);
     $head = array('title' => $name . ' 분류관리');
     $data = array('name' => $name, 'type' => $type, 'tid' => $tid, 'code_html' => $code_html);
     widget::run('head', $head);
     $this->load->view(ADM_F . '/category', $data);
     widget::run('tail');
 }