<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
sort=request.QueryString("id")
select case sort
%>
<%'检查权限
case 4
user=request.form("user")
password=request.form("password")
Set rsadmin = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from admin where user like '"&user&"' ;"
   rsadmin.open strsql,strCon,1,3
if rsadmin.recordcount=0 then response.redirect "msg.asp?id=2"  end if
password1=rsadmin("password")
if password=password1 then 
session("admin")="yes" 
response.redirect "admin.asp" 
else 
response.redirect "msg.asp?id=2" 
end if
rsadmin.close
%>
<%'投票设定
case 6
id=request("flashid")
if session(id)="" then
Set rs = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from flash where id like '"&id&"' ;"
   rs.open strsql,strCon,1,3
   rs("hot")=rs("hot")+1
   rs.update
   rs.close
session(id)=1
response.redirect "show.asp?id="&id&""
else
response.redirect "msg.asp?id=3&flashid="&id&""
end if
%>
<%'检查登陆 。
if session("admin")<>"yes" then response.Redirect "msg.asp?id=2" end if%>
<%
'增加动画
case 1
pathid=request.form("pathid")
Set rspath = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from path where id like '"&pathid&"' ;"
   rspath.open strsql,strCon,1,3
pathname=rspath("pathname")
rspath.close
Set rs = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from flash ;"
   rs.open strsql,strCon,1,3
   rs.addnew
   rs("pathname")=pathname
   rs("name")=request.form("name")
   rs("pathid")=pathid
   rs("marker")=request.form("marker")
   rs("markermail")=request.form("markermail")
   rs("size")=request.form("size")
   rs("txt")=request.form("txt")
   rs("http")=request.form("http")
   rs("img")=request.form("img")
   rs("showhot")=request.form("showhot")
   rs.update
   rs.close
   response.redirect "admin.asp"
%>



<%'删除动画
case 2
flashid=request.Form("id")
Set rs = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from flash where id like '"&flashid&"' ;"
   rs.open strsql,strCon,1,3
   rs.delete
   rs.close
   response.Redirect "admin.asp"
%>


<%'修改动画
case 3
pathid=request.form("pathid")
Set rspath = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from path where id like '"&pathid&"' ;"
   rspath.open strsql,strCon,1,3
pathname=rspath("pathname")
rspath.close
flashid=request.Form("id")
Set rs = Server.CreateObject("ADODB.Recordset")
   strSQL = "select * from flash where id like '"&flashid&"' ;"
   rs.open strsql,strCon,1,3
   rs("pathname")=pathname
   rs("name")=request.form("name")
   rs("pathid")=pathid
   rs("marker")=request.form("marker")
   rs("markermail")=request.form("markermail")
   rs("size")=request.form("size")
   rs("txt")=request.form("txt")
   rs("http")=request.form("http")
   rs("img")=request.form("img")
   rs("showhot")=request.form("showhot")
   rs.update
   rs.close
   response.Redirect "admin.asp"
%>
<%case 5
'登出
session("admin")="no"
response.redirect "index.asp"%>
<%end select%>