Пример #1
0
 public function view($data = '')
 {
     $this->init();
     //if(true){
     //$json['auth'] = "9e965808ba6bd38dc883a2806e27763e";
     //$json['aid'] = "2";
     //$data = $this->encode($json);
     //}
     if ($data = $this->decode($data)) {
         $auth = trim(get_std($data, 'auth', ''));
         $kid = intval(get_std($data, 'kid', 0));
         if (is_alpha_numeric($auth) and $kid != 0) {
             $where['auth'] = $auth;
             if (!($rows = $this->User_model->get_where_case_sensitivity($where))) {
             } else {
                 if (!$rows[0]['vip']) {
                 } else {
                     $sql = "SELECT * FROM `knowledge` WHERE `kid` = {$kid}";
                     if ($rows = $this->Knowledge_model->query($sql)) {
                         //前端.
                         $js[] = site_url('config');
                         $js[] = base_url('js/jquery-2.1.0.min.js');
                         $this->layout['js'] = js_links($js);
                         $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js'));
                         $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css'));
                         $this->layout['title'] = $rows[0]['title'];
                         $this->layout['content'] = $this->load->view('main_index', array('title' => $rows[0]['title'], 'content' => $rows[0]['knowledge']), true);
                         $this->load->view('layout/mobile', $this->layout);
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 protected function init()
 {
     date_default_timezone_set('Asia/Taipei');
     $this->init_phpseclib();
     $this->init_phpSec();
     //前端.
     $js[] = site_url('config');
     $js[] = base_url('js/jquery-1.7.2.min.js');
     $this->layout['js'] = js_links($js);
     $this->layout['js'] .= "<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\" integrity=\"sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS\" crossorigin=\"anonymous\"></script>";
     $this->layout['css'] = css_link(base_url('css/clearfix.css'));
     $this->layout['css'] .= "<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\" integrity=\"sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7\" crossorigin=\"anonymous\">";
 }
Пример #3
0
 public function index($data = '')
 {
     $this->init();
     //前端.
     $js[] = site_url('config');
     $js[] = base_url('js/jquery-2.1.0.min.js');
     $this->layout['js'] = js_links($js);
     $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js'));
     $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css'));
     $this->layout['css'] .= css_link(base_url('css/q_and_a_index.css'));
     $this->layout['title'] = '問與答';
     $this->layout['content'] = $this->load->view('q_and_a_index', array(), true);
     $this->load->view('layout/mobile', $this->layout);
 }
Пример #4
0
 public function index($data = '')
 {
     $this->init();
     if (true) {
         //$json['auth'] = "85ace4027df3c500fd9a6099a625f111";
         //$data = $this->encode($json);
     }
     if ($data = $this->decode($data)) {
         $auth = trim(get_std($data, 'auth', ''));
         if (is_alpha_numeric($auth)) {
             $where['auth'] = $auth;
             if (!($rows = $this->User_model->get_where_case_sensitivity($where))) {
             } else {
                 if ($rows[0]['vip']) {
                     $date = date('Y-m-d', time());
                 } else {
                     $N = date('N', time());
                     if ($N >= 4) {
                         $date = date('Y-m-d', time() - ($N - 4) * 86400);
                     } else {
                         $date = date('Y-m-d', time() - ($N - 1) * 86400);
                     }
                 }
                 if ($rows = $this->Knowledge_model->get_where_order(array('date' => $date, 'switch' => 1))) {
                     //前端.
                     $js[] = site_url('config');
                     $js[] = base_url('js/jquery-2.1.0.min.js');
                     $this->layout['js'] = js_links($js);
                     $this->layout['js'] .= js_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js'));
                     $this->layout['css'] = css_link(base_url('js/jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css'));
                     $this->layout['title'] = $rows[0]['title'];
                     $this->layout['content'] = $this->load->view('main_index', array('title' => $rows[0]['title'], 'content' => $rows[0]['knowledge']), true);
                     $this->load->view('layout/mobile', $this->layout);
                 }
             }
         }
     }
 }