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

📄 admin_index.asp

📁 幽默短信系统,ASP代码编写,绝对搞笑!
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
	<tr>
		<td height="33">修改管理员:</td>
		<td>名称:</td>
		<td><input name="username" type="text" class="input" value="<% =mRs("username") %>">
		<input name="id" type="hidden" value="<% =request("id") %>"></td>
		<td>密码:</td>
		<td><input name="password" type="password" class="input"></td>
		<td>确认密码:</td>
		<td><input name="password1" type="password" class="input"></td>
		<td><input name="Submit3" type="submit" value=" 修 改 " class="button"></td>
	</tr>
</table>
</form>
<%
End If

'显示管理员列表
If Request.QueryString("action")="Admin_list" then
Set mRs=Server.CreateObject("adodb.recordSet")
Sql="Select * from A_admin"
mRs.open Sql,conn,1,1
%>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
	<tr align="center">
		<td width="13%" height="25">ID</td>
		<td width="40%">管理员名称</td>
		<td colspan="2">操作</td>
	</tr>
<% do while not mRs.eof %>
	<tr onmouseover="javascript:this.bgColor='#F7F7F7';" onmouseout="javascript:this.bgColor='#F3F3F3';" align="center">
		<td height="25"><% =mRs("Id") %></td>
		<td><% =mRs("username") %></td>
		<td width="10%"><a href="?action=Admin_modify&id=<% =mRs("Id") %>">修改</a></td>
		<td width="10%"><a href="?id=<% =mRs("Id") %>&action=Admin_del">删除</a></td>
	</tr>
<%
mRs.movenext
loop
%>
</table>
<% End If %>
		</td>
	</tr>
</table>
<% If Request.QueryString("action")="Msg_add" then %>
<table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="700" bgcolor="#F3F3F3" align="center">
<form action="?action=Add" name="add" method="post">
	<tr>
		<td height="25" bgcolor="#F3F3F3">&nbsp;<b>·添加短信·</b></td>
	</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="700" align="center">
	<tr>
		<td align="center" bgcolor="#FFFFFF"><textarea name="Msg_info" cols="53" rows="23" class="text"></textarea></td>
	</tr>
	<tr>
		<td align="center" bgcolor="#FFFFFF"><input name="Submit" type="submit" class="button" value=" 添 加 ">&nbsp;&nbsp;&nbsp;
		<input name="Submit2" type="reSet" class="button" value=" 重 置 "></td>
	</tr>
</form>
</table>
<%
End If

'修改短信
If Request.QueryString("action")="Msg_modify" then
Id=cint(trim(Request("Id")))
Set mRs=Server.CreateObject("adodb.recordSet")
Sql="Select * from M_msg where Id="&Id
mRs.open Sql,conn,1,1
%>
<form action="?id=<% =Request.QueryString("Id") %>&action=Modify" method="post">
<table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="700" bgcolor="#F3F3F3" align="center">
	<tr>
		<td height="25" background="Images/Bg.gIf">
			<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
				<tr>
					<td width="50%">&nbsp;<b>·修改短信·</b></td>
					<td width="50%" align="right"><b><a href="?id=<% =mRs("Id") %>&action=Del">删除</a><font color="#FFFFFF">&nbsp;&nbsp;
					</font></b></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="700" align="center">
	<tr>
		<td align="center" bgcolor="#FFFFFF"><input name="id" type="hidden" value="<% =Request("Id") %>">
		作者:<%
		If mRs("Msg_name")= "" or IsNull(mRs("Msg_name")) then
			Response.Write"管理员"
		Else
			Response.Write "<font color=#FF6600>"&mRs("Msg_name")&"</font>"
		End If
		%><br>
		浏览次数:<% =mRs("Msg_hit") %></td>
	</tr>
	<tr>
		<td align="center" bgcolor="#FFFFFF"><input name="id" type="hidden" value="<% =Request("Id") %>">
		<textarea name="Msg_info" cols="53" rows="23" class="text"><% =mRs("Msg_info") %></textarea></td>
	</tr>
	<tr>
		<td align="center" bgcolor="#FFFFFF"><input name="Submit3" type="submit" class="button" value=" 修 改 ">&nbsp;&nbsp;&nbsp;
		<input name="Submit22" type="reSet" class="button" value=" 重 置 "></td>
	</tr>
