response.redirect "index_face.asp"
response.end
else
usernamecookie=CheckStr(request.cookies("UserName"))
passwdcookie=replace(trim(Request.cookies("passwd")),"'","''")
KEYcookie=replace(trim(request.cookies("KEY")),"'","''")
if usernamecookie="" or passwdcookie="" then
response.redirect "login.asp"
response.end
else
'判断用户的合法性
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&usernamecookie&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.redirect "login.asp"
response.end
end if
IF passwdcookiers("passwd") THEN
response.redirect "login.asp"
response.end
END IF
'下面判断用户级别实际在有用户级别是都应该判断
if KEYcookiers("OSKEY") then
response.redirect "index_face.asp"
response.end
end if
rs.close
set rs=nothing
END IF
END IF
if votemana="1" or request.cookies("purview")="99999" then
%>
ID=request.QueryString("id")
Title=trim(request.form("Title"))
act=request("act")
if DateAndTime="" then DateAndTime=now()
Content=trim(request.form("Content"))
founerr=false
if Title="" then
response.write "alert('对不起,投票主题不能为空!');history.go(-1);"
Response.End
end if
if founderr=true then
call error()
else
set rs=server.createobject("adodb.recordset")
if act="edit" then
sql="select * from vote where ID="&ID
elseif act="add" then
sql="select * from vote"
else
errmsg="操作错误!请联系管理员"
call error()
Response.End
end if
rs.open sql,conn,1,3
if act="add" or act="edit" then
if act="edit" then
if rs.eof then
errmsg="操作错误!请联系管理员"
call error()
Response.End
end if
end if
if act="add" then rs.addnew
rs("Title")=Title
for i=1 to 8
if request("select"&i)"" then
rs("select"&i)=request("select"&i)
if request("answer"&i)="" then
rs("answer"&i)=0
else
rs("answer"&i)=request("answer"&i)
end if
end if
next
rs("dateandtime")=now()
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect "voteManage.asp"
end if
%>
response.redirect "index_face.asp"
response.end
end if
%>