添加bokun管理界面

mobile-first
赵鹏 5 years ago
parent 718f18d019
commit 635265d624

@ -0,0 +1,90 @@
<?php
/**
* TP抓取数据infobokundata表的操作界面
*/
defined('BASEPATH') or exit('No direct script access allowed');
class InfoBokunData extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->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 {
header('Cache-Control: no-cache');
echo "找不到对应信息!";
return false;
}
}
//保存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 */
Loading…
Cancel
Save