⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 film_edit.asp

📁 视频点播系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
        </table>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from film_files where filmid='"&request.Querystring("id")&"' order by id",conn,1,1
if rs.eof then   
%>
<table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>该影片没有影片文件,请在上方增加</td>
  </tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
else
no=rs.recordcount   
for i=1 to no
%>
        <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="60">第<%=i%>集:</td>
            <td><input name="film_filename<%=i%>" type="text" class="input1" id="film_filename<%=i%>" value="<%=rs("filename")%>" size="32">
              <input name="Submit" type="button" class="button1" value="删除" onclick="self.location='<%=filename%>?action=del_file&id=<%=rs("id")%>&filmid=<%=request.Querystring("id")%>';">
</td>
          </tr>
<%
rs.movenext   
next   
rs.close
set rs=nothing
conn.close
set conn=nothing
end if   
%>
          <tr>
            <td colspan="2" id="upid"></td>
          </tr>
        </table>
        <table width="500" height="5" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td></td>
          </tr>
      </table></td>
  </tr>
</table>
<table width="550" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><input name="Submit" type="submit" class="button1" value="保存修改并进入下一步">
      <input name="id" type="hidden" id="id" value="<%=request.Querystring("id")%>"></td>
  </tr>
</table>
</form>
<%end sub%>
<%sub show_addfile()%>
<table width="440" height="25" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#F7F7F7">
	<form name="form2" method="post" action="<%=filename%>?action=save_addfile" target="_parent">
      <input name="film_filename" type="text" class="input1" id="film_filename" size="32">
      <input name="Submit" type="submit" class="button1" value="增加">
      <input name="id" type="hidden" id="id" value="<%=request.Querystring("id")%>">
      </form>
    </td>
  </tr>
</table>    
<%end sub%>
<%
sub save_addfile()
if request.form("film_filename")="" then
response.write"<script>alert('影片地址不能为空');history.back();</Script>"
response.end
end if
if request.form("id")="" or myobj.ChkNum(request.form("id"))=false then
response.write"<script>alert('影片ID值错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where id="&request.form("id")&"",conn,1,1
if rs.eof then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.write"<script>alert('该影片不存在');history.back();</Script>"
	response.end
else
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from film_files where (id is null)",conn,1,3
    rs.addnew
	rs("filename")=request.form("film_filename")
	rs("filmid")=request.form("id")
	rs.update
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
end if
response.write"<script>alert('影片文件增加成功');location.href = '"&filename&"?id="&request.form("id")&"';</Script>"
response.end
end sub
%>
<%
sub del_file()
if request.Querystring("id")="" or myobj.ChkNum(request.Querystring("id"))=false then
response.write"<script>alert('ID值错误');history.back();</Script>"
response.end
end if
if request.Querystring("filmid")="" or myobj.ChkNum(request.Querystring("filmid"))=false then
response.write"<script>alert('filmid值错误');history.back();</Script>"
response.end
end if
conn.execute "delete from film_files where id="&request.Querystring("id")&""
conn.close
response.write"<script>alert('影片文件删除成功');location.href = '"&filename&"?id="&request.Querystring("filmid")&"';</Script>"
response.end
end sub
%>
<%
sub save_film()
'#####判断影片ID值的正确性
if request.form("id")="" or myobj.ChkNum(request.form("id"))=false then
	response.write"<script>alert('影片ID值错误');history.back();</Script>"
	response.end
end if

'#####判断该ID值是否存在
set rs=server.createobject("adodb.recordset")
rs.open "select * from films where id="&request.form("id")&"",conn,1,1
if rs.eof then
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.write"<script>alert('该影片不存在');history.back();</Script>"
	response.end
else
var_err=rs("err") '查询该影片是否有错
end if
rs.close

if cbool(var_err)=true then
	if request.form("err")="" then
		response.write"<script>alert('该影片有用户报错,并且你没有勾选已修复选项');history.back();</Script>"
		response.end
	end if
end if

