数据结构和add页面 就不写了看select救出来了
<VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT UserID, Username FROM dbo.[User]"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conn_STRING
Recordset2.Source = "SELECT ProjectID, ProjectName FROM dbo.ProjectID"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()
Recordset2_numRows = 0
%>
<%
Set conninner = Server.CreateObject("ADODB.Connection")
conninner.Open MM_conn_STRING
function haschild(cid)
dim haschildid,sql,rs
haschildid=Cint(cid)
sql="select * from takelist where fid="& haschildid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conninner,3,3
if not rs.EOF then
haschild=TRUE
else
haschild=FALSE
end if
set rs=nothing
end function
function MenuNub(Maid)
dim sql,rs,Mnub
sql="select fid from takelist where takelistid="& Maid
rs=conninner.execute(sql)
Mnub=0
if not rs.EOF then
Mnub=MenuNub(rs("fid"))+1
else
exit function
end if
set rs=nothing
MenuNub=Cint(Mnub)
end function
Function Get_style(Level)
If Cint(Level)=0 then
Get_style=""
Else
Get_style="style=""display:none"""
End if
End Function
Function get_pid(id)
dim rs,sql
sql="select Fid from takelist where takelistid="&id
Set rs=Conninner.Execute(Sql)
if not rs.EOF and not rs.BOF then
get_pid=rs("Fid")
else
get_pid=0
end if
set rs=nothing
end Function
Function Get_level(id)
dim rs,sql
Sql="Select fid from takelist Where takelistid="&id
Set rs=Conninner.Execute(Sql)
If not rs.Eof and not rs.bof then
Level=Get_level(rs("fid"))+1
Else
Exit Function
End if
Set rs=nothing
Get_level=Cint(Level)
End Function
Function Chk_next(id,Level)
dim rs,sql
dim tempId
tempId=id
aId=id
curLevel=Get_level(tempId)
For i=curLevel to Level step -1
tempId=Get_Pid(tempId)
Next
For i=curLevel to Level+1 step -1
aId=Get_Pid(aId)
Next
Set rs=server.createobject("adodb.recordset")
Sql="Select * from takelist Where fid="&tempId&""
rs.open Sql,Conninner,3,3
wida=0
If Rs.recordcount>1 then
rs.MoveLast
if aid=rs("takelistid") then
Chk_next=false
Else
Chk_next=true
End if
Else
Chk_next=false
End if
Rs.close()
Set rs=nothing
End Function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>takelist manage</title>
<script language="JavaScript" type="text/JavaScript">
function expandIt(ObjDIV,ObjIMG)
{
if (document.all.DIVs[ObjDIV].style.display=="none")
{document.all.DIVs[ObjDIV].style.display="";
ObjIMG.src="images/sub.gif";
}
else{
document.all.DIVs[ObjDIV].style.display="none";
ObjIMG.src="images/plus.gif";
}
}
var hid=0
function expandall(a,ba)
{
if(hid==0)
{
for(var i=0; i<document.all.DIVs.length;i++)
{
if(document.all.DIVs[i].Fid==ba)
{
document.all.DIVs[i].style.display="block";
for(var j=0;j<document.all.DIVs.length;j++)
{
if(document.all.DIVs[j].md==document.all.DIVs[i].Fid)
{
expandall(j,document.all.DIVs[j].Fid)
}
}
}
}
hid=1
}
else
{
&n