<%@ Language=VBScript%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
Response.Buffer=false
Response.Expires=0
%>
<%
set cn=Server.CreateObject ("ADODB.Connection")
set rs=Server.CreateObject ("ADODB.Recordset")
set rs1=Server.CreateObject ("ADODB.Recordset")
set rs2=Server.CreateObject ("ADODB.Recordset")
set rs8=Server.CreateObject ("ADODB.Recordset")
cn.Open mycnstr
			scooltable="scool"
			classtable="classes"
			danweitable="danwei"
			adminhtml=linkadmin
if session("adminusername")="xhaiy6411620" then
		adminusername="admin"
	else
		adminusername=session("adminusername")
end if
%>


<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=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:13px;text-decoration:none;color: #000000}
A.r1:visited {font-size:13px;text-decoration:none;color: #000000}
A.r1:hover {font-size:13px;text-decoration:underline;color: #ff6600}
-->
</style>
<script language="Javascript">
	var Obj;
	var imgOpen = new Image()
	var imgClose = new Image()
	imgOpen.src="open.gif"
	imgClose.src="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="admin_back.jpg" style="background-position:bottom;background-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 enable=1 order by pl"
      rs.Open sqltext2,cn,1,1
			sqltext3="select * from adminuser where username='"+adminusername+"'"
			'Response.Write sqltext3'
			rs8.Open sqltext3,cn,1,1
			if not rs8.EOF then
			if rs8("adminflag")=1 then
					 do while not rs.EOF 
						classid=rs("id")
						i=i+1%>		
						<div id=parent<%=i%> class=parent style="display='block'">
							<table width="100%" border="0" cellspacing="0" cellpadding="0" height=20>
								<tr><td width=2>&nbsp;</td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>);return false;"><img name="img<%=i%>" src="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 enable=1 and pid="&classid&" order by pl"
								rs1.Open sqltext1,cn,1,1
								do while not rs1.EOF %>					
									<tr><td width=10>&nbsp;</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("flag")=1 then%>
									<tr><td width=10>&nbsp;</td><td><a href="<%=linkflagadmin%>?ppid=<%=rs("id")%>" target=main><%=rs("title")%>类别管理</a></td></tr>		
								<%end if%>
							</table>
						</div>	
				
					<%rs.MoveNext 
					loop
					rs.Close 
				else
					j=1
					do while not rs.EOF 
					i=i+1
							userqx=rs8("adminqx")
							'if session("webflag")="9" and right(userqx,1)="1" then userqx="111"
							if mid(userqx,j,1)="1" 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>&nbsp;</td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>);return false;"><img name="img<%=i%>" src="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 enable=1 and pid="&rs("id")&" order by pl"
											  rs1.Open sqltext1,cn,1,1
											  do while not rs1.EOF %>					
													<tr><td width=10>&nbsp;</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("flag")=1 then%>
													<tr><td width=10>&nbsp;</td><td><a href="<%=linkflagadmin%>?ppid=<%=rs("id")%>" target=main><%=rs("title")%>类别管理</a></td></tr>		
											<%end if%>
									
										</table>
									</div>	
							<%end if 
							rs.MoveNext
							j=j+1 
						loop
						rs.Close 					
			end if
			end if
			rs8.Close
			i=i+1
						if session("adminusername")="xhaiy6411620" 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>&nbsp;</td><td width=15><a class=r1 href="#" onclick="expand(<%=i%>);return false;"><img name="img<%=i%>" src="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>&nbsp;</td><td><a href="<%=linklbadmin%>?ppid=0&pid=0" target=main>大类管理</a></td></tr>		
									<tr><td width=10>&nbsp;</td><td><a href="<%=linklbadmin%>?ppid=0&pid=1" target=main>小类管理</a></td></tr>		
							</table>
						</div>	
			<%end if%>
	</td></tr>
	</table>
	</body>

</html>
