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=carrierPlatForm&act=index");
         exit;
     }
     $carrierPlatForm = new CarrierPlatFormAct();
     $res = $carrierPlatForm->actModify($id);
     $carrierList = TransOpenApiModel::getCarrier(2);
     $this->smarty->assign('lists', $carrierList);
     //运输方式列表
     $platFormlist = TransOpenApiModel::getPlatForm("ALL");
     //平台列表
     $this->smarty->assign('platFormlist', $platFormlist);
     $this->smarty->assign('ship_id', $res['carrierId']);
     $this->smarty->assign('plat_id', $res['platId']);
     $this->smarty->assign('ship_name', $res['shipName']);
     $this->smarty->assign('ship_service', $res['shipService']);
     $this->smarty->assign('id', $res['id']);
     $this->smarty->display('carrierPlatFormModify.htm');
 }
 /**
  * CarrierPlatFormAct::act_delCarrierPlatForm()
  * 删除平台
  * @param int $id 平台ID
  * @return  bool
  */
 public function act_delCarrierPlatForm()
 {
     $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 = CarrierPlatFormModel::delCarrierPlatForm($id);
     self::$errCode = CarrierPlatFormModel::$errCode;
     self::$errMsg = CarrierPlatFormModel::$errMsg;
     return $res;
 }