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(); }
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')); }
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); } } }
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 }
function __construct() { parent::__construct(); $this->load->model('Article_model', 'marticle'); }
public function show($page = 1) { parent::show($page); //parent::show($page); }
public function delete($id) { parent::delete($id); }
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; }
function __construct() { parent::__construct(); // $this->load->library('phpanalysis', array('utf-8', 'utf-8', false), 'pa'); }
public function __construct() { parent::__construct(); $this->model->change_table('upload'); }