public function view_modify() { $this->smarty->assign('title', '修改中国地区'); $id = isset($_GET['id']) ? intval(trim($_GET['id'])) : 0; if (empty($id) || !is_numeric($id)) { redirect_to("index.php?mod=countriesChina&act=index"); exit; } $countriesChina = new CountriesChinaAct(); $res = $countriesChina->actModify($id); $this->smarty->assign('cn_name', $res['countryName']); $this->smarty->assign('id', $res['id']); $this->smarty->display('countriesChinaModify.htm'); }
/** * CountriesChinaAct::act_delCountriesChina() * 删除中国地区 * @param int $id 中国地区ID * @return bool */ public function act_delCountriesChina() { $id = isset($_POST["id"]) ? intval(trim($_POST["id"])) : 0; $act = isset($_REQUEST["act"]) ? post_check($_REQUEST["act"]) : ""; $mod = isset($_REQUEST["mod"]) ? post_check($_REQUEST["mod"]) : ""; if (!AuthUser::checkLogin($mod, $act)) { self::$errCode = 10001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 10000; self::$errMsg = "地区ID有误!"; return false; } $res = CountriesChinaModel::delCountriesChina($id); self::$errCode = CountriesChinaModel::$errCode; self::$errMsg = CountriesChinaModel::$errMsg; return $res; }