Beispiel #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=countriesShip&act=index");
         exit;
     }
     $countriesShip = new CountriesShipAct();
     $res = $countriesShip->actModify($id);
     $countriesList = TransOpenApiModel::getCountriesStandard();
     $this->smarty->assign('countries', $countriesList);
     //标准国家列表
     $carrierList = TransOpenApiModel::getCarrier(2);
     $this->smarty->assign('lists', $carrierList);
     //运输方式列表
     $this->smarty->assign('carrier_name', $res['carrier_country']);
     $this->smarty->assign('en_name', $res['countryName']);
     $this->smarty->assign('ship_id', $res['carrierId']);
     $this->smarty->assign('id', $res['id']);
     $this->smarty->display('countriesShipModify.htm');
 }
Beispiel #2
0
 /**
  * CountriesShipAct::act_delCountriesShip()
  * 删除运输方式国家
  * @param int $id 运输方式国家ID
  * @return  bool
  */
 public function act_delCountriesShip()
 {
     $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 = CountriesShipModel::delCountriesShip($id);
     self::$errCode = CountriesShipModel::$errCode;
     self::$errMsg = CountriesShipModel::$errMsg;
     return $res;
 }