Exemplo n.º 1
0
 public function action_ajax_content_additem()
 {
     $table_arr = array(1 => 'line_content', 2 => 'hotel_content', 3 => 'car_content', 4 => '', 5 => 'spot_content', 6 => '', 8 => 'visa_content', 13 => 'tuan_content');
     $typeid = Arr::get($_POST, 'typeid');
     $fieldlist = Arr::get($_POST, 'fieldlist');
     $description = Arr::get($_POST, 'description');
     $fieldarr = explode(',', $fieldlist);
     $description = explode(',', $description);
     $table = $table_arr[$typeid];
     for ($i = 0; isset($fieldarr[$i]); $i++) {
         if (!empty($fieldarr[$i])) {
             $model = new Model_Tongyong($table);
             $m = $model->where("columnname='{$fieldarr[$i]}'")->find();
             if (!$m->loaded()) {
                 $model = new Model_Tongyong($table);
                 $model->columnname = $fieldarr[$i];
                 $model->chinesename = $description[$i];
                 $model->issystem = 0;
                 $model->isopen = 1;
                 $model->webid = 0;
                 $model->save();
             }
         }
     }
     echo json_encode(array('status' => true));
 }
Exemplo n.º 2
0
 public function action_dialog_productinfo()
 {
     $id = $_GET['id'];
     $typeid = $_GET['typeid'];
     $moduleinfo = Model_Model::getModuleInfo($typeid);
     $product_dest_table = $moduleinfo['pinyin'] . '_kindlist';
     $model = new Model_Tongyong($product_dest_table);
     $info = $model->where("kindid", '=', $id)->find()->as_array();
     $pageName = $moduleinfo['pinyin'] . '_list';
     $templateList = Model_Page_Config::getTemplateList($pageName);
     $this->assign('templateList', $templateList);
     $this->assign('id', $id);
     $this->assign('typeid', $typeid);
     $this->assign('info', $info);
     $this->display('stourtravel/destination/dialog_productinfo');
 }