<!-- #include file="include/onlogin.asp" -->
<!-- #include file="include/conn.asp" -->
<!-- #include file="include/csk3000_pagecute.asp" -->
<%
if trim(request.querystring("delid"))<>"" then
   conn.execute"delete from videourl where id="&request("delid")
   conn.close
   set conn=nothing
   response.redirect Request.ServerVariables("HTTP_REFERER")
end if

dim nsort,rs2,sql2,id,j,sqladd,cid,sid,ncid,nsid,nid,now_id,pageurl,ispic,data_name,nummer,ddim,genre,title,os,downtype,movie,error,good,free,adsid,sqla,rsa,rs1,rs4,upload_time
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(18,tit)
nsort="video":sqladd="":data_name="video"
cid=trim(request.querystring("c_id"))
sid=trim(request.querystring("s_id"))
if not(isnumeric(cid)) then cid=0
if not(isnumeric(sid)) then sid=0
cid=int(cid):sid=int(sid)
pageurl="?c_id="&cid&"&s_id="&sid&"&"

if trim(request.querystring("del_ok"))="ok" then
'response.write request.form("del_id")
'response.end
conn.execute("delete from videourl where nameid in("&request.form("del_id")&")")
  response.write del_select(request.form("del_id"))

end if

function del_select(delid)
  dim del_i,del_num,del_dim,del_sql,fobj,ispic
  if delid<>"" and not isnull(delid) then
    delid=replace(delid," ","")
    del_dim=split(delid,",")
    del_num=UBound(del_dim)
    for del_i=0 to del_num
      call upload_del(data_name,del_dim(del_i))
      del_sql="delete from video where id="&del_dim(del_i)
      conn.execute(del_sql)
    next
    Erase del_dim
    del_select=vbcrlf&"<script language=javascript>alert(""共删除了 "&del_num+1&" 条影片记录！"");</script>"
  end if
end function

id=trim(request.querystring("id"))
if action="hidden" and isnumeric(id) then
  sql="select "&action&" from "&data_name&" where id="&id
  set rs=conn.execute(sql)
  if not(rs.eof and rs.bof) then
    if rs(action)=true then
      sql="update "&data_name&" set "&action&"=0 where id="&id
    else
      sql="update "&data_name&" set "&action&"=1 where id="&id
    end if
    conn.execute(sql)
  end if
  rs.close
  action=""
end if
if action="good" and isnumeric(id) then
  sql="select "&action&" from "&data_name&" where id="&id
  set rs=conn.execute(sql)
  if not(rs.eof and rs.bof) then
    if rs(action)=true then
      sql="update "&data_name&" set "&action&"=0 where id="&id
    else
      sql="update "&data_name&" set "&action&"=1 where id="&id
    end if
    conn.execute(sql)
  end if
  rs.close
  action=""
end if
  titt="电影栏目"
response.write admin_bar(titt,1,"99%")

select case action
case "video_add"
  call video_add()
case "addserv"
  call addserv()
case "addsever"
  call addsever()
case "video_edit"
  call video_edit()
case "code"
  call code_main()
case "code_add"
  call code_add()
case "code_edit"
  call code_edit()
case "code_del"
  call code_del()
case else
  call video_main()
end select
response.write admin_bar("",2,"99%")
close_conn
response.write ender()


sub video_edit()
  dim sql3,rs3,id,csid,title,lang,remark,counter,hot,pic,where
  id=request.querystring("id")
  if not(isnumeric(id)) then call video_main():exit sub
%><table border=0 width=600 cellspacing=0 cellpadding=0>
<tr><td align=center height=300>
<%sql="select * from video where id="&id
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,3
  if rs.eof and rs.bof then
    rs.close:set rs=nothing
    call video_main():exit sub
  end if
  
  if trim(request.querystring("types"))="edit" then
    csid=trim(request.form("csid"))
    adsid=trim(request.form("adsid"))
    title=code_admin(request.form("title"))
    lang=code_admin(request.form("lang"))
    hot=code_admin(request.form("hot"))
    where=code_admin(request.form("where"))

    pic=request.form("pic")
    if len(pic)<3 then pic="no_pic.gif"
    
    remark=request.form("remark")
    counter=trim(request.form("counter"))

