⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_del.asp

📁 对学校物资管理系统的一份设计
💻 ASP
字号:
<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<%
call adminer()
Call Header()
Call ComeUrl()
Call adminqx()


Dim UserID,delesql,FoundErr,ErrMsg
Dim zRs,zSql
UserID=Trim(Request("id"))
if UserID="" then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>参数不足</li>"
end if
if founderr=true then
	call WriteErrMsg()
End if
If IsNumeric(UserID) = False Then
	GoError "请通过页面上的链接进行操作,不要试图破坏此系统。"
End If

ssql="select * from admin where  id="&UserID
ors.open ssql,oconn,1,1
If Not oRs.Eof Then
	if ors("username")=session("username") then
		response.write "<script>"
		response.write "alert('您不能删除当前登陆中的用户!!');"
		response.write "history.back(1);"
		response.write "</script>"
		Response.End
	end if
	If oRs("userclass")=1 then
		Set zRs=Server.CreateObject("ADODB.Recordset")
		zSql="Select UserClass From Admin Where UserClass=1"
		zRs.Open zSql,oConn,1,1
		If Not zRs.Eof Then
			If zRs.recordcount<=1 Then
				'Response.Write zRs.recordcount
				response.write "<script>"
				response.write "alert('系统必须保留至少一个超级管理员,才能正常运行!!');"
				response.write "history.back(1);"
				response.write "</script>"
				Response.End
			End If
		End If
	End If

delesql="DELETE FROM admin WHERE id="&UserID
oconn.Execute delesql
Else
	response.write "<p align=center>无效的用户ID,请点页面上的链接进行操作!<script>window.setTimeout(""location.href='user.asp'"",2000);</script></p>"
End If 
response.write "<p align=center>用户删除成功,2秒后自动返回用户管理页!<script>window.setTimeout(""location.href='user.asp'"",2000);</script></p>"

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -