Manage.asp
' Admin page is similar to the one on the homepage, here's a Wow. Only describes how to connect the delete chain!
' See last
<%
If Request.Cookies ("Adminok") = "" Then
Response.Redirect "Login.asp"
End If
%>
<!--#include file= "articleconn.asp"-->
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Management Files </title>
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<link rel= "stylesheet" href= ". /css/style.css ">
<%
Const MAXPERPAGE=40
Dim totalput
Dim currentpage
Dim totalpages
Dim i,j
If not IsEmpty (Request ("page") Then
Currentpage=cint (Request ("page")
Else
Currentpage=1
End If
%>
<body bgcolor= "#FFFFFF" >
<p> </p>
<table width= "90%" border= "1" cellspacing= "0" cellpadding= "0" align= "center" bordercolorlight= "#000000" bordercolordark= "#FFFFFF" >
<tr bgcolor= "#99CCFF" >
<TD height= "Ten" >
<div align= "center" ><b> Admin Interface </b></div>
</td>
</tr>
<tr>
<TD height= "><%"
Dim sql
Dim rs
Sql= "SELECT * from Learning ORDER BY ArticleID Desc"
Set rs= Server.CreateObject ("ADODB.") Recordset ")
Rs.Open sql,conn,1,1
If rs.eof and Rs.bof then
Response.Write "<p align= ' center ' > hasn't had any articles </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
Showpages
Showcontent
Showpages
Else
if (currentPage-1) *maxperpage<totalput Then
Rs.move (currentPage-1) *maxperpage
Dim bookmark
Bookmark=rs.bookmark
Showpages
Showcontent
Showpages
Else
Currentpage=1
Showpages
Showcontent
Showpages
End If
End If
Rs.close
End If
Set rs=nothing
Conn.close
Set conn=nothing
Sub Showcontent
Dim i
I=0
%>
<table border= "1" cellspacing= "0" width= "90%" bgcolor= "#F0F8FF" bordercolorlight= "#000000"
bordercolordark= "#FFFFFF" align= "Center" >
<tr>
<TD width= "10%" align= "center" ><strong>id </strong></td>
<TD width= "54%" align= "center" ><b> Theme </b></td>
<TD width= "15%" align= "center" > <b> Time </b></td>
<TD width= "11%" align= "center" ><strong> Delete </strong></td>
</tr>
<%do While not rs.eof%>
<tr>
<TD width= "10%" height= "3" >
<p align= "Center" ><%=rs ("ArticleID")%>
</td>
<TD width= "54%" height= "3" >
<div align= "center" ></div>
<div align= "left" ><%=rs ("title")%></div>
</td>
<TD width= "15%" height= "3" >
<div align= "Center" ><%=rs ("DateAndTime")%></div>
</td>
<TD width= "11%" align= "Center" height= "3" ><a
href= "Delete.asp?id=<%=rs (" ArticleID ")%>" > Delete </a></td>
</tr>
<% i=i+1