'response.write lang&where&request.form("movie")
'response.end

    if len(csid)<1 or var_null(title)="" then
      response.write("<font class=red_2>影片的类型、名称和影片地址不能为空！</font><br><br>"&go_back)
    else
      rs("c_id")=csid

	  if trim(request.form("username_my"))="yes" then rs("username")=login_username
      if trim(request.form("hidden"))="yes" then
        rs("hidden")=false
      else
        rs("hidden")=true
      end if
    if trim(request.form("good"))="yes" then
        rs("good")=true
      else
        rs("good")=false
      end if

      rs("title")=title
      rs("lang")=lang
      rs("remark")=remark
      rs("pic")=pic
    if trim(request.form("tim"))="yes" then rs("tim")=now_time
      'rs("tim")=now_time
rs("serverip")=request.form("serverip")
	rs("type")=request.form("movie")
	rs("howlong")=request.form("long")
	rs("where")=where
    rs("name")=request.form("name")
    rs("adsid")=request.form("adsid")

    if isnumeric(trim(request.form("emoney"))) then
      rs("emoney")=trim(request.form("emoney"))
    else
      rs("emoney")=0
    end if
    rs("power")=replace(replace(trim(request.form("power"))," ",""),",",".")

rs("hot")=hot
rs("ld")=request.form("ld")

     if isnumeric(counter) then rs("counter")=counter
      rs.update
      call upload_note(data_name,id)
      response.write "<font class=red>影片修改成功！</font><br><br><a href='?c_id="&cid&"&s_id="&sid&"'>点击返回</a>" & _
		     vbcrlf&"<meta http-equiv='refresh' content='" & objv7.web_var(web_num,5) & "; url=?c_id="&cid&"&s_id="&sid&"'>"
    end if
  else
    cid=int(rs("c_id")):hot=int(rs("hot")):lang=rs("lang"):where=rs("where"):adsid=rs("adsid")
    ispic=rs("pic"):pic=ispic
    if Instr(ispic,"/")>0 then ispic=right(ispic,len(ispic)-Instr(ispic,"/"))
    if Instr(ispic,".")>0 then ispic=left(ispic,Instr(ispic,".")-1)
    if ispic="no_pic" then ispic="n_"&id:pic=""
%><table border=0 width='100%' cellspacing=0 cellpadding=2>
  <tr><td colspan=2 height=50 align=center><font class=red>影片影片属性修改</font></td></tr>
<form name='add_frm' action="?action=video_edit&types=edit&id=<%response.write id%>" method=post>
<input type=hidden name=upid value=''>
  <tr><td width='15%' align=center>影片名称：</td><td width='85%'><input type=text name=title value='<%response.write rs("title")%>' size=60 maxlength=40><% response.write redx %></td></tr>
  <tr><td align=center>影片类型：</td><td><select name=csid size=1>
   <%
  sql3="select * from videotype order by typeid"
  set rs3=conn.execute(sql3)
  do while not rs3.eof
nid=int(rs3(0))
if cid=nid then
    response.write vbcrlf&"<option value='"&rs3("typeid")&"' class=bg_2 selected>"&rs3("type")&"</option>"
	else 
    response.write vbcrlf&"<option value='"&rs3("typeid")&"' class=bg_2>"&rs3("type")&"</option>"
end if
	rs3.movenext
  loop
  rs3.close:set rs3=nothing

%>
</select><% response.write redx %>&nbsp;<input type=checkbox name=hidden<%if rs("hidden")=false then response.write " checked"%> value='yes'>隐藏显示&nbsp;&nbsp;<input type=checkbox name=good<%if rs("good")=true then response.write " checked"%> value='yes'>首页推荐&nbsp;&nbsp;<input type=checkbox name=username_my value='yes'>&nbsp;<font alt='发布人：<%response.write rs("username")%>'>修改发布人为我</font><input type=checkbox name=tim value='yes'>&nbsp;修改时间</td>
  </tr>
  <tr><td align=center>影片信息：</td><td>语言类型： 
              <select name=lang size=1>
<option value='汉语'  <% if lang="汉语"  then response.write " selected"  %>>汉语</option>
<option value='粤语'   <% if lang="粤语" then response.write " selected"  %>>粤语</option>
<option value='日语'   <% if lang="日语" then response.write " selected"  %>>日语</option>
<option value='英语'   <% if lang="英语" then response.write " selected"  %>>英语</option>
<option value='韩语'  <% if lang="韩语" then response.write " selected"  %>>韩语</option>
<option value='法语'  <% if lang="法语" then response.write " selected"  %>>法语</option>
<option value='德语'  <% if lang="德语" then response.write " selected"  %>>德语</option>
<option value='俄语'  <% if lang="俄语" then response.write " selected"  %>>俄语</option>
<option value='其他'   <% if lang="其他" then response.write " selected"  %>>其他</option>
</select>&nbsp;&nbsp;&nbsp;推荐等级：<select name=hot size=1>
<option value='0'<% if hot=0 then response.write " selected" %>>没有等级</option>
<option value='1'<% if hot=1 then response.write " selected" %>>一星级</option>
<option value='2'<% if hot=2 then response.write " selected" %>>二星级</option>
<option value='3'<% if hot=3 then response.write " selected" %>>三星级</option>
<option value='4'<% if hot=4 then response.write " selected" %>>四星级</option>
<option value='5'<% if hot=5 then response.write " selected" %>>五星级</option>
<option value='99'<% if hot=99 then response.write " selected" %>>黄金通道</option>
</select> 播放广告：<select name=adsid size=1>
<option value='0' class=bg_2>不用广告</option><%sqla="select * from ads order by add=3"
   set rsa=conn.execute(sqla)
    if rsa.eof and rsa.bof then
    else
