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

📄 listsort.asp

📁 一个最新版的VOD网站程序
💻 ASP
字号:
<!--#include file="check.asp" -->
<%
dim username
MaxPerPage=10 
username    = Request.Item ("username")
filename="listsort.asp"
dim msearchword
msearchword=Request("search")
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
link=""
%>
<%
   dim rs
   dim sql   
   dim BoardIDList

   set rs=server.createobject("adodb.recordset")
   
   if request("action")="del" then
	    boardIDlist=request("selBoard")
	    if boardIDlist="" then
	       response.write "<center>对不起,请选择要删除的类别信息。</center>"
	    else
	       boardIDlist="("+boardIDlist+")"
           sql="delete from sort where sortid in "&boardidlist
           rs.open sql,conn,3,3
           
           sql="delete from listvod where vodsortid in "&boardidlist
           rs.open sql,conn,3,3
          
          
	       if err.number<>0 then
	          response.write "<p><center>删除类别信息失败,数据库不能操作:"&err.Description &"</center></p>"
	          err.clear 
	       else
	          response.write "<p><center>删除类别信息成功。"&boardIDlist&"</center></p>"
	        end if
	   end if
	   end if
%>


<html>
<head>
<title>添加目录</title>
<LINK href="css/netoa.css" rel=STYLESHEET 
type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="80%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr bgcolor="#0099CC"> 
    <td align=middle height=25 style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FFFFFF">目录列表</font></td>
  </tr>
</table>
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <hr>
    </td>
  </tr>
</table>
<form method="post" action="listsort.asp" id=form1 name=form1>
  <table width="500" border="0" cellspacing="4" cellpadding="0" align="center">
    <tr bgcolor="#FFFFFF"> 
      <td width="471" height="6"> <font color="#000099">根据部门查询:</font> 
        <input type="text" name="username" size="15" maxlength="15">
      </td>
      <td width="30" height="6">&nbsp;</td>
      <td width="148" height="6"> 
        <input type="submit" name="Submit" value="提交">
        
      </td>
  </tr>
</table>
</form>
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <hr>
    </td>
  </tr>
</table>
<%                                     
  
   dim totalPut               
   dim CurrentPage            
   dim TotalPages            
   dim i,j 
sql="select * from sort where sortid<>'' "   

if username<>"" then
sql=sql & " and sortname like '%"&username&"%'" 
link= link & "&username="&username&""
end if
sql= sql & " order by sortdate desc;" 
Set rs= Server.CreateObject("ADODB.Recordset") 
'response.Write sql
'Response.End
            
rs.open sql,conn,1,1            
  if rs.eof and rs.bof then            
       response.write "<p align='center'>还没有任何类别信息!</p>"            
   else            
	  totalPut=rs.recordcount            
      totalPut=rs.recordcount            
      if currentpage<1 then            
          currentpage=1            
      end if            
      if (currentpage-1)*MaxPerPage>totalput then            
	   if (totalPut mod MaxPerPage)=0 then            
	     currentpage= totalPut \ MaxPerPage            
	   else            
	      currentpage= totalPut \ MaxPerPage + 1        
	   end if            
            
      end if            
    if currentPage=1 then
     showpage totalput,MaxPerPage,"listsort.asp"                      
      showContent            
     showpage totalput,MaxPerPage,"listsort.asp"            
                    
       else            
				  if (currentPage-1)*MaxPerPage<totalPut then            
				    rs.move  (currentPage-1)*MaxPerPage            
				    dim bookmark            
				    bookmark=rs.bookmark    
				        'showpage totalput,MaxPerPage,"listsort.asp"                  
						 showContent            
				     showpage totalput,MaxPerPage,"listsort.asp"            
				else            
				    currentPage=1      
				   'showpage totalput,MaxPerPage,"listsort.asp"                
				 	   showContent            
				   showpage totalput,MaxPerPage,"listsort.asp"            
				  end if            
	   end if            
   rs.close            
   end if            
	                    
   set rs=nothing             
    
