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

📄 admin_movie.asp

📁 政府网站集成OA办公考勤新闻发布网站信息管理会员管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetMovie")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim totalpic,currentpage,totalpages,showye,founderr
Rem 判断数字是否整型
function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
end function
%>

<%
if request.form("MM_insert") then

if request.form("action")="newpic" then
sql="select * from a125_m_news"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim piccatid,picname,picurl,picpic,picext,picdesc,picisbest
piccatid=cint(request.form("piccatid"))
picname=WS_s.HX_Replace(trim(replace(request.form("name"),"'","")))
picurl=WS_s.HX_Replace(trim(replace(request.form("url"),"'","")))
picpic=WS_s.HX_Replace(trim(replace(request.form("pic"),"'","")))
picext=WS_s.HX_Replace(trim(replace(request.form("ext"),"'","")))
picdesc=WS_s.HX_Replace(trim(replace(request.form("desc"),"'","")))
picisbest=request.form("isbest")

 if picname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频标题!');history.back(1);</script>")
 else
  rs("pic_name")=picname
 end if
 if piccatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择视频所属分类!');history.back(1);</script>")
 else
  rs("piccat_id")=piccatid
 end if
 if picurl="" then
  rs("pic_url")="未知"
 else
  rs("pic_url")=picurl
 end if
 if picext="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写后缀名!');history.back(1);</script>")
 else
  rs("pic_ext")=picext
 end if
 if picpic="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频地址!');history.back(1);</script>")
 else
  rs("pic_pic")=picpic
 end if
 if picdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频的简要说明!');history.back(1);</script>")
 else
  rs("pic_desc")=picdesc
 end if
 if cint(picisbest)=1 then
  rs("isbest")=cint(picisbest)
 end if
  rs("pic_date")=Date()
 if founderr then
  call diserror()
  response.end
 else
  rs.update
  rs.close
  set rs=nothing
  	conn.Close
	Set conn=nothing
  response.redirect "admin_movie.asp?action=pic"
 end if
elseif request.form("action")="editpic" then
 if request.Form("id")="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
 else
  if not isInteger(request.form("id")) then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的id参数。');history.back(1);</script>")
  end if
 end if
 if founderr then
  call diserror()
  response.End
 end if
sql="select * from a125_m_news where id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
piccatid=cint(request.form("piccatid"))
picname=WS_s.HX_Replace(trim(replace(request.form("name"),"'","")))
picurl=WS_s.HX_Replace(trim(replace(request.form("url"),"'","")))
picpic=WS_s.HX_Replace(trim(replace(request.form("pic"),"'","")))
picext=WS_s.HX_Replace(trim(replace(request.form("ext"),"'","")))
picdesc=WS_s.HX_Replace(trim(replace(request.form("desc"),"'","")))
picisbest=request.form("isbest")

 if picname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频标题!');history.back(1);</script>")
 else
  rs("pic_name")=picname
 end if
 if piccatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择视频所属分类!');history.back(1);</script>")
 else
  rs("piccat_id")=piccatid
 end if
 if picurl="" then
  rs("pic_url")="未知"
 else
  rs("pic_url")=picurl
 end if
 if picext="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写后缀名!');history.back(1);</script>")
 else
  rs("pic_ext")=picext
 end if
 if picpic="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频地址!');history.back(1);</script>")
 else
  rs("pic_pic")=picpic
 end if
 if picdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写视频的简要说明!');history.back(1);</script>")
 else
  rs("pic_desc")=picdesc
 end if
rs("isbest")=cint(picisbest)
    rs("author")=LOGINUSERNAME
    rs("department")=LOGdepartment
    rs("writerid")=LOGINUid 
 if founderr then
  call diserror()
  response.end
 else
  rs.update
  rs.close
  set rs=nothing
	conn.Close
	Set conn=nothing
  response.redirect "admin_movie.asp?action=pic"
 end if

elseif request.form("action")="delpic" then
 if request.Form("id")="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
 else
  if not isInteger(request.form("id")) then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的id参数。');history.back(1);</script>")
  end if
 end if
 if founderr then
  call diserror()
  response.End
 end if
sql="select * from a125_m_news where id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
  rs.delete
  rs.close
	conn.Close
	Set conn=nothing  
  response.redirect "admin_movie.asp?action=pic"
end if

end if%>
<HTML><HEAD><TITLE>网站管理系统 - 视频展示管理</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) topmargin='20' leftmargin='0' bottommargin='0'>
<%
if request.querystring("action")="pic" then
    if WS_S.MemberPriv("WS_FrontSetadmin")=1 then
sql="select * from a125_m_news order by id desc"
if request.querystring("piccat_id")<>"" then
sql="select * from a125_m_news where piccat_id="&cint(request.querystring("piccat_id"))&" order by id desc"
end if
    else    
sql="select * from a125_m_news where writerid="&LOGINUid&" order by id desc"
if request.querystring("piccat_id")<>"" then
sql="select * from a125_m_news where piccat_id="&cint(request.querystring("piccat_id"))&" and writerid="&LOGINUid&" order by id desc"
end if    
    end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
totalpic=rs.recordcount
%>
<p align="center"><a href="admin_movie.asp?action=newpic">添加视频</a> | <a href="admin_movie.asp?action=pic">修改视频</a></p>
<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
 <table width='100%'  border='0' cellspacing='0' cellpadding='0'><form name="form3" method="post" action=""><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>视频列表</font></td>
    <td align="right" width="20%" colspan="4" style="padding-top:2px;" background='../hximages/titleline_2.gif'>
      <select style="margin:-3px" name="go" onChange='window.location=form.go.options[form.go.selectedIndex].value'>
			  <option value="">选择显示方式</option>
			  <option value="admin_movie.asp?action=pic">显示所有视频</option>
<%sql="select * from a125_movie"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
<option value="admin_movie.asp?action=pic&piccat_id=<%=rs2("piccat_id")%>"><%=rs2("piccat_name")%></option>
<%rs2.movenext
loop
if rs2.bof and rs2.eof then%><option value="">当前没有分类</option>
<%end if
rs2.close
set rs2=nothing%>
      </select>
    </td>
		</tr></form></table>
  <table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
     <tr bgcolor='#A1BBE0' class='td4'>
      <td width="40%" height="20" ><div align='center'>视频名称</div></td>
      <td width="30%" height="23"><div align='center'>管理</div></td>
     </tr>
<%
dim picperpage
picperpage=10

if not rs.eof then
rs.movefirst
rs.pagesize=picperpage
if trim(request("page"))<>"" then
   currentpage=clng(request("page"))
   if currentpage>rs.pagecount then
      currentpage=rs.pagecount
   end if
else
   currentpage=1
end if
   totalpic=rs.recordcount
   if currentpage<>1 then
       if (currentpage-1)*picperpage<totalpic then
	       rs.move(currentpage-1)*picperpage
		   dim bookmark
		   bookmark=rs.bookmark
	   end if
   end if
   if (totalpic mod picperpage)=0 then
      totalpages=totalpic\picperpage
   else
      totalpages=totalpic\picperpage+1
   end if
i=0
do while not rs.eof and i<picperpage

⌨️ 快捷键说明

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