do while not rsa.eof
    nid=int(rsa(0))
 if rsa("asort")=adsid then
response.write vbcrlf&"<option value='"&rsa("asort")&"' class=bg_2 selected>"&rsa("asort")&"</option>"
	else 
response.write vbcrlf&"<option value='"&rsa("asort")&"' class=bg_2 >"&rsa("asort")&"</option>"
end if
	rsa.movenext
  loop
  rsa.close:set rsa=nothing
  end if
%>
</select>
</td></tr><tr>
            <td align=center>观看权限：</td>
            <td><%call chk_power(rs("power"),0)%></td>
          </tr>
  <tr>
            <td align=center>所需<%=objv7.web_var(web_config,8)%>：</td>
            <td><%call chk_emoney(rs("emoney"))%>&nbsp;&nbsp;影片产地：<select size="1" name="where">
          <option value="大陆" <% if where="大陆" then response.write " selected" %>>大陆</option>
          <option value="台湾" <% if where="台湾" then response.write " selected" %>>台湾</option>
          <option value="香港" <% if where="香港" then response.write " selected" %>>香港</option>
          <option value="日本" <% if where="日本" then response.write " selected" %>>日本</option>
          <option value="韩国" <% if where="韩国" then response.write " selected" %>>韩国</option>
          <option value="欧美" <% if where="欧美" then response.write " selected" %>>欧美</option>
          <option value="泰国" <% if where="泰国" then response.write " selected" %>>泰国</option>
          <option value="法国" <% if where="法国" then response.write " selected" %>>法国</option>
          <option value="德国" <% if where="泰国" then response.write " selected" %>>德国</option>
          <option value="俄罗斯" <% if where="俄罗斯" then response.write " selected" %>>俄罗斯</option>
          <option value="其他" <% if where="其他" then response.write " selected" %>>其他</option>
          <option value="未知" <% if where="未知" then response.write " selected" %>>出产地区</option>
          </select></td>
          </tr>
<tr>
            <td><div align="center">影片类别：</div></td>
            <td>[ <img src="images/video/real.gif" width="16" height="16"> <input type="radio" value="rm" name="movie" <%if rs("type")="rm" then response.write "checked" end if%>>  
              ]&nbsp; [ <img src="images/video/mov.gif" width="18" height="18"> <input type="radio" value="mov" name="movie" <%if rs("type")="mov" then response.write "checked" end if%>>  
              ]&nbsp; [<img src="images/video/media.gif" width="18" height="17"> <input type="radio" value="md" name="movie" <%if rs("type")="md" then response.write "checked" end if%>>
              ]&nbsp;&nbsp;&nbsp; </td>  
          </tr>

<td><div align="center">开放方式：</div></td>
<td> <input type="radio" value="1" name="ld" <%if rs("ld")=1 then response.write "checked" end if%>>在线观看 <input type="radio" value="0" name="ld"<%if rs("ld")=0 then response.write "checked" end if%>>影片下载 <input type="radio" value="2" name="ld" <%if rs("ld")=2 then response.write "checked" end if%>>即能观看也可下载</td>  
</tr>
  <tr><td align=center>影片主演：</td><td><input type=text name=name value='<%response.write rs("name")%>' size=50 maxlength=50>&nbsp;&nbsp;&nbsp;影片人气：<input type=text name=counter value='<%response.write rs("counter")%>' size=4 maxlength=10></td></tr>
<%set rs1=server.createobject("adodb.recordset")
    sql="select * from video_sev where id="&rs("serverip")
    rs1.open sql,conn,1,1
   
%>
<%
dim rsurl,no,idno
idno=trim(request("id"))
sql="select * from videourl where nameid="&idno
'set rsurl=conn.execute(sql)
set rsurl=server.createobject("adodb.recordset")
rsurl.open sql,conn,1,3

            set rs4=server.createobject("adodb.recordset")
            rs4.open "select * from video_sev",conn,1,1
           
