📄 body.asp
字号:
<%
'实现页面运行时间记录
dim startime
startime=timer()
%>
<!--#include file="../database/opendb.asp"-->
<!--#include file="drawdiv.asp"-->
<!--#include file="../bg/css.asp"-->
<%
sql="select content from info where english_name ='menucolor'"
rst.Open sql,my_conn,1,1
menucolor=(rst("content"))
rst.close
%>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>A {
COLOR: #000000; TEXT-DECORATION: none
}
#header {FONT-SIZE: 93%; BACKGROUND: #ffffff; FLOAT: left; WIDTH: 100%; LINE-HEIGHT: normal
}
#header UL {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
}
#header LI {
BORDER-RIGHT: #8ea2c2 1px dashed; PADDING-RIGHT: 0px; BORDER-TOP: #8ea2c2 1px dashed; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN-LEFT: 2px; BORDER-LEFT: #8ea2c2 1px dashed; PADDING-TOP: 0px;
}
#header A {
CURSOR: hand ;PADDING-RIGHT: 15px; DISPLAY: block; PADDING-LEFT: 15px; PADDING-BOTTOM: 4px; PADDING-TOP: 5px
}
#header .current {
BORDER-RIGHT: #8ea2c2 1px dashed; BORDER-TOP: #8ea2c2 1px DASHED; BACKGROUND: #ffffff; BORDER-LEFT: #8ea2c2 1px dashed; BORDER-BOTTOM: #8ea2c2 0px DASHED
}
#header .current A {
PADDING-BOTTOM: 0px; BACKGROUND-COLOR:<%=menucolor%>
}
.content {
MARGIN-TOP: 3px;
}
.content .contentMain {
BORDER-RIGHT: #ffffff 1px dashed; BORDER-TOP: #ffffff 1px dashed; BORDER-LEFT: #ffffff 1px dashed; BORDER-BOTTOM: #ffffff 1px dashed
}
.td {
BORDER-LEFT: #ffffff 1PX DASHED; BORDER-RIGHT: #ffffff 1PX DASHED; BORDER-TOP: #ffffff 1PX DASHED; BORDER-BOTTOM: #ffffff 1PX DASHED
}
</STYLE>
<SCRIPT type=text/javascript>
function change_option(number,index){
for (var i = 1; i <= number; i++) {//先隐藏所有
document.getElementById('current' + i).className = '';
document.getElementById('content' + i).style.display = 'none';
}
//再来显示某个
document.getElementById('current' + index).className = 'current';
document.getElementById('content' + index).style.display = 'block';
}
</SCRIPT>
</HEAD>
<%'-----------------------------------------------------------------
webvolum=request("volum")
webpagenum=request("pagenum")
%>
<%
sql="select ID,name from menu order by sortid"
rst.Open sql,my_conn,3,2 '得到搜索后的记录
%>
<BODY>
<DIV id=header>
<UL>
<%
'这里 建立控制div的list
i=0
do while not rst.eof
i=i+1
%>
<LI id=current<%=i %>><A onclick=change_option(<%=rst.RecordCount %>,<%=i%>);><%=rst("name") %></A> </LI>
<%
rst.movenext
loop
%>
</UL>
</DIV>
<%
'----------------
'开始判断是否存在pagenum和volum
if request("volum")="" or request("pagenum")="" then'若不存在,则正常输出
rst.movefirst'再次移到开始
t=0
do while not rst.eof
t=t+1
if t=1 then
%>
<DIV class=content id=content<%=t %>>
<DIV class=contentMain><%=drawdiv(rst("ID"),-1)%></DIV>
</DIV>
<%else%>
<DIV class=content id=content<%=t %> style="DISPLAY: none">
<DIV class=contentMain><%=drawdiv(rst("ID"),-1)%></DIV>
</DIV>
<%
end if
rst.movenext
loop
%>
<%
else
rst.movefirst'再次移到开始
ik=0
do while not rst.eof
ik=ik+1
if cint(webvolum)=rst("ID") then '输出可见栏目'一直出错,原来是这里逻辑出错!栏目div是顺序编号,但是栏目id是无序的
%>
<DIV class=content id=content<%=ik %>>
<DIV class=contentMain><%=drawdiv(rst("ID"),webpagenum)%></DIV>
</DIV>
<%else%>
<DIV class=content id=content<%=ik %> style="DISPLAY: none">
<DIV class=contentMain><%=drawdiv(rst("ID"),-1)%></DIV>
</DIV>
<%
end if
rst.movenext
loop
%>
<%
'-------------------------------
end if
rst.close%>
<%
drawtool '绘制工具栏目
%>
<!--#include file="../database/closedb.asp"-->
<%
dim endtime
endtime=timer()
%>
<br><span class="style1">页面执行时间:<%=FormatNumber((endtime-startime)*1000,3)%>毫秒</span>
</BODY></HTML>
<%
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++
'这里定义了一个输出管理工具栏的函数
function drawtool()
if session("login")=1 then
'-----------------------------
set rst2 = Server.CreateObject("ADODB.Recordset")
rst2.ActiveConnection=my_conn
'----------------------------
sql="select name,content from info where english_name='menucolor'"
rst2.Open sql,my_conn,1,1 '查询menu背景色
menucolor=rst2("content")
rst2.close
'-----------------------------
sql="select name,content from info where english_name='linedashed'"
rst2.Open sql,my_conn,1,1 '是否虚线显示
if rst2("content")=1 then
tdline="BORDER-TOP: #ffffff 1PX DASHED;"
rst2.close
else
tdline=""
rst2.close
end if
'---------------------------
repassword="<form name=""repwd"" method=""get"" action=""../login/repassword.asp"" ><table border=""0"" align=""left""><tr><td class=""style3"">新密码:</td><TD><input name=""newpassword1"" type=""text"" size=""10"" style=""border: 1px dotted #FFFFFF; ""></td><td class=""style3"">重 复:</td><TD><input name=""newpassword2"" type=""text"" size=""10"" style=""border: 1px dotted #FFFFFF; ""></td><td><input type=""submit"" value=""修改密码"" ><input type=""button"" onclick=""location.href='../master/admin.asp';"" value=""文章管理"" ><input type=""button"" onclick=""location.href='../admin/admin.asp';"" value=""栏目管理"" ></td><td><input type=""button"" onclick=""location.href='../sysinfo/sysedit.asp';"" value=""系统配置"" ><input type=""button"" onclick=""location.href='../database/databases.mdb';"" value=""下载数据"" ></td></tr></table></form>"
'----------------------------
answer=answer&"<table style='BORDER-BOTTOM: #ffffff 1PX DASHED;BACKGROUND: "&menucolor&"; ' height=""20"" ><tr><td width=""100%"" height=""27"" >" & repassword & "</td>"
answer=answer&"<td><input type=""button"" onclick=""location.href='../login/quit.asp';"" value=""退出管理"" ></td></tr></table>"
'----------------
response.write answer
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -