/** * 模块首页 */ protected function _index() { $mod = $this->get_cache('module-' . SITE_ID . '-' . $this->dir); $file = FCPATH . 'cache/index/' . $this->dir . '-' . SITE_ID . '.html'; $path = $this->mobile ? '/mobiles/' . $mod['template'] . '/' : '/templates/' . $mod['template'] . '/'; $name = is_file(FCPATH . $this->dir . $path . 'index.html') ? 'index.html' : (is_file(FCPATH . 'dayrui' . $path . 'module.html') ? 'module.html' : 'index.html'); // 系统开启静态首页、非手机端访问、静态文件不存在时,才生成文件 if (SITE_MODULE_INDEX && !$this->template->mobile && !is_file($file)) { ob_start(); $this->template->assign(dr_module_seo($mod)); $this->template->assign('indexm', 1); $this->template->display($name); $html = ob_get_clean(); file_put_contents($file, $html, LOCK_EX); echo $html; exit; } else { $this->template->assign(dr_module_seo($mod)); $this->template->assign('indexm', 1); $this->template->display($name); } }
/** * 模块首页 */ protected function _index() { //zjp添加,动态显示日期天气温度 //$city="宜春"; //$content = file_get_contents("http://api.map.baidu.com/telematics/v3/weather?location=宜春&output=json&ak=i8GFDZTM22uqICZbtioaVbnk"); //$de_json = json_decode($content,TRUE); /*zjp 0810 添加网上反馈信息的提交start*/ $type = $this->input->post('type'); if ($type == 'wsfk') { $author = $this->input->post('author'); $title = $this->input->post('title'); $email = $this->input->post('email'); $content = $this->input->post('content'); $filename = $this->input->post('loading'); $fileurl = "/wsfk/uploads/" . $filename; $yanzheng = $this->input->post('yanzheng'); /*zjp 0813 添加获取验证码上的信息start*/ $code = $this->session->userdata('captcha'); /*if($yanzheng == $code) {*/ /*zjp 0813 添加获取验证码上的信息end */ /*if(($author!='')&&($title!='')&&($email!='')&&($content!='')) {*/ $data = array('author' => $author, 'title' => $title, 'email' => $email, 'content' => $content, 'inputtime' => time(), 'displayorder' => 1, 'fileurl' => $fileurl); $this->load->model('content_model'); $this->content_model->insert_wsfk($data); /*}else { echo "<script>alert('请填写完整信息');</script>"; }*/ /*}else { echo "<script>alert('验证码不正确');</script>"; }*/ } /*zjp 0810 添加网上反馈信息的提交 end*/ /*zjp 0811 添加网上信访信息的提交start*/ if ($type == 'wsxf') { $name = $this->input->post('name'); $sex = $this->input->post('sex'); $telephone = $this->input->post('telephone'); $phone = $this->input->post('phone'); $address = $this->input->post('address'); $email = $this->input->post('email'); $number = $this->input->post('number'); $subject = $this->input->post('subject'); //zjp 0812 添加 $content = $this->input->post('content'); $status = $this->input->post('status'); $lettertype = $this->input->post('lettertype'); $filename = $this->input->post('loading'); $fileurl = "/wsxf/uploads/" . $filename; if ($email != '' && $content != '' && $telephone != '' && $number != '' && $address != '' && $sex != '') { $data = array('name' => $name, 'sex' => $sex, 'email' => $email, 'content' => $content, 'inputtime' => time(), 'displayorder' => 1, 'telephone' => $telephone, 'phone' => $phone, 'address' => $address, 'number' => $number, 'status' => $status, 'subject' => $subject, 'lettertype' => $lettertype, 'updatetime' => time(), 'fileurl' => $fileurl); $this->load->model('content_model'); $this->content_model->insert_wsxf($data); } else { echo "<script>alert('请填写完整信息');</script>"; } } /*zjp 0811 添加网上信访信息的提交 end*/ if ($type == "wjdc") { $data = $this->input->post(); //var_dump($data); //for($i=0;$i!=2;$i++){ // if($_POST['oid'][$i]!=""){$oid .= $_POST['oid'][$i].',';} //} foreach ($data as $k => $v) { $ki .= $k . ','; } //var_dump($ki); $tree = explode(',', $ki); //var_dump($tree); $inputtime = SYS_TIME; for ($index = 0; $index < count($tree); $index++) { $str1 = strstr($tree[$index], 'rpid'); if ($str1 != '') { $rpid[$index] = $this->input->post($str1); } $str2 = strstr($tree[$index], 'roid'); if ($str2 != '') { $roid[$index - 1] = $this->input->post($str2); } } for ($index = 0; $index < count($tree); $index++) { $str1 = strstr($tree[$index], 'cpid'); if ($str1 != '') { $cpid[$index] = $this->input->post($str1); } $str2 = strstr($tree[$index], 'coid'); if ($str2 != '') { $coid[$index - 1] = $this->input->post($str2); } } for ($index = 0; $index < count($tree); $index++) { $str1 = strstr($tree[$index], 'tpid'); if ($str1 != '') { $tpid[$index] = $this->input->post($str1); } $str2 = strstr($tree[$index], 'toid'); if ($str2 != '') { $toid[$index - 1] = $this->input->post($str2); } } foreach ($coid as $k => $v) { $kt .= $k . ','; foreach ($v as $k2 => $v2) { $kt2 .= $v2 . ','; } } foreach ($rpid as $i => $t) { $this->db->insert('answer', array('id' => '', 'pid' => $rpid[$i], 'oid' => $roid[$i], 'inputtime' => $inputtime)); } foreach ($cpid as $i => $t) { $this->db->insert('answer', array('id' => '', 'pid' => $cpid[$i], 'oid' => $kt2, 'inputtime' => $inputtime)); } foreach ($tpid as $i => $t) { $this->db->insert('answer', array('id' => '', 'pid' => $tpid[$i], 'oid' => $toid[$i], 'inputtime' => $inputtime)); } } //ychl 8-11 $id = $this->input->get('id'); if (APP_DIR == 'question') { $title = $this->content_model->get_question_name($id); $this->template->assign('title', $title); } $this->template->assign('id', $id); $this->template->assign(array('de_json' => $_SESSION["de_json"])); $mod = $this->get_cache('module-' . SITE_ID . '-' . $this->dir); if ($this->dir == 'wsxf') { $file = FCPATH . 'cache/index/' . $this->dir . '-' . ($this->template->mobile ? 'mb-' : '') . SITE_ID . '.html'; } else { $file = FCPATH . 'cache/index/' . $this->dir . '-' . ($this->template->mobile ? 'mb-' : '') . SITE_ID . '.html'; } $path = $this->mobile ? '/mobiles/' . $mod['template'] . '/' : '/templates/' . $mod['template'] . '/'; $name = is_file(FCPATH . $this->dir . $path . 'index.html') ? 'index.html' : (is_file(FCPATH . 'dayrui' . $path . 'module.html') ? 'module.html' : 'index.html'); // 系统开启静态首页、非手机端访问、静态文件不存在时,才生成文件 if (SITE_MODULE_INDEX && !$this->template->mobile && !is_file($file)) { ob_start(); $this->template->assign(dr_module_seo($mod)); $this->template->assign('indexm', 1); /*zjp 0814 网上信访前台页面已回复未回复数量显示start*/ $yi_num = $this->content_model->count_wsxf_yi(); $this->template->assign('yi', $yi_num[0]['yi']); $wei_num = $this->content_model->count_wsxf_wei(); $this->template->assign('wei', $wei_num[0]['wei']); /*zjp 0814 网上信访前台页面已回复未回复数量显示 end*/ /*zjp 0814 网上信访前台获取信件编号start*/ $number = $this->content_model->number_wsxf(); $number = str_pad($number[0]['num'] + 1, 4, "0", STR_PAD_LEFT); $number1 = date("ymd", time()); $number = $number1 . $number; $this->template->assign('number', $number); /*zjp 0814 网上信访前台获取信件编号 end*/ $this->template->display($name); $html = ob_get_clean(); file_put_contents($file, $html, LOCK_EX); echo $html; exit; } else { $this->template->assign(dr_module_seo($mod)); $this->template->assign('indexm', 1); /*zjp 0814 网上信访前台页面已回复未回复数量显示start*/ $yi_num = $this->content_model->count_wsxf_yi(); $this->template->assign('yi', $yi_num[0]['yi']); $wei_num = $this->content_model->count_wsxf_wei(); $this->template->assign('wei', $wei_num[0]['wei']); /*zjp 0814 网上信访前台页面已回复未回复数量显示 end*/ /*zjp 0814 网上信访前台获取信件编号start*/ $number = $this->content_model->number_wsxf(); $number = str_pad($number[0]['maxid'] + 1, 4, "0", STR_PAD_LEFT); $number1 = date("ymd", time()); $number = $number1 . $number; $this->template->assign('number', $number); /*zjp 0814 网上信访前台获取信件编号 end*/ $this->template->display($name); } }