if rsurl.bof and rsurl.eof then
response.write "<tr><td></td><td>没有影片提供观看</td></tr>"
else
no=rsurl.recordcount
'response.write no
'response.end
for i=1 to no
%><tr><td width="114" bgcolor="#FFFFFF" align="center">在线观看：</td>
<td bgcolor="#FFFFFF" width="507" colspan="2">
<input type="text" nameurl="url<%=i%>" value="<%=rsurl("url")%>" size="50"> 第<%=i%>集
<%
if request("free")=1 then
sql="update videourl set free=0 where nameid="&request("id")&" and url='"&request("url")&"'"
conn.execute(sql)
else
sql="update videourl set free=1 where nameid="&request("id")&" and url='"&request("url")&"'"
conn.execute(sql)
end if
%>
<a title="修改" href='admin_video.asp?action=video_edit&id=<%response.write id%>&free=<%=rsurl("free")%>&url=<%=rsurl("url")%>'><%
if rsurl("free")=0 then
      response.write "收费"
    else
      response.write "<font class=red_2>免费</font>"
    end if
%></a>
<a title="地址不能修改请删除" href="?delid=<%=rsurl("id")%>"><font color="#FF0000">删除</font></a><font color="#FF0000">(不能修改请删)</font></td></tr>
<%rsurl.movenext
next
end if
rsurl.close
set rsurl=nothing
%><tr><td width="114" bgcolor="#FFFFFF" align="center">增加地址：</td>
<td nowrap><select size="1" name="serverip"><%dim i
i=1
do while not rs4.eof%><option value="<%=rs4("id")%>" <%if rs4("id")=rs("serverip") then%> selected <%end if%>><%=rs4("ipsip")%><%=rs4("movie")%></option>
<%i=i+1
rs4.movenext
      loop
      rs4.close
      set rs4=nothing%></select><iframe width="200" height="22" noresize target="main" border="0" rows="64,*" frameborder="0" scrolling="no" framespacing="0" src="video_addurl.asp?id=<%=request("id")%>"></iframe></td></tr>
  <tr height=35><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb("add_frm","remark","&nbsp;&nbsp;")%></td></tr>
  <tr><td align=center valign=top><br>影片备注：</td><td><%response.write("<textarea rows=6 name=remark cols=70>"&rs("remark")&"</textarea>")%></td></tr>
  <tr><td align=center>影片长度：</td><td><input type=text name=long value='<%response.write rs("howlong")%>' size=12>
&nbsp;图片：<input type=test name=pic value='<% if ispic<>"no_pic.gif" then response.write pic %>' size=30>&nbsp;<a href='upload.asp?uppath=video&upname=<%response.write ispic%>&uptext=pic' target=upload_frame>上传图片</a>&nbsp;&nbsp;<a href='upload.asp?uppath=video&upname=n&uptext=remark' target=upload_frame>上传至内容</a></td></tr>
  <tr><td align=center>上传图片：</td><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=video&upname=<%response.write ispic%>&uptext=pic'></iframe></td></tr>
  <tr height=30><td></td><td><input type=submit value=' 提 交 修 改 '></td></tr>
</form></table><%
  end if
  rs.close:set rs=nothing
%></td></tr></table><%
end sub

sub video_add()
%>
<% if request("serverip")="" then
response.write"<script>alert('请你回去选择电影服务器');history.back();</Script>"
response.end
end if
%>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<tr><td align=center height=300><%
if request.querystring("types")="add" then
  dim csid,title,pic,sql1,no,url,vid
no=request.form("no")
  csid=trim(request.form("cid"))
  adsid=trim(request.form("adsid"))
  title=code_admin(request.form("title"))
  pic=request.form("pic")

  if len(pic)<3 then pic="no_pic.gif"

  if len(csid)<1 or var_null(title)="" or request.form("movie")="" then
    response.write("<font class=red_2>影片的类型、名称、格式和影片地址不能为空！</font><br><br>"&go_back)
  else

    sql="select * from video"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("serverip")=request.form("serverip")
	rs("type")=request.form("movie")
    rs("c_id")=csid
    rs("adsid")=adsid
    rs("title")=title
    rs("username")=login_username
    rs("lang")=request.form("lang")
	rs("howlong")=request.form("long")
	rs("where")=request.form("where")
	rs("remark")=request.form("remark")