</table>
</form>
</table>
<%
End If
%>
<table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="700" bgcolor="#F3F3F3" align="center">
	<tr>
		<td height="25">
			<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
				<tr>
					<td width="50%">&nbsp;<b>·短信列表·</b></td>
					<td width="50%" align="right"><b><a href="?action=Msg_add">·添加短信·</a></b>&nbsp;</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="700" align="center">
	<tr bgcolor="#FFFFFF">
		<td width="7%" height="25" align="center">ID</td>
		<td width="57%" align="center">短信内容</td>
		<td width="10%" align="center">作者</td>
		<td colspan="3" align="center">操作</td>
	</tr>
<%
Sql="Select * from [M_msg] order by Id desc"
Set mRs=Server.CreateObject("adodb.recordSet")
mRs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
	mRs.PageSize =14'每页记录条数
	iCount=mRs.RecordCount '记录总数
	iPageSize=mRs.PageSize
	maxpage=mRs.PageCount
	page=request("page")
	If Not IsNumeric(page) or page="" then
	page=1
Else
	page=cint(page)
End If
	If page<1 then
		page=1
		ElseIf  page>maxpage then
		page=maxpage
	End If
	mRs.AbsolutePage=Page
	If page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	Else
		x=iPageSize
	End If
End If

i=1
for j=1 to mRs.pagesize
%>
	<tr bgcolor="#FFFFFF" onmouseover="javascript:this.bgColor='#E7EFF8';" onmouseout="javascript:this.bgColor='#FFFFFF';">
		<td height="25" align="center"><% =mRs("Id") %></td>
		<td><%
		If len(mRs("Msg_info"))>20 then
			Response.Write left(mRs("Msg_info"),20)&""
		Else
			Response.Write mRs("Msg_info")
		End if
		%></td>
		<td align="center"><%
		If mRs("Msg_name")= "" or IsNull(mRs("Msg_name")) then
			Response.Write"管理员"
		Else
			Response.Write "<font color=#FF6600>"&mRs("Msg_name")&"</font>"
		End If
		%></td>
		<td width="5%" align="center"><a href="?action=Validate&id=<%=mRs("id")%>&Msg_Validate=<%=mRs("Msg_Validate")%>"><% If mRs("Msg_Validate")=1 then %>
	    √<% Else %>×<% End If %></a></td>
		<td width="6%" align="center"><a href="?action=Msg_modify&id=<% =mRs("Id") %>">修改</a></td>
		<td width="5%" align="center"><a href="?id=<% =mRs("Id") %>&action=Del">删除</a></td>
	</tr>
<%
i=i+1
mRs.movenext
If mRs.eof then exit for
next
%>
</table>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
mRs.close
Set mRs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><tr>" & vbCrLf )
Response.Write("<td align=right>" & vbCrLf )
Response.Write(font_style & vbCrLf )
If page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
Else
Response.Write("<a href=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
End If
If page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页 " & vbCrLf)
Else
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<a href=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)
End If
Response.Write(" 页次:<b>" & page & "</b>/<b>" & pageCount & "</b>&nbsp;页" &  vbCrLf)
Response.Write(" 共有&nbsp;<b>" & iCount & "</b>&nbsp;条短信" &  vbCrLf)
Response.Write(" 转到&nbsp;" & "<input type=text name=page class=inputb maxlength=5 value=" & page & ">" & "&nbsp;页"  & vbCrLf & "<input type=submit class=buttonb value=GO>")
Response.Write("</tr></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub

conn.close
Set mRs=nothing
Set conn=nothing
%><table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
	<tr>
		<td align="center"><% =Copyright %></td>
	</tr>
</table>
</body>
</html>
<%
mRs.close
Set mRs=nothing
conn.Close
Set conn=Nothing
%>

⌨️ 快捷键说明

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