<!--#include file="conn.asp"-->
<!--#include file="INC/Msgbox.asp"-->
<!--#INCLUDE FILE="inc/MD5.asp" -->
<%
on error resume next
dim sUserType

if session("user_type")<>"管理员" then
response.Redirect("../user/loginform.asp?url=../movie/admin.asp")
end if
%>
<title>左轮影音后台管理系统</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
body,tr,td
{
font-size:12px;
}
input{
width:100%;
}
#show
{
width:20px;
}

#playtype
{
width:20px;
}

#Submit
{
width:60px;

}
.STYLE1 {color: #FF0000}

-->
</style>

<table width="100%" height="100%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#3399EE">
  <tr bgcolor="#3399CC">
    <td height="145" colspan="2" bgcolor="#3399CC">&nbsp;</td>
  </tr>
  <tr bgcolor="#3399CC">
    <td width="150" align="center" valign="top" bgcolor="#3399CC"><table width="135" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
      <tr>
        <td width="125" align="center" bgcolor="#FFFFFF" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onClick="window.location.href='?edit='" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">电影列表</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF" onClick="window.location.href='?edit=addvodform'" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">增加电影</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF" onClick="window.location.href='?edit=addfileform'" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">增加文件</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF" onClick="window.location.href='?edit=modifypassform'" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">修改密码</td>
      </tr>
      <tr>
        <td align="center" bgcolor="#FFFFFF" onClick="window.location.href='?edit=quit'" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">退出管理</td>
      </tr>
    </table></td>
    <td align="left" valign="top" bgcolor="#FFFFFF">&nbsp;
<%
edit=request.QueryString("edit")
if edit="addvod" then
'把电影加入数据库
addvod
elseif edit="editvod" then
'修改电影
editvod
elseif edit="addvodform" then
'增加电影表单
vodform
elseif edit="editvodform" then
'修改电影表单
editvodform
elseif edit="addfile" then
'增加电影文件函数
addfile
elseif edit="editfile" then
'修改电影文件函数
editfile
elseif edit="addfileform" then
'增加电影文件表单
Vodfileform
elseif edit="editfileform" then
'修改电影文件表单
vodfileEditform
elseif edit="listvodfile" then
listvodfile
elseif edit="delvod" then
delvod
elseif edit="delvodfile" then
	delvodfile
elseif edit="modifypassform" then
    modifypassform
elseif edit="modifypass" then
	modifypass
elseif edit="quit" then
set session("user_type") = nothing
response.Redirect("../user/loginform.asp?url=../movie/admin.asp")
response.End()
else
listall
end if

function delvod()
id=request.QueryString("id")
if id="" or id=0 then
response.Write("非法请求！")
exit function
end if
delfile=request.QueryString("delfile")
sqlstr="delete from vod where id="&id
conn.execute sqlstr
if delfile="true" then
sqlstr="delete from vodfile where vodid="&Id
conn.execute sqlstr
response.redirect("admin.asp")
end if
end function

function delvodfile()
id=request.QueryString("id")
if id="" or id=0 then
response.Write("非法请求！")
exit function
end if

sqlstr="delete from vodfile where id="&Id
conn.execute sqlstr
pageurl = ".\admin.asp?edit=listvodfile&vodid="+request.QueryString("vodid")
response.redirect(pageurl)
end function

function addvod()
vodname=request.Form("vodname")
yanyuan=request.Form("yanyuan")
daoyan=request.Form("daoyan")
vodtype=request.Form("vodtype")
pic=request.Form("pic")
dengji=request.Form("dengji")
show=request.Form("show")
msg=request.Form("msg")
yuyan=request.Form("language")
if show=1 then
show=true
else
show =false
end if
if pic="pic/" or pic="" then
pic="pic/none.gif"
end if
strsql="insert into vod(vodname,yanyuan,daoyan,vodtype,pic,dengji,msg,show,yuyan)values('"&vodname&"','"&yanyuan&"','"&daoyan&"','"&vodtype&"','"&pic&"',"&dengji&",'"&msg&"',"&show&",'"&yuyan&"')"
conn.execute strsql

strsql="select top 1 [id] from vod order by id desc"
Set objRs = Server.CreateObject("ADODB.RECORDSET")
objRs.Open strsql, conn, 1, 1
Dim sId:sId = objRs("id")
objRs.Close()
Set objRs = nothing
Response.Redirect("admin.asp?edit=listvodfile&vodid="+CStr(sId))
end function

function GetLastIndex(str1, str2)
	Dim iLast
	iLast = 0	
	Dim iTemp
	iTemp = 1
	iStrlen = len(str1)
	while (iTemp <> 0)	
		iTemp = InStr(iLast+1, str1, str2)
		if iTemp <> 0 then
		iLast = iTemp
		end if
	wend
	GetLastIndex = iLast
end function

function editvod()
id=request.Form("id")
vodname=request.Form("vodname")
yanyuan=request.Form("yanyuan")
daoyan=request.Form("daoyan")
vodtype=request.Form("vodtype")
pic=request.Form("pic")
dengji=request.Form("dengji")
show=request.Form("show")
msg=request.Form("msg")
yuyan=request.Form("language")
if id="" or id=0 then
response.Write("非法请求")
exit function
end if
sqlstr="update vod set vodname='"&vodname&"',yanyuan='"&yanyuan&"',daoyan='"&daoyan&"',vodtype='"&vodtype&"',pic='"&pic&"',dengji="&dengji&",show="&show&",msg='"&msg&"',yuyan='"&yuyan&"' where id=" &id
response.Write("<br>编辑电影成功")
conn.execute sqlstr
end function

function addfile()
vodid=request.form("vodid")
if vodid<>0 then
playtype=request.form("playtype")
fileurl=replace(request.form("fileurl"),"\","/")
if (mid(fileurl,2,1) = ":") or (left(fileurl,2) = "//") then
fileurl = "file://"+fileurl
end if
startplace=request.form("startplace")
awAmount=request.form("awAmount")
FileAmount=request.form("FileAmount")
fileaw=Instr(fileurl,"(*)")
response.Write("<br>增加文件成功!<br />以下为加入的文件列表!<br />")
if fileaw=0 then

	iLast = GetLastIndex(fileurl, "/")	
	midname = mid(fileurl, iLast+1)
	iLast = GetLastIndex(midname, ".") 
	midname = left(midname, iLast-1)
	
	strsql="insert into vodfile(vodid,filename,fileurl,playtype)values("& vodid & ",'"& midname &"','" & fileurl & "'," & playtype&")"
	conn.execute strsql
	response.Write(fileurl&"<br>")
else
	startplace=startplace-1
	sfilename=left(fileurl,fileaw-1)
	endfilename=right(fileurl,len(fileurl)-fileaw-2)
	for i=0 to FileAmount-1
	startplace=startplace+1
	midname=Newfilename(awAmount,startplace)
	fileurl=sfilename&midname&endfilename
	strsql="insert into vodfile(vodid,filename,fileurl,playtype)values("& vodid & ",'"& midname &"','" & fileurl & "'," & playtype&")"
	conn.execute strsql
	response.Write(fileurl&"<br>")
	next
end if
Response.Write("<a href=""admin.asp?edit=addfileform&vodid="+vodid+""">【继续添加】</a>")
else
vodfileForm
end if
end function



function editfile()
id=request.Form("id")
if id="" or id=0 then
response.Write("非法请求！")
exit function
end if
vodid=request.form("vodid")
fileurl=request.form("fileurl")
fileurl=replace(fileurl,"\","/")
if (mid(fileurl,2,1) = ":") or (left(fileurl,2) = "//") then
fileurl = "file://"+fileurl
end if
playtype=request.form("playtype")

	iLast = GetLastIndex(fileurl, "/")	
	filename = mid(fileurl, iLast+1)
	iLast = GetLastIndex(filename, ".") 
	filename = left(filename, iLast-1)
	
sqlstr="update vodfile set vodid="&vodid&",filename='"&filename&"',fileurl='"&fileurl&"',playtype="&playtype&" where id="&id
'response.Write sqlstr
conn.execute sqlstr
response.Write("<br>编辑文件路径<br>"&fileurl)
if vodid<>0 then
response.Write("<br>编辑文件成功！")
end if
end function

Function Newfilename(filelong, numbers)
Dim tempname
If Len(CStr(numbers)) < filelong Then
 Do While Len(tempname) < filelong - Len(CStr(numbers))
    tempname = tempname & "0"
 Loop
End If
Newfilename = tempname & numbers
End Function

' 修改密码函数
Function ModifyPass()
	Dim sPassword:sPassword = MD5(Request.Form("password"))
	Dim sPassword2:sPassword2 = MD5(Request.Form("password2"))
	If (sPassword <> sPassword2) Then
		Response.Write("两次输入的密码不一致")
		Exit Function
	End If
	'连接数据库
	dim db
	db="..\User\data\UserDt.mdb"
	db=Server.MapPath(db)
	Set objUserConn = Server.CreateObject("ADODB.Connection")
	sConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
	objUserConn.open sConnStr
	
	'修改密码程序
	Dim sSql:sSql = "update [user] set [password]='"+sPassword+"' where userID='admin'"
	objUserConn.execute sSql
	
	'
	Response.Write("密码修改成功！")

End Function
%></td>
  </tr>
</table>
<%function listall()%>
<%
dim rs
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from vod order by id desc"
rs.open sqlstr,conn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#666666">
  <tr align="center" bgcolor="#3399CC">
    <td>序号</td>
    <td>电影名字</td>
    <td>电影类型</td>
    <td>文件列表</td>
    <td>修改</td>
    <td>删除</td>
  </tr>
  <%do until rs.eof%>
  <tr bgcolor="#FFFFFF">
    <td><%=rs("id")%></td>
    <td><%=rs("vodname")%></td>
    <td><%=rs("vodtype")%></td>
    <td align="center" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onclick="window.location.href='?edit=listvodfile&vodid=<%=rs("id")%>'" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">管理文件</td>
    <td align="center" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onclick="window.location.href='?edit=editvodform&id=<%=rs("id")%>'" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">修改</td>
    <td align="center" onclick="if(confirm('您确实要删除此影片吗？')){window.location.href='?edit=delvod&delfile=true&id=<%=rs("id")%>'}" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">删除</td>
  </tr>
  <%rs.movenext
  loop
  %>
  <tr bgcolor="#3399CC">
    <td colspan="6">&nbsp;</td>
  </tr>
</table>
<%end function%>
<%function vodForm%>
<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0">
  <form action="?edit=addvod"  method="post"><tr>
    <td colspan="3"><div align="center">增加电影</div></td>
  </tr>
  <tr>
    <td width="100">片名：</td>
    <td><input name="vodname" type="text" id="vodname"></td>
    <td width="12%">&nbsp;</td>
  </tr>
  <tr>
    <td width="100">主演：</td>
    <td><input name="yanyuan" type="text" id="yanyuan"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">导演：</td>
    <td><input name="daoyan" type="text" id="daoyan"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">类型：</td>
    <td><select name="vodtype" id="vodtype">
      <option value="喜剧片" selected>喜剧片</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>
    </select></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">图片：</td>
    <td><input name="pic" type="text" id="pic" value="pic/"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">等级：</td>
    <td><select name="dengji" id="dengji">
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5" selected>5</option>
    </select></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">显示：</td>
    <td><input name="show" type="checkbox" id="show" value="1" checked></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">语言：</td>
    <td><input name="language" type="text" id="language"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">简介：</td>
    <td><textarea name="msg" rows="20" id="msg" style="width:100%"></textarea></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="100">&nbsp;</td>
    <td><input name="id" type="hidden" id="id"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit"  id="Submit" name="Submit" value="提交">
      <input type="reset"  id="Submit" name="Submit" value="重置"></td>
    <td>&nbsp;</td>
  </tr></form>
</table>
<%end function%>
<%function editvodform
id=request.QueryString("id")
if id="" or id =0 then
vofForm
exit function
end if
dim rs,sqlstr
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from vod where id="&Id
rs.open sqlstr,conn,1,1
%>
<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0">
  <form action="?edit=editvod"  method="post"><tr>
    <td colspan="3">修改电影</td>
  </tr>
  <tr>
    <td width="21%">片名：</td>
    <td width="67%"><input name="vodname" type="text" id="vodname" value="<%=rs("vodname")%>"></td>
    <td width="12%">&nbsp;</td>
  </tr>
  <tr>
    <td>主演：</td>
    <td><input name="yanyuan" type="text" id="yanyuan" value="<%=rs("yanyuan")%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>导演：</td>
    <td><input name="daoyan" type="text" id="daoyan" value="<%=rs("daoyan")%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>类型：</td>
    <td><select name="vodtype" id="vodtype">
      <option value="喜剧片"<%if rs("vodtype")="喜剧片" then response.Write(" selected")%>>喜剧片</option>
      <option value="动作片"<%if rs("vodtype")="动作片" then response.Write(" selected")%>>动作片</option>
      <option value="科幻片"<%if rs("vodtype")="科幻片" then response.Write(" selected")%>>科幻片</option>
      <option value="恐怖片"<%if rs("vodtype")="恐怖片" then response.Write(" selected")%>>恐怖片</option>
      <option value="爱情片"<%if rs("vodtype")="爱情片" then response.Write(" selected")%>>爱情片</option>
      <option value="战争片"<%if rs("vodtype")="战争片" then response.Write(" selected")%>>战争片</option>
      <option value="故事片"<%if rs("vodtype")="故事片" then response.Write(" selected")%>>故事片</option>
      <option value="灾难片"<%if rs("vodtype")="灾难片" then response.Write(" selected")%>>灾难片</option>
      <option value="动画片"<%if rs("vodtype")="动画片" then response.Write(" selected")%>>动画片</option>
      <option value="搞笑片"<%if rs("vodtype")="搞笑片" then response.Write(" selected")%>>搞笑片</option>
      <option value="连续剧"<%if rs("vodtype")="连续剧" then response.Write(" selected")%>>连续剧</option>
    </select></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>图片：</td>
    <td><input name="pic" type="text" id="pic" value="<%=rs("pic")%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>等级：</td>
    <td><select name="dengji" id="dengji">
      <option value="1"<%if rs("dengji")=1 then response.Write(" selected")%>>1</option>
      <option value="2"<%if rs("dengji")=2 then response.Write(" selected")%>>2</option>
      <option value="3"<%if rs("dengji")=3 then response.Write(" selected")%>>3</option>
      <option value="4"<%if rs("dengji")=4 then response.Write(" selected")%>>4</option>
      <option value="5"<%if rs("dengji")=5 then response.Write(" selected")%>>5</option>
    </select></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>显示：</td>
    <td><input name="show" type="checkbox" id="show" value="1" checked></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>语言：</td>
    <td><input name="language" type="text" id="language" value="<%=rs("yuyan")%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>简介：</td>
    <td><textarea name="msg" id="msg"><%=rs("msg")%></textarea></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="id" type="hidden" id="id" value="<%=id%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit"  id="Submit" name="Submit" value="提交">
      <input type="reset"  id="Submit" name="Submit" value="重置"></td>
    <td>&nbsp;</td>
  </tr></form>
</table>
<%end function%>
<%function vodfileForm
vodid=request.QueryString("vodid")
%>
<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0">
  <form action="?edit=addfile"  method="post"><tr>
    <td colspan="3">增加文件</td>
  </tr>
  <tr>
    <td width="100">电影序号:</td>
    <td width="0"><input name="vodid" type="text" id="vodid" value="<%=vodid%>" maxlength="15"></td>
    <td width="400">&nbsp;</td>
  </tr>
  <tr>
    <td width="100">播放器类型:</td>
    <td width="0"><input name="playtype" id="playtype" type="radio" value="0" checked>
      rearplay</td>
    <td width="400">&nbsp;</td>
  </tr>
  <tr>
    <td width="100">文件地址:</td>
    <td width="0"><input name="fileurl" type="text" id="fileurl" value="dy" maxlength="250"></td>
    <td width="400">(*)为通配符,如“dy/(*).rm”</td>
  </tr>
  <tr>
    <td width="100">开始位置:</td>
    <td width="0"><input name="startplace" type="text" id="startplace" value="1" size="15" maxlength="15"></td>
    <td width="400"><p>表示采用通配路径时开始的位置，比如：3就是说从第3集开始。<br />
      【<span class="STYLE1">不使用通配符时请使用默认值</span>】</p>
      </td>
  </tr>
  <tr>
    <td width="100">通配数量:</td>
    <td width="0"><input name="awAmount" type="text" id="awAmount" value="0" size="15" maxlength="15"></td>
    <td width="400">表示通配数字的长度。比如 文件名 是 01，还是001，还是 0001。<br />
【<span class="STYLE1">不使用通配符时请使用默认值</span>】</td>
  </tr>
  <tr>
    <td width="100">文件个数:</td>
    <td width="0"><input name="FileAmount" type="text" id="FileAmount" value="1" size="15" maxlength="15"></td>
    <td width="400">从开始位置起，一共有多少个文件。<br />
【<span class="STYLE1">不使用通配符时请使用默认值</span>】</td>
  </tr>
  <tr>
    <td width="100">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="center">
    <td colspan="3"><input type="submit"  id="Submit" name="Submit" value="提交">    <input type="reset"  id="Submit" name="Submit" value="重置"></td>
  </tr></form>
</table>
<%end function%>
<%function vodfileEditForm%>
<%id=request.QueryString("id")
dim rs,sqlstr
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from vodfile where id =" & id
rs.open sqlstr,conn,1,1
%>
<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0">
  <form action="?edit=editfile"  method="post"><tr>
    <td colspan="3">修改文件</td>
  </tr>
  <tr>
    <td width="101">电影序号:</td>
    <td width="259"><input name="vodid" type="text" id="vodid" value="<%=rs("vodid")%>" maxlength="15"></td>
    <td width="110">&nbsp;</td>
  </tr>
  <tr>
    <td>播放类型:</td>
    <td><input name="playtype" id="playtype" type="radio" value="0"<%if rs("playtype")=0 then response.Write(" checked")%>>
      rp
        <input type="radio" name="playtype" id="playtype" value="1"<%if rs("playtype")=1 then response.Write(" checked")%>>        
    wmp</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>文件地址:</td>
    <td><input name="fileurl" type="text" id="fileurl" value="<%=rs("fileurl")%>" maxlength="250"></td>
    <td>(*)为通配符,如“dy/(*).rm”</td>
  </tr>
  <tr>
    <td>开始位置:</td>
    <td><input name="startplace" type="text" id="startplace" value="<%=rs("filename")%>" maxlength="15"></td>
    <td>无通配符时此项为文件名</td>
  </tr>
  <tr>
    <td>通配数量:</td>
    <td><input name="awAmount" type="text" id="awAmount" value="0" size="15" maxlength="15" disabled></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>文件个数:</td>
    <td><input name="FileAmount" type="text" id="FileAmount" value="1" size="15" maxlength="15" disabled></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><input name="id" type="hidden" id="id" value="<%=id%>"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="center">
    <td colspan="3"><input type="submit"  id="Submit" name="Submit" value="提交">    <input type="reset"  id="Submit" name="Submit" value="重置"></td>
  </tr></form>
</table>
<%
rs.close
set rs=nothing
end function%>


<%function modifypassform%>

<table width="100%"  border="0" align="center" cellpadding="5" cellspacing="1">
  <form action="?edit=modifypass" onsubmit='CheckPassForm();return false;' id="frmPassword" method="post"><tr>
    <td colspan="3"><div align="center">修改密码</div></td>
  </tr>
  <tr>
    <td width="101">新密码:</td>
    <td width="300"><input name="password" type="password" id="password" maxlength="15"></td>
    <td width="110">&nbsp;</td>
  </tr>
  <tr>
    <td>密码确认</td>
    <td width="300"><input name="password2" type="password" id="password2" maxlength="15" /></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><input name="id" type="hidden" id="id" value="<%=id%>"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr align="center">
    <td colspan="3"><input type="Submit"  id="Submit" name="Submit"  value="提交">    <input type="reset"  id="Submit" name="Submit" value="重置"></td>
  </tr></form>
</table>
<script language="javascript">
function CheckPassForm()
{
	if (frmPassword.password.value == "")
	{ 
		alert("请输入密码！");
		frmPassword.password.focus();
		return false;
	}
	
	if(frmPassword.password2.value == "")
	{
		alert("请确认您的密码！");
		frmPassword.password2.focus();
		return false;
	}
	
	if(frmPassword.password.value != frmPassword.password2.value)
	{
		alert("您两次输入的密码不一致！");
		frmPassword.password2.select();
		frmPassword.password2.focus();
		return false;
		
	}
	
	frmPassword.submit();
}
</script>
<%end function%>


<%function listvodfile%>
<%dim rs
vodid=request.QueryString("vodid")
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from vodfile where vodid=" & vodid & " order by filename"
rs.open sqlstr,conn,1,1
%>
<table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#666666">
  <tr align="center" bgcolor="#999999">
    <td>文件名</td>
    <td>电影ID</td>
    <td>路径</td>
    <td>播放器</td>
    <td>修改</td>
    <td>删除</td>
  </tr>
  <%do until rs.eof%>
  <tr align="center" bgcolor="#FFFFFF">
    <td height="27"><%=rs("filename")%></td>
    <td><%=rs("vodid")%></td>
    <td><%=rs("fileurl")%></td>
    <td><%=rs("playtype")%></td>
    <td onClick="window.location.href='?edit=editfileform&id=<%=rs("id")%>'">修改</td>
    <td align="center" onclick="if(confirm('您确实要删除此文件吗？')){window.location.href='?edit=delvodfile&id=<%=rs("id")%>&vodid=<%=rs("vodid")%>'}" style="cursor:hand;color:#FF0000;border:1px solid #ffffff" onmouseover="this.style.border='1px solid #ff0000';this.style.backgroundColor='#efefef'" onmouseout="this.style.border='1px solid #ffffff';this.style.backgroundColor='#ffffff'">删除</td>
  </tr>
  <%rs.movenext
  loop
  %>
  <tr align="center" bgcolor="#FFFFFF">
    <td colspan="6"><a href="#" onClick="window.location.href='?edit=addfileform&vodid=<%=vodid%>'">增加文件</a></td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end function%>
<%
conn.close
set conn=nothing
%>