数据传输用JSON,其实就是KEY和VALUE。把查询出来的集合、实体、各种结果包装成MAP类型。可以方便的与JSON进行转换读写。
根据需要自定义实体类,以便前后台的统一调用。这样的实体类可以与实体表出入很大。完全根据需要制定。
<%@ Language=VBScript%><%
Response.Buffer=false
Response.Expires=0
%>
<%
scooltable="sroot"
classtable="subs"
danweitable="news"
usertable="adminuser"
qxtable="adminqx"
adminhtml="admin.asp"
linkwarn="./warn.asp"
linklbadmin="lbadmin.asp"
linkflagadmin="admin_subadmin.asp"
set cn=Server.CreateObject ("ADODB.Connection")
set rs=Server.CreateObject ("ADODB.Recordset")
set rs1=Server.CreateObject ("ADODB.Recordset")
set rs8=Server.CreateObject ("ADODB.Recordset")
cn.Open mycnstr
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<style type=text/css>
<!--
td,p,input,select,body {font-size:12px}
.t1 {font:12px 宋体color=000000}
.t2 {font:12px 宋体color:ffffff}
.bt1 {font:13px 宋体color=000000}
.bt2 {font:13px 宋体color:ffffff}
A:link {color: #000077}
A:visited {color: #000077}
A:hover {color: #ff0000}
A.r1:link {font:13pxtext-decoration:nonecolor: #000000}
A.r1:visited {font-size:13pxtext-decoration:nonecolor: #000000}
A.r1:hover {font-size:13pxtext-decoration:underlinecolor: #ff6600}
-->
</style>
<script language="Javascript">
var Obj
var imgOpen = new Image()
var imgClose = new Image()
imgOpen.src="./images/open.gif"
imgClose.src="./images/close.gif"
function expand(el)
{
Obj = eval("child"+el)
var whichEl = (event) ? event.srcElement : false
if(!whichEl.name) whichEl = eval("document.all.img" + el)
if(Obj.style.display == "none")
{
Obj.style.display = "block"
whichEl.src = imgOpen.src
}
else
{
Obj.style.display = "none"
whichEl.src = imgClose.src
}
}
function switchbar()
{
if (switchpoint.innerText==3)
{
switchpoint.innerText=4
document.all("xxx").style.display="none"
top.content.cols="10,*"
}
else
{
switchpoint.innerText=3
document.all("xxx").style.display=""
top.content.cols="180,*"
}
}
</script>
<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=#ffffff>
<table width="158" height="100%" border="0" cellspacing="0" cellpadding="0" align="left" background="./images/admin_back.jpg" style="background-position:bottombackground-repeat:no-repeat">
<tr><td height=3></td></tr>
<tr>
<td width="10"></td>
<td valign=top width=90%>
<%i=1
sqltext2="select * from "+scooltable+" where usefulness=1 order by xuhao"
rs.Open sqltext2,cn,1,1
if userqx>=1 then
do while not rs.EOF
classid=rs("id")
'Response.Write classid
%>
<div id=parent<%=i%>class=parent style="display='block'">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height=20>
<tr><td width=2> </td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>)return false"><img name="img<%=i%>" src="./images/close.gif" border=0></a></td>
<td><a class=r1 href="#" onclick="expand(<%=i%>)return false"><%=rs("title")%></a></td></tr>
</table>
</div>
<div id=child<%=i%>class=child style="display='none'">
<table width=100%>
<%sqltext1="select * from "+classtable+" where usefulness=1 and pid="&classid&" and tempflag2=0 order by xuhao"
'echo(sqltext1)
rs1.Open sqltext1,cn,1,1
do while not rs1.EOF %>
<tr><td width=10> </td><td><a href="<%=adminhtml%>?pid=<%=rs1("id")%>&ppid=<%=rs1("pid")%>" target=main><%=rs1("title")%></a></td></tr>
<%rs1.MoveNext
loop
rs1.Close
if rs("lbadminflag")=1 then%>
<tr><td width=10> </td><td><a href="<%=linkflagadmin%>?ppid=<%=rs("id")%>" target=main><%=rs("title")%>类别管理</a></td></tr>
<%end if
%>
</table>
</div>
<%rs.MoveNext
'Response.Write i
i=i+1
loop
rs.Close
else
do while not rs.EOF
i=i+1
'if session("webflag")="9" and right(userqx,1)="1" then userqx="111"
%>
<div id=parent<%=i%>class=parent style="display='block'">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height=20>
<tr><td width=2> </td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>)return false"><img name="img<%=i%>" src="./images/close.gif" border=0></a></td>
<td><a class=r1 href="#" onclick="expand(<%=i%>)return false"><%=rs("title")%></a></td></tr>
</table>
</div>
<div id=child<%=i%>class=child style="display='none'">
<table width=100%>
<%sqltext1="select * from "+classtable+" where usefulness=1 and pid="&rs("id")&" and tempflag2=0 order by xuhao"
rs1.Open sqltext1,cn,1,1
do while not rs1.EOF
sqltext8="select * from "&qxtable&" where uid="&userid&" and qxid="&rs1("id")
rs8.Open sqltext8,cn,1,1
if not rs8.EOF then %>
<tr><td width=10> </td><td><a href="<%=adminhtml%>?pid=<%=rs1("id")%>&ppid=<%=rs1("pid")%>" target=main><%=rs1("title")%></a></td></tr>
<%
end if
rs8.Close
rs1.MoveNext
loop
rs1.Close%>
</table>
</div>
<%
rs.MoveNext
loop
rs.Close
end if
i=i+1
%>
<% if userqx="9" then %>
<div id=parent<%=i%>class=parent style="display='block'">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height=20>
<tr><td width=2> </td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>)return false"><img name="img<%=i%>" src="./images/close.gif" border=0></a></td>
<td><a class=r1 href="#" onclick="expand(<%=i%>)return false">系统模块设置</a></td></tr>
</table>
</div>
<div id=child<%=i%>class=child style="display='none'">
<table width=100>
<tr><td width=10> </td><td><a href="<%=linklbadmin%>?ppid=0&pid=0" target=main>大模块设置</a></td></tr>
<tr><td width=10> </td><td><a href="<%=linklbadmin%>?ppid=0&pid=1" target=main>小模块设置</a></td></tr>
</table>
</div>
<%end if%>
</td></tr>
</table>
</body>
</html>