% dim action : action=getForm("action","get") Select case action case "addg" : addAdminGroup case "editg" : editAdminGroup case "delg" : delAdminGroup case "ong" : onOff "on", "UserGroup", "GroupID", "GroupStatus", "and IsAdmin=1", getPageName() case "offg" : onOff "off", "UserGroup", "GroupID", "GroupStatus", "and IsAdmin=1", getPageName() case "add" : addAdmin case "edit" : editAdmin case "del" : delAdmin case "on" : onOff "on", "User", "UserID", "UserStatus", "", getPageName() case "off" : onOff "off", "User", "UserID", "UserStatus", "", getPageName() End Select dim GroupID, IsAdmin, GroupName, GroupDesc, GroupStatus, GroupMark, GroupMenu, GroupSort, GroupOrder dim UserID, LanguageID, SceneID, LoginName, Password, PswQuestion, PswAnswer, UserStatus, RegTime, RegIP, LastLoginIP, LastLoginTime, LoginCount, TrueName, Gender, Birthday, Country, Province, City, Address, PostCode, Phone, Mobile, Email, QQ, MSN, Permissions, AdminDesc dim sql, msg Sub getAdminGroup dim id : id=getForm("id","get") if not isnul(ID) then sql ="select * from {prefix}UserGroup where IsAdmin=1 and GroupID="&id dim rs : set rs = conn.exec(sql,"r1") if rs.eof then alertMsgAndGo "沒有這條記錄","-1" else GroupID=rs("GroupID") IsAdmin=rs("IsAdmin") GroupName=rs("GroupName") GroupDesc=rs("GroupDesc") GroupStatus=rs("GroupStatus") GroupMark=rs("GroupMark") GroupMenu=rs("GroupMenu") GroupSort=rs("GroupSort") GroupOrder=rs("GroupOrder") end if rs.close : set rs=nothing else alertMsgAndGo "沒有這條記錄","-1" end if End Sub Sub addAdminGroup IsAdmin=1 GroupName=getForm("GroupName","post") GroupDesc=getForm("GroupDesc","post") GroupStatus=getCheck(getForm("GroupStatus","post")) GroupMark=getForm("GroupMark","post") GroupMenu=getForm("GroupMenu","post") GroupSort="" GroupOrder=getForm("GroupOrder","post") if isNul(GroupName) then alertMsgAndGo"請填寫組名稱","-1" if not isNum(GroupMark) then alertMsgAndGo"請正確填寫權限值","-1" if not isNum(GroupOrder) then alertMsgAndGo"請正確填寫排序數字","-1" sql="insert into {prefix}UserGroup( IsAdmin, GroupName, GroupDesc, GroupStatus, GroupMark, GroupMenu, GroupSort, GroupOrder) values("&IsAdmin&", '"&GroupName&"', '"&GroupDesc&"', "&GroupStatus&", "&GroupMark&", '"&GroupMenu&"', '"&GroupSort&"', "&GroupOrder&")" msg="添加會員組成功" conn.exec sql,"exe" alertMsgAndGo msg,"AspCms_AdminGroupList.asp" End Sub Sub editAdminGroup GroupID=getForm("GroupID","post") IsAdmin=1 GroupName=getForm("GroupName","post") GroupDesc=getForm("GroupDesc","post") GroupStatus=getCheck(getForm("GroupStatus","post")) GroupMark=getForm("GroupMark","post") GroupMenu=getForm("GroupMenu","post") GroupSort="" GroupOrder=getForm("GroupOrder","post") if not isNum(GroupID) then alertMsgAndGo "組ID不正確!","-1" if isNul(GroupName) then alertMsgAndGo"請填寫組名稱","-1" if not isNum(GroupMark) then alertMsgAndGo"請正確填寫權限值","-1" if not isNum(GroupOrder) then alertMsgAndGo"請正確填寫排序數字","-1" sql="update {prefix}UserGroup set GroupName='"&GroupName&"', GroupDesc='"&GroupDesc&"', GroupMenu='"&GroupMenu&"', GroupOrder="&GroupOrder&", GroupMark="&GroupMark&", GroupStatus="&GroupStatus&" where GroupID="&GroupID msg="修改會員組成功" conn.exec sql,"exe" alertMsgAndGo msg,"AspCms_AdminGroupList.asp" End Sub Sub onAdminGroup End Sub Sub offAdminGroup End Sub Sub delAdminGroup dim id : id=getForm("id","both") if isnul(id) then alertMsgAndGo "請選擇要操作的內容","-1" dim ids,i ids=split(id,",") for i=0 to ubound(ids) if ids(i)>=4 then conn.exec "delete from {prefix}UserGroup where IsAdmin=1 and GroupID="&ids(i),"exe" next alertMsgAndGo "刪除成功",getPageName() End Sub Sub adminGroupList sql="select * from {prefix}UserGroup where IsAdmin=1 order by GroupOrder ,GroupID" dim rs set rs=conn.exec(sql,"r1") if rs.eof then echo "