<%
if Request.Cookies("WrzcNet")("admin_name")="" or Request.Cookies("WrzcNet")("admin_pass")="" or Request.Cookies("WrzcNet")("admin_class")="" then
Response.Cookies("WrzcNet")("admin_name")=""
Response.Cookies("WrzcNet")("admin_pass")=""
Response.Cookies("WrzcNet")("admin_class")=""
response.redirect "Wrzcnet_login.asp"
response.end
else
admin_name=Request.Cookies("WrzcNet")("admin_name")
set rs=server.createobject("adodb.recordset")
sql="select * from WrzcNet_admin where admin_name='"&admin_name&"'"
rs.open sql,conn,1,1
if rs.eof then
Response.Cookies("WrzcNet")("admin_name")=""
Response.Cookies("WrzcNet")("admin_pass")=""
Response.Cookies("WrzcNet")("admin_class")=""
response.redirect "Wrzcnet_login.asp"
response.end
else
admin_pass=rs("admin_pass")
end if
rs.close
set rs=nothing
if trim(Request.Cookies("WrzcNet")("admin_pass"))<>trim(admin_pass) then
Response.Cookies("WrzcNet")("admin_name")=""
Response.Cookies("WrzcNet")("admin_pass")=""
Response.Cookies("WrzcNet")("admin_class")=""
response.redirect "Wrzcnet_login.asp"
response.end
end if
end if

function addok(addt,addurl,listurl)
select case addt
case 1
response.write "<p style=""margin:5;"">添加成功，<a href="""&addurl&"""><font color=""#ff0000"">返回继续添加</font></a>!</p>"
response.end
case 2
response.redirect addurl
response.end
case 3
response.redirect listurl
response.end
case 4
Response.Write "<script language=javascript>alert('添加成功，点击确定继续添加');window.location.href='"&addurl&"';</script>"
response.End
case else
Response.Write "<script language=javascript>alert('添加成功，点击确定继续添加');window.location.href='"&addurl&"';</script>"
response.End
end select
end function

function editok(editt,editurl,listurl)
select case editt
case 1
response.write "<p style=""margin:5;"">修改成功，<a href="""&editurl&"""><font color=""#ff0000"">返回继续修改</font></a>!</p>"
response.end
case 2
response.redirect listurl
response.end
case 3
Response.Write "<script language=javascript>alert('修改成功，点击确定继续修改');window.location.href='"&editurl&"';</script>"
response.End
case 4
Response.Write "<script language=javascript>alert('修改成功，点击确定返回列表');window.location.href='"&listurl&"';</script>"
response.End
case 5
response.redirect editurl
response.end
case else
Response.Write "<script language=javascript>alert('修改成功，点击确定返回列表');window.location.href='"&listurl&"';</script>"
response.End
end select
end function

function deleok(delet,listurl)
select case delet
case 1
response.write "<p style=""margin:5;"">删除成功，<a href="""&listurl&"""><font color=""#ff0000"">返回继续修改</font></a>!</p>"
response.end
case 2
response.redirect listurl
response.end
case 3
Response.Write "<script language=javascript>alert('删除成功，点击确定返回列表');window.location.href='"&listurl&"';</script>"
response.End
case else
Response.Write "<script language=javascript>alert('删除成功，点击确定返回列表');window.location.href='"&listurl&"';</script>"
response.End
end select
end function
%>
