load->model("InfoBokunData_model"); } public function index($ic_id) { $list = $this->InfoBokunData_model->getList($ic_id); if ($list) { $data["list"] = $list; $this->load->view("/trippest/infobokundata", $data); } else { if ($ic_id > 0) { $newBokun = new stdClass(); //如果是cht的产品,构建一个bokun属性,这样可以使用bokun的管理界面添加图片等属性。 $newBokun->ibd_id = 0; $newBokun->ibd_ic_id = $ic_id; $newBokun->ibd_parentId = 0; $newBokun->ibd_ItemName = "ActivityID"; $newBokun->ibd_Itemvalue = "0"; $newBokun->ibd_ItemType = ""; $newBokun->ibd_ItemDescription = ""; $list[] = $newBokun; $data["list"] = $list; /**初始化一条bokun activityId的属性 */ $this->InfoBokunData_model->ibd_ic_id = $ic_id; $this->InfoBokunData_model->ibd_parentId = 0; $this->InfoBokunData_model->ibd_ItemName = "ActivityID"; $this->InfoBokunData_model->ibd_Itemvalue = "0"; $this->InfoBokunData_model->ibd_ItemType = ""; $this->InfoBokunData_model->ibd_ItemDescription = ""; $this->InfoBokunData_model->Add(); //调用视图 $this->load->view("/trippest/infobokundata", $data); } else { header('Cache-Control: no-cache'); echo "找不到对应信息!"; return; } } } //保存bokun附加配置 function save_meta() { $ibd_id = $this->input->post('ibd_id'); $ibd_Itemvalue = $this->input->post('ibd_Itemvalue'); $ibd_ItemType = $this->input->post('ibd_ItemType'); $ibd_ItemDescription = $this->input->post('ibd_ItemDescription'); if ($ibd_id && $ibd_Itemvalue !== false) { $this->InfoBokunData_model->update_byId($ibd_id, $ibd_Itemvalue, $ibd_ItemType, $ibd_ItemDescription); $data[] = array('name' => 'ok', 'value' => $this->lang->line('media_save_success')); } else { $data[] = array('name' => 'no', 'value' => $this->lang->line('media_save_error')); } echo json_encode($data); return true; } //删除bokun附加 function delete_meta() { $ibd_id = $this->input->post('ibd_id'); if ($ibd_id) { $this->InfoBokunData_model->delete_byid($ibd_id); $data[] = array('name' => 'ok', 'value' => $this->lang->line('media_delete_success')); } else { $data[] = array('name' => 'no', 'value' => $this->lang->line('media_save_error')); } echo json_encode($data); return true; } function add_meta() { $ibd_ic_id = $this->input->post('ibd_ic_id'); $ibd_parentId = $this->input->post('ibd_parentId'); $ibd_ItemName = $this->input->post('ibd_ItemName'); $ibd_Itemvalue = $this->input->post('ibd_Itemvalue'); $ibd_ItemType = $this->input->post('ibd_ItemType'); $ibd_ItemDescription = $this->input->post('ibd_ItemDescription'); if ($ibd_ic_id && $ibd_ItemName) { $this->InfoBokunData_model->ibd_ic_id = $ibd_ic_id; $this->InfoBokunData_model->ibd_parentId = $ibd_parentId; $this->InfoBokunData_model->ibd_ItemName = $ibd_ItemName; $this->InfoBokunData_model->ibd_Itemvalue = $ibd_Itemvalue; $this->InfoBokunData_model->ibd_ItemType = $ibd_ItemType; $this->InfoBokunData_model->ibd_ItemDescription = $ibd_ItemDescription; $this->InfoBokunData_model->Add(); $data[] = array('name' => 'ok', 'value' => $this->lang->line('media_save_success')); } else { $data[] = array('name' => 'no', 'value' => $this->lang->line('media_save_error')); } echo json_encode($data); return true; } } /* End of file InfoBokunData.php */