rs("name")=request.form("name")
    rs("hidden")=true


    if isnumeric(trim(request.form("emoney"))) then
      rs("emoney")=trim(request.form("emoney"))
    else
      rs("emoney")=0
    end if
    rs("power")=replace(replace(trim(request.form("power"))," ",""),",",".")
if request.form("hot")="yes" then
rs("good")=1
rs("hot")=5
elseif request.form("hot")="gold" then
rs("good")=1
rs("hot")=99
else
rs("hot")=request.form("hot")
end if
rs("ld")=request.form("ld")
    rs("pic")=pic
    rs("tim")=now_time
    rs("counter")=0

    rs.update
	vid=rs("id")
    rs.close

set rs=server.createobject("adodb.recordset")
sql1="select * from videourl where (id is null)"
rs.open sql1,conn,1,3
for i=1 to no
rs.addnew
url=request.form("url"&i&"")
rs("nameid")=vid
rs("url")=url
rs.update
next
rs.close
set rs=nothing
    call upload_note(data_name,first_id(data_name))
    response.write "<font class=red>影片添加成功！</font>&nbsp;<a href='?c_id="&cid&"'>点击返回</a><br><br><a href='?c_id="&cid&"&action=addsever'>点击继续添加</a>" & _
		   VbCrLf&"<meta http-equiv='refresh' content='" & objv7.web_var(web_num,5) & "; url=?c_id="&cid&"&action=addsever'>"
  end if
else
%>
<table border=0 width='98%' cellspacing=0 cellpadding=2>
<form name='add_frm' action='?action=video_add&types=add' method=post>
<input type=hidden name=upid value=''>
  <tr><td width='15%' align=center>影片名称：</td><td width='85%'><input type=text name=title size=70 maxlength=40><% response.write redx %></td></tr>
  <tr><td align=center>影片类型：</td><td>
  <select name=cid size=1>
  <%
  sql="select * from videotype order by typeid"
  set rs=conn.execute(sql)
  do while not rs.eof
    response.write vbcrlf&"<option value='"&rs("typeid")&"' class=bg_2>"&rs("type")&"</option>"
	rs.movenext
  loop
  rs.close:set rs=nothing
%>
</select>
<% response.write redx %></td></tr>
  <tr>
            <td align=center>影片信息：</td>
            <td>语言类型： 
              <select name=lang size=1>
<option value='汉语'>汉语</option>
<option value='粤语'>粤语</option>
<option value='日语'>日语</option>
<option value='英语'>英语</option>
<option value='韩语'>韩语</option>
<option value='法语'>法语</option>
<option value='德语'>德语</option>
<option value='俄语'>俄语</option>
<option value='其他'>其他</option>
</select>	
			
			
			&nbsp;&nbsp;&nbsp;推荐等级：<select name=hot size=1>
<option value='yes'>推荐显示</option>
<option value="gold">黄金通道</option>
<option value='5'>五星级</option>
<option value='4'>四星级</option>
<option value='3'>三星级</option>
<option value='2'>二星级</option>
<option value='1'>一星级</option>
</select>  播放广告：<select name=adsid size=1>
<option value='0' class=bg_2>不用广告</option>
   <%
  sqla="select * from ads order by aid"
  set rsa=conn.execute(sqla)
  do while not rsa.eof
    response.write vbcrlf&"<option value='"&rsa("asort")&"' class=bg_2>"&rsa("asort")&"</option>"
	rsa.movenext
  loop
  rsa.close:set rsa=nothing
%>
</select></td>
          </tr>

		  <tr>
            <td><div align="center">观看权限：</div></td>
            <td><%call chk_power("",1)%></td>  
          </tr>
  <tr>
            <td align=center>所需货币：</td>
            <td><%call chk_emoney(0)%>&nbsp;&nbsp;影片产地：<select size="1" name="where">
          <option value="大陆">大陆</option>
          <option value="台湾">台湾</option>
          <option value="香港">香港</option>
          <option value="日韩">日本</option>
          <option value="韩国">韩国</option>
          <option value="欧美">欧美</option>
          <option value="泰国">泰国</option>
          <option value="法国">法国</option>
          <option value="德国">德国</option>
          <option value="俄罗斯">俄罗斯</option>
          <option value="其他">其他</option>
          <option value="未知" name="where">出产地区</option>
          </select></td>
          </tr>
<tr>
            <td><div align="center">影片类型：</div></td>
            <td>[ <img src="images/video/real.gif" width="16" height="16"> 
            <input type="radio" value="rm" name="movie" checked>  
              ]&nbsp; [<img src="images/video/mov.gif" width="18" height="18"> <input type="radio" value="mov" name="movie">
              ]&nbsp; [<img src="images/video/media.gif" width="17" height="17"> <input type="radio" value="md" name="movie">
              ]&nbsp;&nbsp;&nbsp; </td>  
          </tr>
