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

📄 admin.asp

📁 最简单的博客
💻 ASP
📖 第 1 页 / 共 2 页
字号:
</table>
</form>
</div>
<%END IF%>


<%IF pageView="DoEdit" THEN

' The user is logged in and
' The User wants to Add the edited news to the database
' So we open up the database and upload the
' ammended Entry
%>

<%

' Set the SQL Statement to get the information from the database
strSQL="SELECT * FROM TBLBlog WHERE id="&Request.QueryString("ID")
' Open the Database
objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText

' Pull in the correnct record and populate it with information from the form

objRS("entryTitle")=Request.Form("EntryHeadline")
objRS("entry")=Request.Form("EntryContents")
objRS("bday")=Request.Form("bday")
objRS("bmont")=Request.Form("bmonth")
objRS("byear")=Request.Form("byear")
objRS("status")=Request.Form("EntryStatus")
objRS("btime")=FormatDateTime(Now,3)
objRS.Update
%>
<a href="admin.asp?view=" Title="Return to the Admin Menu" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">管理员首页</a> | <a href="admin.asp?view=AddNew" Title="Add Blog Entry" onmouseover="window.status='Add Blog Entry'; return true" onmouseout="window.status=''; return true">添加新日志</a>
<p><b>编辑日志</b></p>
<p>日志已经编辑并做了更新,请设置显示状态或回管理首页继续其他操作!<p>
<p></p>
<%END IF%>

<%IF pageView="Delete" THEN

' The user is logged in but 
' We need to check that the user really does want to delete the Entry
' So we print the Entry out on screen to show the user what they
' will be deleting

' Set the SQL Statement to get the information from the database
strSQL="SELECT * FROM TBLBlog WHERE id="&Request.QueryString("ID")
' Open the Database
objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText%>
<a href="admin.asp?view=" Title="Return" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">管理员首页</a>
<p><b>删除日志</b></p>
<p>确定要删除这篇日志吗?
<p><div align="center">
<table width="80%" class="mainTable" cellspacing="0" Cellpadding="3" bgcolor="#f5f4db">
<tr><td>
<b><%=objRS("entryTitle")%></b>
<br>
<br>
已发布: <%=objRS("newsDate")%>
<br>
<br>
<%
' Format the news text and write it out on screen
strNewsText = Replace(objRS("entry"), vbCrLf, "<br>")
Response.Write strNewsText
%>
</td></tr></table>
<br>
<input type="button" class="button" value="&nbsp;&nbsp;退出&nbsp;&nbsp;" onClick="window.location='admin.asp'" Title="Return to the Admin Menu" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">&nbsp;<input type="button" class="button" value="删除" onClick="window.location='admin.asp?view=DoDelete&ID=<%=Request.QueryString("ID")%>'" Title="确认删除" onmouseover="window.status='确认删除'; return true" onmouseout="window.status=''; return true">
<p></P>
<%END IF%>

<%IF pageView="DoDelete" THEN

' The user is logged in and
' The User wants to Delete the news from the database
' So we pull in the proper record and delete it 
%>

<%

' Set the SQL Statement to get the information from the database
strSQL="SELECT * FROM TBLBlog WHERE id="&Request.QueryString("ID")
' Open the Database
objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText

' Remove the Entry
objRS.Delete
%>
<a href="admin.asp?view=" Title="Return to the Admin Menu" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">管理员首页</a> | <a href="admin.asp?view=AddNew" Title="Add" onmouseover="window.status='Add Blog Entry'; return true" onmouseout="window.status=''; return true">添加新日志</a>
<p><b>删除日志</b></p>
<p>日志已被删除,请继续其他操作!<p>
<p></p>
<%END IF%>

<%IF pageView="Display" THEN

' The user is logged in and they
' want to view the Entry as it
' will appear on screen so we pull in
' the correct Entry and print it
' out on the screen 

' Set the SQL Statement to get the information from the database
strSQL="SELECT * FROM TBLBlog WHERE id="&Request.QueryString("ID")
' Open the Database
objRS.Open strSQL, objConn, adOpenKeyset, adLockPessimistic, adCmdText%>
<a href="admin.asp?view=" Title="Return to the Admin Menu" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">管理员首页</a>
<p><b>查看日志</b></p>
<p>
<p><div align="center">
<table width="80%" class="mainTable" cellspacing="0" Cellpadding="3" bgcolor="#f5f4db">
<tr><td>
<b><%=objRS("entryTitle")%></b>
<br>
<br>
已发布: <%=objRS("newsDate")%>
<br>
<br>
<%
' Format the news text and print it out
strNewsText = Replace(objRS("entry"), vbCrLf, "<br>")
Response.Write strNewsText
%>
</td></tr></table>
<br>
<input type="button" class="button" value="&nbsp;&nbsp;返回&nbsp;&nbsp;" onClick="window.location='admin.asp'" title="Return to the Admin Menu" onmouseover="window.status='Return to the Admin Menu'; return true" onmouseout="window.status=''; return true">
<p></P>
<%END IF%>

<div align="right">
<form><input type="button" value="&nbsp;登出&nbsp;" onClick="window.location='admin.asp?view=LogOut'" class="button" title="Log Out of BlogIt!" onmouseover="window.status='Log Out of BlogIt!'; return true" onmouseout="window.status=''; return true"></form>
</div>
<%
END IF%>

<%
END IF
IF pageView="login" THEN

' Log the user into the system

Dim userNameVariable, PasswordVariable
userNameVariable="everbaidu"
PasswordVariable="everbaidu"

' We need to find out if they have entered the correct
' username and password

IF (Request.Form("username")=userNameVariable) AND (Request.Form("pword")=PasswordVariable) THEN

' They have entered the correct username so we can log them on

Response.Cookies("loggedIn")="xY1zZoPQ"

Response.Redirect("admin.asp?view=")

ELSE
%>

<p><div align="center">
<table width="80%" class="mainTable" cellspacing="0" Cellpadding="3" bgcolor="#f5f4db">
<tr><td>
<br>
<br>
<br>
<b>错误!</b> 用户名或密码错误,请 <a href="admin.asp" title="返回登陆框" onmouseover="window.status='Return'; return true" onmouseout="window.status=''; return true">返回登陆框重新填写!</a>
<br>
<br>
<br>
</td></tr></table>
<br>
<br>
<br>
<%
END IF
%>
<%END IF%>

<center><strong> <a target=blank href="http://www.everbaidu.com" Title="百度天下网" onmouseover="window.status='View'; return true" onmouseout="window.status=''; return true">百度天下网</a></strong></center>
</td></tr></table></td></tr>
</table>
</td></tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
</body>
</html>
<%IF pageView="LogOut" THEN

' Log the user out of the system

Response.Cookies("loggedIn")=""
Response.Redirect("admin.asp")
END IF
%>


⌨️ 快捷键说明

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