load->model('LunarNewYear_model'); } public function index($z='rat') { $this->edit_zodiac(mb_strtolower($z)); } public function edit_zodiac($z='rat') { $data['nav_active'] = $data["current_zodiac"] = mb_strtolower($z); $data["zodiac_fortune"] = $this->LunarNewYear_model->get_zodiac($data["current_zodiac"]); // 预览编辑的问题 if (substr($data["zodiac_fortune"]->TheYearFortune, 0, 4) !== 'TheYearFortune = "
" . $data["zodiac_fortune"]->TheYearFortune . "
"; } $this->load->view('bootstrap/header', $data); $this->load->view('bootstrap/zodiac/edit',$data); } public function fortune_save() { $this->LunarNewYear_model->LNY_SX = trim($this->input->post("sx")); $this->LunarNewYear_model->LNY_LuckyNumber = trim($this->input->post("lucky_num")); $this->LunarNewYear_model->LNY_LuckyColor = trim($this->input->post("lucky_color")); $this->LunarNewYear_model->LNY_LuckyFlower = trim($this->input->post("lucky_flo")); $this->LunarNewYear_model->TheYearFortune = trim($this->input->post("theyearfortune")); $this->LunarNewYear_model->theyearfortune_save(); $ret = array("name"=>"ok"); $this->output->set_content_type('application/json')->set_output(json_encode($ret)); } }