<tr>
<td><div align="center">开放方式：</div></td>
<input type="hidden" name="serverip" size="13" class="smallinput" maxlength="15" value="<%=request("serverip")%>">
<%set rs=server.createobject("adodb.recordset")
   sql="select * from video_sev where id="&request("serverip")
    rs.open sql,conn,1,1
%>
<td> <input type="radio" value="1" name="ld" checked>在线观看 <input type="radio" value="0" name="ld">影片下载 <input type="radio" value="2" name="ld">即能观看也可下载</td>  
</tr>
   <tr><td align=center>影片主演：</td><td><input type=text name=name value='无' size=50 maxlength=50></td></tr>
<script language="javascript">
function setid()
{
str='';
if(!window.add_frm.no.value)
window.add_frm.no.value=1;
for(i=1;i<=window.add_frm.no.value;i++)
str+='&nbsp;&nbsp;&nbsp;影片地址：&nbsp;<%=rs("ipsip")%><%=rs("movie")%>&nbsp;<input type="text" name="url'+i+'" class="button" style="padding-left:1pt"  size=15 value="'+window.add_frm.no1.value+''+i+''+window.add_frm.no2.value+'"><select name="free'+i+'" class="button" style="padding-left:1pt"  size=1 value=""><option value="0">收费</option><option value="1">免费</option></select>&nbsp;第'+i+'集<BR>';
window.upid.innerHTML=str+'<br>';
}
</script>
 <tr><td align=center>影片地址：</td><td><input type="text" name="no1" class="button" value="" size="32">集数<span lang="en-us"> </span> <input type="text" name="no" class="button" value="2" size="2">格式<input type="text" name="no2" class="button" value=".rm" size="5"> .wmv .rmvb
                  <input type="button" name="Button" class="buttonface" onclick="setid();" value="设定"> 
                  (在点击“设定”按钮后才可输入影片对应地址) <% response.write redx %>
				  </td></tr>
               <tr>
                  <td colspan="2" id="upid" width="564"></td>
                </tr>

  <tr height=35<%'response.write format_table(3,1)%>><td align=center><%call frm_ubb_type()%></td><td><%call frm_ubb("add_frm","remark","&nbsp;&nbsp;")%></td></tr>
  <tr><td valign=top align=center><br>影片备注</td><td><textarea rows=6 name=remark cols=70></textarea></td></tr>
  <tr><td align=center>影片长度：</td><td><input type=text name=long size=12 value='90分钟'>&nbsp;&nbsp;&nbsp;&nbsp;图片：<input type=test name=pic size=28>&nbsp;&nbsp;&nbsp;<a href='upload.asp?uppath=video&upname=<%response.write ispic%>&uptext=pic' target=upload_frame>上传图片</a>&nbsp;&nbsp;<a href='upload.asp?uppath=video&upname=n&uptext=remark' target=upload_frame>上传至内容</a></td></tr>
  <tr><td align=center>上传文件：</td><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='upload.asp?uppath=video&upname=<%response.write ispic%>&uptext=pic'></iframe></td></tr>
  <tr height=30><td></td><td><input type=submit value=' 提 交 添 加 '></td></tr>
</form></table><%
  end if
%></td></tr></table><%
end sub

sub video_main()
  dim rssum,thepages,page,viewpage,del_temp
%>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<tr align=center height=300 valign=top><td width=120 class=htd>
<%
  sql="select * from videotype order by typeid"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=int(rs(0))
    if cid=nid then
      response.write vbcrlf&"&nbsp;<img src=""images/video/box.gif"" width=""12"" height=""11"" border=""0"">&nbsp;<a href='?c_id="&nid&"'><b><font class=red_3>"&rs(1)&"</b></font></a><br>"
    else
      response.write vbcrlf&"&nbsp;<img src=""images/video/box1.gif"" width=""12"" height=""11"" border=""0"">&nbsp;<a href='?c_id="&nid&"'><font class=red_3>"&rs(1)&"</font></a><br>"
    end if
    rs.movenext
  loop
  rs.close
%>
</td><td width=680>
<table border=1 width='100%' cellspacing=0 cellpadding=1 bordercolorlight=#C0C0C0 bordercolordark=#FFFFFF>
<script language=javascript src='style/admin_del.js'></script>
<form name=del_form action='<%response.write pageurl%>del_ok=ok&dtype=video' method=post><%
if trim(request.querystring("type"))<>"" then
title=request("title")
   if request("name")="name" then
