繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP基础 >> 一个类msn space的case manage system

一个类msn space的case manage system

2006-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:数据结构和add页面 就不写了看select救出来了

数据结构和add页面 就不写了看select救出来了

%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<%

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

%>

takelist manage

完成与否创立时间下放时间添加New Takes

<%

response.Write("")

innercn=0

divid=0

Call WriteCatalog(0,null) %>

<%

Sub WriteCatalog(id,allcount)

Dim sql

Dim rs

Level=Cint(Get_level(id))

Set rs=server.createobject("adodb.recordset")

Sql="select * from takelist where fid ="&id&" order by takelistid"

rs.open sql,conninner,1,1

Do while not rs.eof

Loopid=0

Loopid=Loopid+1 %>

<%For i=1 to Level %>

<% If Chk_next(rs("takelistid"),i) then %>

<% Else %>

<% End if %>

<% Next %>

<% if Loopid<>rs.recordcount then %>

" style="display:none">

<% Else %>

<% End if %>

<% If hasChild(Cint(rs("takelistid"))) then %>,<%=Cint(rs("takelistid"))%>)">展 src="../../images/sub.gif" width="16" height="16" border="0" align="absmiddle" style="cursor:hand" onclick="expandIt(<%=divid%>,IMG<%= rs("takelistid") %>)">

<%

loopid=loopid+1

Else %><% End if %>

"><%=rs("takedesc")%> <%

if rs("isfinished")=0 then

response.Write("未")

else

response.write("已")

end if

%>

<%=rs("createtime")%> <%=rs("starttime")%> ,<%=rs("fk_projectid")%>)">添加该类别下Takes
" colspan="<%=6+get_level(rs("takelistid"))%>">

<%

innercn=innercn+1

response.Write("")

%>

<%

If hasChild(rs("takelistid")) then

divid=divid+1

%>

Fid=<%=rs("takelistid")%> style="display:none">

<% CAll WriteCatalog(rs("takelistid"),rs.recordcount) %>

<% Else

%>

<% CAll WriteCatalog(rs("takelistid"),rs.recordcount) %>

<% End if %>

<%

rs.movenext

Loop

rs.close

set rs=nothing

End Sub

%>

<%

response.Write("")

%>

责任编辑:admin
相关文章