www.gusucode.com > 云枫企业网站源代码第二版 2.0源码程序 > admin/news/manage.asp

    <!--#include file="../inc/admin.asp"-->
<!--#include file="../inc/conn.asp"-->

<SCRIPT language=javascript>

function ConfirmDel()
{
   if(confirm("确定要删除选中的记录吗?一旦删除将不能恢复!"))
     return true;
   else
     return false;
	 
}
</SCRIPT>


<%if Request.QueryString("no")="eshop" then

dim SQL, Rs, contentID,CurrentPage
CurrentPage = request("Page")
contentID=request("ID")

set rs=server.createobject("adodb.recordset")
sqltext="delete from news where Id="& contentID
rs.open sqltext,conn,3,3
set rs=nothing
conn.close
response.redirect "manage.asp"
end if

%>
<%
D_type=request("D_type")
set rs=server.createobject("adodb.recordset")
if D_type<>"" then
sqltext="select * from news where D_type="&D_type&" order by S_Order desc"
else
sqltext="select * from news order by id desc"
end if
rs.open sqltext,conn,1,1

dim MaxPerPage
MaxPerPage=50

dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if

call showpages
call list

If Rs.recordcount > MaxPerPage then
call showpages
end if

'显示帖子的子程序
Sub list()%>
<html>
<head>
<title>健康园地信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top">
	  <br>
      <table width="787" border="0" cellspacing="0" cellpadding="0" class="border">
        <tr> 
          <td height="26" style="background-image: url('../Images/topbg1.gif')"> <div align="center"><strong><FONT COLOR="#FFFFFF">信息管理</FONT></strong></div></td>
        </tr>
		<tr><td class="tdbg" align="center" height="25">
	<%
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	rs1.Open "Select * From newsname order by id desc", conn, 1,1 
	if not(rs1.eof or rs1.bof) then
	do while not rs1.eof
	%>
    <A HREF="manage.asp?D_type=<%=rs1("id")%>"><%=rs1("sortname")%></A>&nbsp;&nbsp;
    <%
	rs1.movenext
	loop
	rs1.close
	set rs1=nothing
	end if
%>	
		</td></tr>
        <tr> 
            <td><div align="center"> 
              <table width="100%" border="0" cellspacing="2" cellpadding="3">
                <tr bgcolor="#C0C0C0"> 
                  <td width="8%" height="25" bgcolor="#E1F4EE"> <div align="center">ID</div></td>
				  <td width="32%" bgcolor="#E1F4EE"> <div align="center">信息名称</div></td>
				  <td width="8%" bgcolor="#E1F4EE"> <div align="center">操作</div></td>
                  <td width="8%" bgcolor="#E1F4EE"> <div align="center">操作</div></td>
                </tr>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
                <tr bgcolor="#E3E3E3"> 
                  <td height="22" bgcolor="#E1F4EE"> <div align="center"><%=rs("id")%></div></td>
                  
				  <td bgcolor="#E1F4EE">&nbsp;&nbsp;<%=rs("title")%>&nbsp;</td>
				   <form name="Setting" method="post" action="S_Order.asp">
				    <input name="ID" type="hidden" id="ID" value="<%=rs("id")%>">
					<input name="D_type" type="hidden" id="ID" value="<%=rs("D_type")%>">
				   </form>
                  
                  <td bgcolor="#E1F4EE"> 
                    <div align="center"><a href="edit.asp?id=<%=rs("id")%>">修改</a></div></td>
                  <td bgcolor="#E1F4EE"> <div align="center"><a href="manage.asp?id=<%=rs("id")%>&amp;no=eshop" onClick="return ConfirmDel();">删除</a></div></td>
                </tr>
                <% 
i=i+1 
if i >= MaxPerpage then exit do 
rs.movenext 
loop 
end if 
%>
                <tr bgcolor="#C0C0C0"> 
                  <td height="25" colspan="7" bgcolor="#E1F4EE">&nbsp;&nbsp; <%
Response.write "<strong><font color='#000000'>-> 全部-</font>"
Response.write "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>条产品</font></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "<strong><font color='#000000'>第</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) &  "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font></strong>&nbsp;"
If currentpage > 1 Then
response.write "<strong><a href='?&page="+cstr(1)+"'><font color='#000000'>首页</font></a><font color='#ffffff'> </font></strong>"
Response.write "<strong><a href='?page="+Cstr(currentpage-1)+"'><font color='#000000'>上一页</font></a><font color='#ffffff'> </font></strong>"
Else
Response.write "<strong><font color='#000000'>上一页 </font></strong>"
End if
If currentpage < Rs.PageCount Then
Response.write "<strong><a href='?page="+Cstr(currentPage+1)+"'><font color='#000000'>下一页</font></a><font color='#ffffff'> </font>"
Response.write "<a href='?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾页</font></a></strong>&nbsp;&nbsp;"
Else
Response.write ""
Response.write "<strong><font color='#000000'>下一页</font></strong>&nbsp;&nbsp;"
End if
'response.write "</td><td align='right'>"
'response.write "<font color='#000000' >转到:</font><input type='text' name='page' size=4 maxlength=4 class=smallInput value="&Currentpage&">&nbsp;"
'response.write "<input class=buttonface type='submit'  value='Go'  name='cndok'>&nbsp;&nbsp;"
%></td>
                </tr>
              </table>
			  <%
End sub
rs.close

%>
            </div></td>
        </tr>
      </table>
      <br>
      <br>
    </td>
  </tr>
</table>