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

📄 gb_list.asp

📁 一个企业网站的php源代码
💻 ASP
字号:
<!--#include file="open.asp" -->
<%
	del=Request("del")
	if del<>"" then
		SQL="Select * from guestbook where id="&del
		Set rs=Server.CreateObject("ADODB.RecordSet")
		rs.Open SQL,con,1,1
		if not rs.Eof then
			SQL="Delete from guestbook where id="&del
			con.Execute(SQL)
			Response.write("<script>alert('记录删除成功')</script>")
		end if
		rs.Close
		Set rs=nothing
	end if	
%>
<HTML><HEAD><TITLE>留言管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="image/myweb.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<TABLE height=30 cellSpacing=0 cellPadding=0 width=600 align=center border=0>
  <TBODY>
  <%
  	SQL="Select * from guestbook order by id Desc"
	Set rs=Server.CreateObject("ADODB.RecordSet")
	rs.Open SQL,con,1,1
	rs.PageSize=15
	count=1
	if Request("count")<>"" then
		count=Cint(Request("count"))
		if count<1 then
			count=1
		end if
		if count>rs.PageCount then
			count=rs.PageCount
		end if
	end if
  %>
    <TR> 
      <TD> <P align=right><IMG height=13 src="image/rent.gif" width=18 
      align=absMiddle>页数:<%=count%>/<%=rs.PageCount%>   <IMG height=15 
      src="image/amount.gif" width=15 align=absMiddle> 数量: <%=rs.RecordCount%></P></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=1 cellPadding=4 width=600 align=center border=0>
  <TBODY>
    <TR align=middle> 
      <TD class=web_title width=60>序号</TD>
      <TD class=web_title height=20>留言主题</TD>
      <TD class=web_title width=30>删除</TD>
      <TD class=web_title width=30>查看</TD>
    </TR>
    <%
	 if not rs.Bof and not rs.Eof then
		  	rs.ABSolutePage=count
		  end if
	for i=0 to rs.PageSize-1
		if rs.Eof then
			exit for
		end if
		if i mod 2=0 then
			Response.Write("<TR class=web_td1 >")
			else
			Response.Write("<TR class=web_td2 >")
		end if
	%>
  <TD align=middle><%=(count-1)*rs.pageSize+i+1%></TD>
  <TD  align=left> <%=rs("title")%></TD>
  <TD  align=middle><A 
      href="javascript:del(<%=rs("id")%>)"><IMG 
      src="image/del.gif" border=0></A></TD>
  <TD  align=middle><A 
      href="javascript:ishow(tr<%=i%>)"><IMG 
      src="image/edit.gif" border=0></A></TD>
  </TR>
  <tr bgcolor="#f1f1f1" id="tr<%=i%>" style="display:none"> 
    <td colspan="4"> 
      <%
	response.write("<TABLE cellSpacing=1 cellPadding=4 width=550 align=center border=0 bgcolor=#efefef>")
	Response.write("<tr bgcolor=#ffffff>"&chr(13)&"<td>序号</td><td>"&(count-1)*rs.pageSize+i+1&"                <A href=""javascript:ishow(tr"&i&")""><font color=""#ff0000""><strong>关闭</strong></font></a></td></tr>")	
	Set xml=Server.CreateObject("Microsoft.XMLDOM")
	xml.async=false
	xml.load(Server.MapPath("gb.xml"))
	Set root=xml.documentElement
	for j=0 to root.childnodes.length-1
		Set node=root.childnodes.item(j)
		Response.write("<tr bgcolor=#ffffff>"&chr(13))
		Response.write("<td>"&node.attributes.item(2).nodevalue&"</td>"&chr(13))
		Response.write("<td>"&rs(node.attributes.item(1).nodevalue)&"</td>"&chr(13))
		Set node=nothing
	next
	response.write("</TABLE>")
	Set xml=nothing
	%>
    </td>
	</tr>
	<%
		rs.movenext
	next
	%>
  
</TBODY></TABLE>

<TABLE cellSpacing=0 cellPadding=0 width=600 align=center border=0>
  <TBODY>
  <TR>
      <TD align=right>[<a href="gb_list.asp?count=1&tid=<%=tid%>">首页</a>] [<a href="gb_list.asp?count=<%=count-1%>&tid=<%=tid%>">上一页</a>][<a href="gb_list.asp?count=<%=count+1%>">下一页</a>] 
        [<a href="gb_list.asp?count=<%=rs.PageCount%>&tid=<%=tid%>">尾页</a>] 
        <DIV></DIV></TD></TR></TBODY></TABLE><BR>
	  <%
	  rs.Close
	  Set rs=nothing
	  %>
<DIV align=center></DIV></TD></TR></TABLE>
<script>
function del(id)
{
	if(confirm("你真得要删除这条记录吗?"))
		location.href="p_list.asp?del="+id+"&count=<%=count%>&tid=<%=tid%>";
}
function ishow(id)
{
	if(id.style.display=="none")
		id.style.display=""
	else
		id.style.display="none"
}
</script>
</BODY></HTML>
<!--#include file="close.asp" -->

⌨️ 快捷键说明

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