sqladd=" where title like '%"&request("title")&"%'"
   else
sqladd=" where title like '%"&request("title")&"%'"
   end if
elseif cid<>0 then
    sqladd=" where c_id="&cid
  end if
  sql="select id,c_id,title,hot,hidden,error,good from video"&sqladd&" order by tim desc"
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=int(rs.recordcount)
  end if
  nummer=19
  if rssum mod nummer > 0 then
    thepages=rssum\nummer+1
  else
    thepages=rssum\nummer
  end if
  page=trim(request.querystring("page"))
  if not(isnumeric(page)) then page=1:viewpage=1
  if int(page)>thepages then
    viewpage=1
  else
    viewpage=page
  end if
  del_temp=nummer
  if rssum=0 then del_temp=0
  if int(page)=int(thepages) then
    del_temp=rssum-nummer*(thepages-1)
  end if
  response.write vbcrlf&"<tr><td colspan=3 align=center>共有&nbsp;<font class=red>"&rssum&"</font>&nbsp;个影片&nbsp;┋&nbsp;共<font class=red>"&thepages&"</font>页&nbsp;┋&nbsp;这是第<font class=red>"&viewpage&"</font>页&nbsp;┋&nbsp;<a href='"&pageurl&"action=addsever'>添加影片</a>&nbsp;&nbsp;</td></tr>" & _
	         vbcrlf & "<tr><td colspan=3 align=center>分页:"&jk_pagecute(nummer,thepages,viewpage,pageurl,6,"#ff0000") & _
	         "　<input type=checkbox name=del_all value=1 onClick=selectall('"&del_temp&"')> 选中所有　<input type=submit value='删除所选' onclick=""return suredel('"&del_temp&"');""></td></tr>" & _
	         vbcrlf&"<tr align=center bgcolor=#ffffff><td width='8%'>序号</td><td width='65%'>类型和名称</td><td width='27%'>操作</td></tr>"
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
    now_id=rs("id"):nid=int(rs("hot")):ncid=rs("c_id"):error=rs("error")

    response.write vbcrlf&"<tr align=center><td>"&(viewpage-1)*nummer+i&"</td><td align=left><a href='?action=video_edit&id="&now_id&"'>"&rs("title")&"</a></td><td align=right><a title=是否显示或者隐藏 href='?action=hidden&c_id="&cid&"&id="&now_id&"&page="&viewpage&"'>"

    if rs("hidden")=true then
      response.write "显</a> "
    else
      response.write "<font class=red_2>隐</font></a> "
    end if
    if rs("good")=true then
    good="<a title=是否推荐 href='?action=good&c_id="&cid&"&id="&now_id&"&page="&viewpage&"'><font class=red>推荐</font></a>"
    else
    good="<a title=是否推荐 href='?action=good&c_id="&cid&"&id="&now_id&"&page="&viewpage&"'><font class=#C0C0C0>普通</font></a>"
    end if
    response.write "<font class=yellow>"&nid&"</font>&nbsp;星&nbsp;<font class=red>"&error&"</font>&nbsp;错&nbsp;"&good&"<input type=checkbox name=del_id value='"&now_id&"'></td></tr>"
    rs.movenext
  next
  rs.close:set rs=nothing
%></form><form method=POST action=?type=fing>
<tr align=center bgcolor=#ffffff><td width='8%' height="0">查找</td>
  <td><input value="<%=request("title")%>" type=text name=title size=31>名称<input type="radio" value="name" checked name="name">地址<input type="radio" value="http" name="name"></td>
  <td><input type=submit value=查找电影 name=titlee></td></tr></form></table></td></tr></table>
<%
end sub
%>
<%sub addserv()
if request("changemovie")<>"" and request("id")<>"1" then
sql="update video_sev set movie='"&trim(request("movie"))&"',ipsip='"&trim(request("ipsip"))&"',say='"&trim(request("say"))&"',down='"&trim(request("down"))&"' where id="&request("id")
conn.execute(sql)
end if
if request("addmovieip")<>"" then
 sql="insert into video_sev(movie,ipsip,say,down) " & _
