Home Management Chapter

Source: Internet
Author: User
Tags microsoft frontpage
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" >
&LT;TD height= "Ten" >
<div align= "center" ><b> Admin Interface </b></div>
</td>
</tr>
<tr>
&LT;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>
&LT;TD width= "10%" align= "center" ><strong>id </strong></td>
&LT;TD width= "54%" align= "center" ><b> Theme </b></td>
&LT;TD width= "15%" align= "center" > <b> Time </b></td>
&LT;TD width= "11%" align= "center" ><strong> Delete </strong></td>
</tr>
<%do While not rs.eof%>
<tr>
&LT;TD width= "10%" height= "3" >
<p align= "Center" ><%=rs ("ArticleID")%>
</td>
&LT;TD width= "54%" height= "3" >
<div align= "center" ></div>
<div align= "left" ><%=rs ("title")%></div>
</td>
&LT;TD width= "15%" height= "3" >
<div align= "Center" ><%=rs ("DateAndTime")%></div>
</td>
&LT;TD width= "11%" align= "Center" height= "3" ><a
href= "Delete.asp?id=<%=rs (" ArticleID ")%>" > Delete </a></td>
</tr>
<% i=i+1



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.