%>    

<%    
   sub showContent            
%>
<form method="POST" action="listsort.asp?action=del" name="frmBoardDel">
<table width="80%" border="1" cellspacing="4" cellpadding="0" align="center" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
  <tr> 
    <td height="15" width="9%">id</td>
    <td height="15" width="21%">类名</td>
    <td height="15" width="43%">简介</td>
    <td height="15" width="15%">时间</td>
    <td height="15" width="12%">点击修改</td>
  </tr>
<%      dim i            
	   i=0           
	   %> <%                                                                  
     do while not rs.EOF  %>
  <tr> 
    <td width="9%"><input type=checkbox name=selBoard value=<%=rs("sortid")%>></td>
    <td width="21%"><%=rs("sortname")%></td>
    <td width="43%"><%=rs("sortmeno")%></td>
    <td width="15%"><%=rs("sortdate")%></td>
    <td width="12%"><a href=addsort.asp?mud=xiu&sortid=<%=rs("sortid")%>>修改</a></td>
  </tr><%i=i+1                                                                         
if i>=MaxPerPage then exit do                                                                             
rs.MoveNext                                                                                     
loop      
%> 
 </table>
<script>
	function confirmDel(){
		if (confirm("删除选择的类别?")){
			document.frmBoardDel.submit()
		}
	}
</script>
  <div align="center"><center><p><input class="buttonface" type="button" onclick="confirmDel()" value="删 除" name="cmdDel"> </p>
          
      <p>(<font color="#FF0000">!</font> 删除类别将删除该类别所有相关资料 )</p>
          </center></div>
        </form>
<%                                                                  
end sub                                                                     
%> 

</body>
</html>
 <%                                                         
                                                            
                                                            
                                                           
function showpage(totalnumber,maxperpage,filename)                                                               
	       dim n                                                                        
  if totalnumber mod maxperpage=0 then                                                                        
     n= totalnumber \ maxperpage                                                                        
  else                                                                        
     n= totalnumber \ maxperpage+1                                                                        
  end if                                                                        
response.write"<p align=center>"
if CurrentPage<2 then                                                             
    response.write "<IMG alt=firstpage.gif (2075 bytes) border=0 height=22 src=image/firstpage.gif> "                                                               
  response.write "<IMG alt=prevpage.gif (1931 bytes) border=0 height=22 src=image/prevpage.gif>&nbsp;"                                                                        
   else                                                                       
    response.write "<a href="&filename&"?page=1"&link&"><IMG alt=firstpage.gif (2075 bytes) border=0 height=22 src=image/firstpage.gif></a>&nbsp;"                                                                        
    response.write "<a href="&filename&"?page="&CurrentPage-1&""&link&"><IMG alt=prevpage.gif (1931 bytes) border=0 height=22 src=image/prevpage.gif></a>&nbsp; "                                                                       
  end if                                                                         
  if n-currentpage<1 then                                                              
    response.write "<IMG alt=nextpage.gif (1903 bytes) border=0 height=22 src=image/nextpage.gif> "                                                               
  response.write "<IMG alt=lastpage.gif (1950 bytes) border=0 height=22 src=image/lastpage.gif>&nbsp;"                                                                              
  else                                                                        
    response.write "<a href="&filename&"?page="&CurrentPage+1&""&link&">"                                                                   
    response.write "<IMG alt=nextpage.gif (1903 bytes) border=0 height=22 src=image/nextpage.gif> </a>"                                                               
  response.write "<a href="&filename&"?page="&n&""&link&"><IMG alt=lastpage.gif (1950 bytes) border=0 height=22 src=image/lastpage.gif></a>&nbsp;"                                                                        
                                                                     
  end if                                                                        
response.write"</p>"                                                                      
end function                                                                         
set rs=nothing	                                                                                 
%>

⌨️ 快捷键说明

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