"values('"&trim(request("movie"))&"','"&trim(request("ipsip"))&"','"&trim(request("say"))&"','"&trim(request("down"))&"')"
conn.execute(sql)
end if
if request("deletserver")<>"" and request("id")<>"1" then
conn.execute"delete from video_sev where id="&request("id")
end if
%>
  <center>
  <table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber1" height="111" bordercolorlight="#C0C0C0" bordercolordark="#F7F7F7">
    <tr>
      <td width="100%" bgcolor="#F7F7F7" height="13" colspan="2">
      <p align="center"><b><font size="2">&nbsp;电影服务器列表<font color="#C0C0C0">(第一个空白服务器不能删除~)</font></font></b></td>
    </tr>
          <form method="POST" onsubmit action="admin_video.asp?action=addserv"><tr onmouseover="javascript:this.bgColor='#EDEDED';" onmouseout="javascript:this.bgColor='#FFFFFF';">
        <td width="100%" height="21" colspan="2">新增服务器<font size="2">:<br>在線:<input type="text" name="ipsip" size="25">目錄</font><input type="text" name="movie" size="20">说明<input type="text" name="say" size="20"><span lang="en-us">
        </span><font size="2">下載:<input type="text" name="down" size="25"></font><input type="submit" value="新增" name="addmovieip"><font size="2"><br>　</font></td>
      </form>
    <tr>
      <%set rs=server.createobject("adodb.recordset")
    rs.open "select * from video_sev",conn,1,1
    i=1
    do while not rs.eof
    %>
      <form method="POST" onsubmit action="admin_video.asp?action=addserv&id=<%=rs("id")%>"><tr onmouseover="javascript:this.bgColor='#lsdkjhdfgdf';" onmouseout="javascript:this.bgColor='#EDEDED';">
        <td width="3%" height="10">第<%=i%> 服务器:</td>
        <td width="125%" height="11" rowspan="4" align="left" nowrap bordercolorlight="#FF0000" bordercolordark="#FF00FF">目錄<input type="text" name="movie" size="22" value="<%=rs("movie")%>">说明<input type="text" name="say" size="22" value="<%=rs("say")%>"><span lang="en-us">
        </span><input type="submit" value="修改" name="changemovie"><span lang="en-us">
        </span><font size="2">
        <input type="submit" value="删除" name="deletserver"></font></td></tr><tr>
<td width="25%" height="1" align="left" valign="top">在線<input type="text" name="ipsip" size="25" value="<%=rs("ipsip")%>" style="color: #008000"></td>
    </tr>
    <tr>
<td width="3%" height="20" align="left" valign="baseline">下載<input type="text" name="down" size="25" value="<%=rs("down")%>" style="color: #0000FF"></td>
    </tr>
    <tr>
      <td width="100%" height="3" colspan="2" bordercolorlight="#FF00FF" bordercolordark="#FFFFFF"></td>
    </tr></form>
    <% 
      i=i+1
      rs.movenext
      loop
      %>
    </form>
    <tr>
      <td width="100%" height="16" colspan="2"></td>
    </tr>
    <tr>
      <td width="100%" height="16" colspan="2">
      <p align="center">第一个空白服务器不能删除~</td>
    </tr>
  </table>
  </center>
</div><%end sub%>
<%sub addsever%>
<div align="center">
<center>
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber1" height="129" bordercolorlight="#C0C0C0" bordercolordark="#F7F7F7">
    <tr>
      <td width="100%" bgcolor="#F7F7F7" height="21" colspan="2">
          <form method="POST" onsubmit action="admin_video.asp?action=video_add">
<p align="right"><b>&nbsp;选择电影服务器&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b><font size="2"><input type="submit" value="下一步" name="change"></font></td>
    </tr>
      <tr>
        <%set rs=server.createobject("adodb.recordset")
    rs.open "select * from video_sev",conn,1,1
    i=1
    do while not rs.eof
    %><tr onmouseover="javascript:this.bgColor='#EDEDED';" onmouseout="javascript:this.bgColor='#FFFFFF';">
<td width="50%" height="37"><input type="radio" value="<%=rs("id")%>" name="serverip" checked>第<%=i%>服务器:<br>在線<%=rs("ipsip")%><%=rs("movie")%> </td>
<td width="30%" height="37">说明:<%=rs("say")%></td></tr><tr onmouseover="javascript:this.bgColor='#EDEDED';" onmouseout="javascript:this.bgColor='#FFFFFF';">
      <td width="50%" height="17">下載<%=rs("down")%><%=rs("movie")%></td>
<td width="30%" height="17"></td>
</tr><tr><td></td>
</tr>
<%i=i+1
rs.movenext
loop%>
<tr><td width="100%" colspan="2" height="21">
  <p align="right"><font size="2"><input type="submit" value="下一步" name="change"></font></td></tr></form><tr>
    <td width="100%" colspan="2" height="16"></td></tr> </table></center></div>
<%end sub%>