/** * PartitionManageModel::delPartitionManage() * 分区删除 * @param integer $id 分区ID * @return bool */ public static function delPartitionManage($id) { self::initDB(); $sql = "UPDATE `" . self::$prefix . self::$table . "` SET is_delete = 1 WHERE id = {$id}"; $query = self::$dbConn->query($sql); if ($query) { $rows = self::$dbConn->affected_rows(); if ($rows) { return $rows; } else { self::$errCode = 30001; self::$errMsg = "删除数据失败"; return false; } } else { self::$errCode = 30000; self::$errMsg = "执行SQL语句失败!"; return false; } }
/** * PartitionManageAct::act_delPartitionManage() * 删除分区 * @param int $id 分区ID * @return bool */ public function act_delPartitionManage() { $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 = 30001; self::$errMsg = "对不起,您无数据删除权限!"; return false; } if (empty($id) || !is_numeric($id)) { self::$errCode = 30000; self::$errMsg = "分区ID有误!"; return false; } $res = PartitionManageModel::delPartitionManage($id); self::$errCode = PartitionManageModel::$errCode; self::$errMsg = PartitionManageModel::$errMsg; return $res; }
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=partitionManage&act=index"); exit; } $partitionManage = new PartitionManageAct(); $res = $partitionManage->actModify($id); $carrierId = PartitionManageModel::getCarrierId($res['channelId']); $this->smarty->assign('pt_code', $res['partitionCode']); $this->smarty->assign('chid', $res['channelId']); $this->smarty->assign('carrierId', $carrierId); $this->smarty->assign('pt_name', $res['partitionName']); $this->smarty->assign('pt_ali', $res['partitionAli']); $this->smarty->assign('pt_add', $res['returnAddress']); $this->smarty->assign('pt_enable', $res['enable']); $this->smarty->assign('pt_country', $res['countries']); $this->smarty->assign('pt_add_html', $res['returnAddHtml']); $this->smarty->assign('id', $res['id']); $this->smarty->display('partitionManageModify.htm'); }