Ejemplo n.º 1
0
 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=countriesStandard&act=index");
         exit;
     }
     $countriesStandard = new CountriesStandardAct();
     $res = $countriesStandard->actModify($id);
     $this->smarty->assign('cn_name', $res['countryNameCn']);
     $this->smarty->assign('en_name', $res['countryNameEn']);
     $this->smarty->assign('short_name', $res['countrySn']);
     $this->smarty->assign('id', $res['id']);
     $this->smarty->display('countriesStandardModify.htm');
 }
Ejemplo n.º 2
0
 /**
  * CountriesStandardAct::act_delCountriesStandard()
  * 删除标准国家
  * @param int $id 标准国家ID
  * @return  bool
  */
 public function act_delCountriesStandard()
 {
     $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 = CountriesStandardModel::delCountriesStandard($id);
     self::$errCode = CountriesStandardModel::$errCode;
     self::$errMsg = CountriesStandardModel::$errMsg;
     return $res;
 }