<!-- #include FILE="include/onlogin.asp" -->
<!-- #include FILE="include/conn.asp" -->
<%
dim change,delet,addname,typena,typer
tit="<a href='admin_video.asp?action='>影片列表</a>&nbsp;┋&nbsp;" & _
    "<a href='admin_video.asp?action=addsever'>添加影片</a>&nbsp;┋&nbsp;" & _
    "<a href='admin_video.asp?action=addserv'>添加服务器</a>&nbsp;┋&nbsp;<a href='admin_vsort.asp'>影片分类</a>｜<A href=admin_video_error.asp>错误电影</A>｜<a href=admin_video_move.asp>批量转移</a>｜<a href=admin_video_url.asp>批量转换</a>"
response.write header(19,tit)
  titt="电影分类"
response.write admin_bar(titt,1,"99%")
change=request("change")
delet=request("delet")
addname=request("addname")
if delet<>"" then
   conn.execute"delete from videotype where typeid="&request("typeid")
      set rs=nothing
   conn.close
   set conn=nothing
response.redirect Request.ServerVariables("HTTP_REFERER")
end if

if change<>"" then
typena=request("typename")
set rs=server.createobject("adodb.recordset")

sql="select * from videotype where typeid="&request("typeid")
rs.open sql,conn,1,3

rs("type")=typena
rs.update
rs.close
   set rs=nothing
   conn.close
   set conn=nothing
response.redirect Request.ServerVariables("HTTP_REFERER")
end if

if addname<>"" then
typer=request("type")
set rs=server.createobject("adodb.recordset")
rs.open "select * from videotype",conn,1,3
rs.addnew
rs("type")=typer
rs.update
rs.close
   set rs=nothing
   conn.close
   set conn=nothing
response.redirect Request.ServerVariables("HTTP_REFERER")
end if

if delet="" and change="" and addname="" then 
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0" align=center>
  <tr>
    <td width="100%" align=center colspan=2><b>电影分类管理:</b><br><br></td>
    <%set rs=server.createobject("adodb.recordset")
   sql="select * from videotype"
   rs.open sql,conn,1,3
  do while not rs.eof%>
  </tr>
  </form>
  <form method="POST" onsubmit action="admin_vsort.asp?typeid=<%=rs("typeid")%>">
    <tr>
      <td width="37%" align="right"><font color="#0066CC"><%=rs("type")%></font>　</td>
      <td><input onmouseover=this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6' onmouseout=this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF' type="text" name="typename" size="15" value=<%=rs("type")%>>&nbsp;
      <input onmouseover=this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6' onmouseout=this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF' type="submit" value="修改" name="change">
      <input onmouseover=this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6' onmouseout=this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF' type="submit" value="删除" name="delet"></td>
    </tr>
  </form>
  <% rs.movenext
      loop
      %>
  <form method="POST" onsubmit action="admin_vsort.asp?act=add">
  <tr>
  	<td colspan=2 height=30></td>
  </tr>
    <tr>
      <td colspan=2 align="center">新增：
      <input onmouseover=this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6' onmouseout=this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF' type="text" name="type" size="15">&nbsp;
      <input onmouseover=this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6' onmouseout=this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF' type="submit" value="新增" name="addname"></td>
    </tr>
  </form>
</table>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%><%response.write admin_bar(titt,2,"99%")
response.write ender()%>