Beispiel #1
0
 public function edit($id = NULL)
 {
     // if ($this->input->post('name')) {
     //     $this->data['label'] = $this->input->post('label');
     //     $this->data['type'] = $this->input->post('type');
     //     $this->question->update($data, $id);
     //
     //     redirect('/admin/questions', 'refresh');
     // }
     //
     // $question = $this->question->get($id);
     $choice = $this->choice->get_all('', array('question_id' => $id));
     if (count($choice) == 0) {
         $choice[0]['id'] = 0;
         $choice[0]['label'] = '';
     }
     //$choice = $this->choice->get_from_question( $id );
     //
     // $this->data['question'] = $question;
     $this->data['data']['choice'] = $choice;
     parent::edit($id);
     // $this->data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "questions_create";
     // //$this->load->view($this->_container, $data);
     // parent::page();
 }
Beispiel #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->library(array('ion_auth'));
     if (!$this->ion_auth->logged_in()) {
         redirect('/auth', 'refresh');
     }
     $this->load->model(array('admin/quiz_session'));
 }
Beispiel #3
0
 public function __construct()
 {
     parent::__construct();
     // var_dump($this->model->get_count_mouth());
     // 对log日志严格控制
     $actions = array('index', 'search');
     if (!in_array($this->router->method, $actions)) {
         $vdata = array("status" => 0, "msg" => "非法操作,不提供此功能!");
         if ($this->input->is_ajax_request()) {
             $this->output->set_content_type('application/json')->set_output(json_encode($vdata));
         } else {
             $this->load->view('msg', $vdata);
         }
     }
 }
Beispiel #4
0
 public function __construct()
 {
     parent::__construct();
     if (!$this->input->is_ajax_request()) {
         $this->load->helper('valid');
         $status = 1;
         if (isset($_GET['c']) and is_numeric(trim($cid = $this->input->get('c', true)))) {
             $this->cid = trim($cid);
         } else {
             if (isset($_GET['cid']) and is_numeric(trim($cid = $this->input->get('cid', true)))) {
                 $this->cid = trim($cid);
             } else {
                 $this->url_col = site_url();
                 $status = 0;
             }
         }
         // 分类名
         if ($field = $this->input->get('field', true) and is_name(trim($field), 'EN')) {
             $this->name = trim($field);
         } else {
             $status = 0;
         }
         // 返回控制器
         if ($rc = $this->input->get('rc', true) and is_name(trim($rc), 'EN')) {
             $tmp_url = site_url($rc . '/index');
             if ($this->cid) {
                 $tmp_url .= '/' . $this->cid;
             }
             $this->url_col = $tmp_url;
             $this->rc = $rc;
         } else {
             $this->url_col = site_url('welcome');
             $status = 0;
         }
         $this->status = $status;
         if ($this->status === 0) {
             $_GET['back_url'] = $this->url_col;
             $vdata['status'] = 0;
             $vdata['msg'] = '无效页面!';
             $this->view = "msg.php";
             $this->_display($vdata, "msg.php");
         }
     }
     // end is ajax
 }
Beispiel #5
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('Article_model', 'marticle');
 }
Beispiel #6
0
 public function show($page = 1)
 {
     parent::show($page);
     //parent::show($page);
 }
Beispiel #7
0
 public function delete($id)
 {
     parent::delete($id);
 }
Beispiel #8
0
 protected function _get_rule($rule)
 {
     $rule = parent::_get_rule($rule);
     $rule_cid = array('field' => 'cid', 'label' => lang('modules_cid_change'), 'rules' => 'required|numeric|callback_checkcid');
     array_push($rule, $rule_cid);
     return $rule;
 }
Beispiel #9
0
 function __construct()
 {
     parent::__construct();
     // $this->load->library('phpanalysis', array('utf-8', 'utf-8', false), 'pa');
 }
Beispiel #10
0
 public function __construct()
 {
     parent::__construct();
     $this->model->change_table('upload');
 }