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

📄 admin_newsedit.asp

📁 ASP源程序采用天空软件小偷中心核件制成
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="admin_loginchk.asp"-->
<%admin1%>
<title>动 画  的 修 改 和 删 除</title>
<!--#include file="top.asp"-->
<%
   	const MaxPerPage=10
   	dim totalPut   
   	dim CurrentPage
   	dim TotalPages
   	dim i,j
   	dim idlist
   	dim title

	title=request("txtitle")
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
	
  	if not isempty(request("selAnnounce")) then
     		idlist=request("selAnnounce")
     		if instr(idlist,",")>0 then
			dim idarr
			idArr=split(idlist)
			dim id
		for i = 0 to ubound(idarr)
	       		id=clng(idarr(i))
	       		call deleteannounce(id)
		next
     		else
			call deleteannounce(clng(idlist))
     		end if
  	end if 
	
	

  sub deleteannounce(id)
    dim rs,sql
    set rs=server.createobject("adodb.recordset")
    sql="delete from article where articleid="&cstr(id)
    conn.execute sql
    if err.Number<>0 then
	err.clear
	response.write "删 除 失 败 !<br>"
    else
    end if
  End sub
  
   	dim sql
   	dim rs
%>

<table border="0" width="99%" cellspacing="1" cellpadding="1" style="margin-top:6px;margin-bottom:6px" align="center">
  <tr> 
    <td valign=top width="20%" style="border:1px solid black;" bgcolor="#999999">
      <!--#include file="admin_left.asp"-->
    </td>
    <td align=center valign=top>
      <table border="0" cellpadding="4" cellspacing="1" width="98%" align="center" bgcolor="#333333">
        <tr align="center" bgcolor="#999999"> 
          <td>动 画 的 修 改 和 删 除</td>
        </tr>
        <tr align="center" bgcolor="#CCCCCC"> 
          <td align="center" valign="top"> 
		 
           <form name="searchnews" method="POST" action="admin_newsedit.asp">
              查找新闻: 
              <input class=smallInput type="text" name="txtitle" size="13">
              <input type="submit" value="查 询" name="title">
            </form>
            <form method=Post action="admin_newsedit.asp">
              <div align="center"> 
                <%
	if title<>"" then
	sql="select * from article where title like '%"&trim(title)&"%' order by articleid desc"
	else
	sql="select * from article order by articleid desc"
	end if
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,1

   
  	if rs.eof and rs.bof then
       		response.write "<p align='center'> 还 没 有 任 何 文 章 </p>"
   	else    
	        urlname="admin_newsedit.asp"
      		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,urlname
            		showContent
            		showpage totalput,MaxPerPage,urlname
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark
           			showpage totalput,MaxPerPage,urlname
            			showContent
             			showpage totalput,MaxPerPage,urlname
        		else
	        		currentPage=1
           			showpage totalput,MaxPerPage,urlname
           			showContent
           			showpage totalput,MaxPerPage,urlname
	      		end if
	   	end if
   	rs.close
   	end if
	        
   	set rs=nothing  
   	conn.close
   	set conn=nothing
  
   	sub showContent
       	dim i
	   i=0
%>
                <div align="center">
                  <center>
                    <table border="0" cellspacing="1" width="589" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="1" bgcolor="#333333">
                      <tr bgcolor="#999999"> 
                        <td width="51" align="center" height="20"><strong>ID</strong></td>
                        <td width="385" align="center"><strong>新闻名</strong></td>
                        <td width="65" align="center"><b>推荐新闻</b></td>
                        <td width="78" align="center"> 
                          <input type='submit' class=buttonface value='删 除' name="submit">
                        </td>
                      </tr>
                      <%do while not rs.eof%>
                      <tr bgcolor="#CCCCCC"> 
                        <td height="23" width="51"> 
                          <p align="center"><%=rs("articleid")%> 
                        </td>
                        <td width="385"> 
                          <p align="center">
						  <% if rs("tuwen")=1  then %> [图文]
					        <a href="admin_newseditart.asp?id=<%=rs("articleid")%>&classid=<%=rs("classid")%>&Nclassid=<%=rs("Nclassid")%>&sid=<%=rs("sid")%>"><%=rs("title")%></a> 
                          <%else%>
					        <a href="admin_newseditart.asp?id=<%=rs("articleid")%>&classid=<%=rs("classid")%>&Nclassid=<%=rs("Nclassid")%>&sid=<%=rs("sid")%>"><%=rs("title")%></a> 
					      <%end if%>
						   </td>                         
                        <td width="65"> <a href="admin_newsset.asp?action=SetIsGood&id=<%=rs("articleid")%>"> 
                          <%if rs("IsGood")=true then%>
                          撤销 
                          <%else%>
                          推荐 
                          <%end if%>
                          </a> </td>
                          
                        <td width="78"> 
                          <p align="center"> 
                            <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("articleID"))%>'>
                        </td>
                      </tr>
                      <%
	i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
                    </table>
                  </center>
                </div>
                <%
   end sub 

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'>&nbsp;"
  if CurrentPage<2 then
     response.write "<font color='#000080'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='#000080'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  end if
   response.write "<font color='#000080'>&nbsp;页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
    response.write "<font color='#000080'>&nbsp;共<b>"&totalnumber&"</b>个新闻 <b>"&maxperpage&"</b>个新闻/页</font> "
     
end function
%>
              </div>
            </form> </td>
        </tr>
        <tr align="left" valign="top" bgcolor="#CCCCCC"> 
          <td><font color="#990033">说明:</font> 点击新闻名,即可对新闻进行编辑.本程序由去看去看-7k7k.com制作!</td>
        </tr>
      </table>
      
      </td>
  </tr>
</table>
<!--#include file="copyright.asp"-->
<br>
</body>
</html>

⌨️ 快捷键说明

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