$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : ''; $customer_id = (int) $_SESSION['customer_id']; $info_type = 'multi'; $data = array(); //delete $music_table = new Model_InfoCommon(); $Model_InfoCommonDetail = new Model_InfoCommonDetail(); if ($act == 'del' && $_POST['child_id']) { $Model_InfoCommonDetail->delete("id='{$_POST[child_id]}'"); //echo $_POST['child_id']; die('success'); } if ($act == 'del' && $id) { Model_Table::get('InfoCommon')->delete("id='{$id}' and customer_id='{$customer_id}'"); Model_Table::get('InfoCommonDetail')->delete("info_common_id='{$id}'"); Model_Table::get('KeywordList')->delete("info_id='{$id}' and customer_id='{$customer_id}' and info_type='{$info_type}'"); header("location:/home/info/index.php?type=multi"); die; } //method:add||modify if ($id) { $music_table = new Model_InfoCommon(); $Model_InfoCommonDetail = new Model_InfoCommonDetail(); $data = $music_table->fetchRow("select * from info_common where id='{$id}' and customer_id='{$customer_id}' and info_type=3"); $datas = $Model_InfoCommonDetail->fetchAll("select * from info_common_detail where info_common_id='{$id}' order by order_num asc"); //echo "<pre>";var_dump($datas); $smarty->assign('infoRow', $data); if ($datas) { foreach ($datas as $key => $value) { $datas[$key]['title'] = cut_str($value['title'], 10, $start = 0, $code = 'UTF-8'); }
$data['create_date'] = date('Y-m-d H:i:s', $_WGT['TIME']); $data['location_name'] = isset($_POST['location_name']) ? str_inmysql($_POST['location_name']) : ''; $data['location_intro'] = isset($_POST['location_intro']) ? str_inmysql($_POST['location_intro']) : ''; $data['location_desc'] = isset($_POST['location_desc']) ? str_inmysql($_POST['location_desc']) : ''; $data['location_pic'] = isset($_POST['location_pic']) ? str_inmysql($_POST['location_pic']) : ''; $data['state'] = isset($_POST['state']) ? str_inmysql($_POST['state']) : ''; $data['x_dian'] = isset($_POST['x_dian']) ? str_inmysql($_POST['x_dian']) : ''; $data['y_dian'] = isset($_POST['y_dian']) ? str_inmysql($_POST['y_dian']) : ''; if (!$data['location_name']) { ajax_feedback(0, '1310'); } if (!$data['x_dian']) { ajax_feedback(0, '1311'); } if (!$data['y_dian']) { ajax_feedback(0, '1312'); } //save-InfoLbs $info_id = Model_Table::get('InfoLbs')->upsert($data); //save-keywordlist $list = array('customer_id' => $customer_id, 'info_id' => $info_id, 'keyword' => $data['keyword'], 'info_type' => $info_type); Model_Table::get('KeywordList')->saveForKeywords($list); //return ajax_feedback(1); } //category $cateModel = new Model_InfoCate(); $cates = $cateModel->getCatesByType($info_type); $smarty->assign("cates", $cates); $smarty->assign("today", date("Y-m-d")); $smarty->setTpl('info/templates/lbs.html')->display();
include_once "../../includes/config.inc.php"; include_once "../../includes/login_check.php"; //var $customer_id = (int) $_SESSION['customer_id']; $status = isset($_REQUEST['status']) ? (int) $_REQUEST['status'] : 1; $page = (int) $_REQUEST["p"] > 0 ? (int) $_REQUEST["p"] : 1; //submit-reply if (isXmlHttpRequest() && method_is('post')) { //TODO 验证身份合法性 $id = isset($_POST['id']) ? (int) $_POST['id'] : ''; $data = array(); $data['is_reply'] = 1; $data['reply_list'] = isset($_POST['reply_list']) ? str_inmysql($_POST['reply_list']) : ''; $sqlStatus = Model_Table::get('Message')->updateById($id, $data); ajax_feedback(1, array('is_reply_str' => Model_Table::get('Message')->is_reply(1))); } //sql $filter = array(); $now_time = time(); $n_time = $now_time - 48 * 3600; $filter['where'] = "customer_id = '{$customer_id}' and create_time > '{$n_time}' and fromuser !=''"; $filter['order'] = "id desc"; //$filter['order'] .= $status ? ',status asc' : ',status desc'; if ($_POST['search']) { $sea = str_inmysql($_POST['search']); $filter['where'] = "customer_id = '{$customer_id}' and msg_content like '%{$sea}%' and fromuser !=''"; //如果是ajax请求48小时外信息 } elseif (method_is('get') && $_GET['act'] == 'history') { $filter['where'] = "customer_id = '{$customer_id}' and create_time < '{$n_time}' and fromuser!=''"; //smarty