'################### 判断影片信息填写是否正确 ###################
if request.form("pathid")="" or myobj.ChkNum(request.form("pathid"))=false then
response.write"<script>alert('影片路径信息错误');history.back();</Script>"
response.end
end if
if request.form("film_name")="" then
response.write"<script>alert('请填写影片名称');history.back();</Script>"
response.end
end if
if request.form("film_director")="" then
response.write"<script>alert('请填写导演名称');history.back();</Script>"
response.end
end if
if request.form("film_player")="" then
response.write"<script>alert('请填写主要演员');history.back();</Script>"
response.end
end if
if request.form("film_class")="" then
response.write"<script>alert('影片分类值错误');history.back();</Script>"
response.end
end if
if request.form("film_from")="" or myobj.ChkNum(request.form("film_from"))=false then
response.write"<script>alert('影片产地值错误');history.back();</Script>"
response.end
end if
if request.form("film_level")="" or myobj.ChkNum(request.form("film_level"))=false then
response.write"<script>alert('推荐级别值错误');history.back();</Script>"
response.end
end if
if request.form("film_clear")="" or myobj.ChkNum(request.form("film_clear"))=false then
response.write"<script>alert('清晰度值错误');history.back();</Script>"
response.end
end if
if request.form("film_commend")="" then
response.write"<script>alert('请选择是否推荐该影片');history.back();</Script>"
response.end
end if
if request.form("film_money")="" or myobj.ChkNum(request.form("film_money"))=false then
response.write"<script>alert('所需影币值错误');history.back();</Script>"
response.end
end if
if request.form("play_level")="" then
response.write"<script>alert('允许播放的用户等级值错误');history.back();</Script>"
response.end
end if
if request.form("play_level")<>0 and request.form("play_level")<>1 and request.form("play_level")<>2 then
response.write"<script>alert('允许播放的用户等级值错误');history.back();</Script>"
response.end
end if
if request.form("down_level")="" then
response.write"<script>alert('允许下载的用户等级值错误');history.back();</Script>"
response.end
end if
if request.form("down_level")<>0 and request.form("down_level")<>1 and request.form("down_level")<>2 then
response.write"<script>alert('允许下载的用户等级值错误');history.back();</Script>"
response.end
end if
'#####取得该影片文件现有的总数
set rs=server.createobject("adodb.recordset")
rs.open "select * from film_files where filmid='"&request.form("id")&"' order by id",conn,1,1
if rs.eof then   
no=0
else
no=rs.recordcount   
end if
rs.close

'#######判断该影片是否存在影片文件
if request.form("film_filename"&no&"")="" then
	response.write"<script>alert('请为该影片增加影片文件');history.back();</Script>"
	response.end
end if

set rs=server.createobject("adodb.recordset")
rs.open "select * from films where id="&request.form("id")&"",conn,1,3
rs("pathid")=request.form("pathid")
rs("film_name")=request.form("film_name")
if request.form("other_name")<>"" then
rs("other_name")=request.form("other_name")
end if
rs("film_director")=request.form("film_director")
rs("film_player")=request.form("film_player")
rs("film_class")=request.form("film_class")
rs("film_from")=request.form("film_from")
rs("film_level")=request.form("film_level")
rs("film_clear")=request.form("film_clear")
rs("film_commend")=request.form("film_commend")
rs("film_money")=request.form("film_money")
rs("play_level")=request.form("play_level")
rs("down_level")=request.form("down_level")
rs("film_pic")=request.form("film_pic")
rs("film_gut")=request.form("film_gut")
if request.form("err")<>"" then
rs("err")=cbool(request.form("err"))
rs("err_info")=null
end if
rs.update
old_film_pic=rs("film_pic") '取得影片的海报路径
var_film_name=request.form("film_name") '取得影片文件名
rs.close

dim t
t=0
set rs=server.createobject("adodb.recordset")
rs.open "select * from film_files where filmid='"&request.form("id")&"'",conn,1,3
do while not rs.eof
t=t+1
rs("filename")=request.form("film_filename"&t&"")
rs.update
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"<script language=javascript>alert('影片修改成功');location.href = 'film_edit.asp?id="&request("id")&"';</Script>"
response.end
end sub
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -