分享
 
 
 

一个类msn space的case manage system

王朝asp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

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

<%@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

{

for(var i=0; i<document.all.DIVs.length;i++)

{

if(document.all.DIVs[i].Fid==ba)

{

document.all.DIVs[i].style.display="none";

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=0

}

}

function closeall()

{

for(var i=0; i<document.all.DIVs.length;i++)

{

document.all.DIVs[i].style.display="none"

}

}

function expandalla()

{

for(var i=0; i<document.all.DIVs.length;i++)

{

document.all.DIVs[i].style.display="block"

}

}

function takesubmit()

{

var url="take_add.asp";

var f=document.createElement("form");

f.action = url;

f.method = "post";

f.id= "dosubmit";

f.style.display = "none";

var ct=document.createElement("textarea")

ct.name="cttime"

ct.value=document.all.createtime.value

f.appendChild(ct);

var st=document.createElement("textarea")

st.name="sttime"

st.value=document.all.starttime.value

f.appendChild(st);

var ft=document.createElement("textarea")

ft.name="fttime"

ft.value=document.all.finishtime.value

f.appendChild(ft);

var tde=document.createElement("textarea")

tde.name="tdesc"

tde.value=document.all.takedesc.value

f.appendChild(tde);

var ud=document.createElement("textarea")

ud.name="uid"

ud.value=document.all.userid[0].value

f.appendChild(ud);

var tud=document.createElement("textarea")

tud.name="tuid"

tud.value=document.all.userid[1].value

f.appendChild(tud);

var pd=document.createElement("textarea")

pd.name="projid"

pd.value=document.all.projectid.value

f.appendChild(pd);

var fd=document.createElement("textarea")

fd.name="fid"

fd.value=fidval;

f.appendChild(fd);

var elF = document.body.appendChild(f);

elF.submit()

}

var fidval

function addtake(tid,pid)

{

fidval=tid;

if(tid==0)

{

for(var i=1;i<=loopnub;i++)

{

eval(" var hdin=innercontain"+innerc[i]+"; var inputhd=input"+innerc[i]+";")

hdin.innerHTML="";

inputhd.style.display="none";

}

input0.style.display="block";

innercontain0.innerHTML=tempstr;

projectinner.innerHTML=projstr;

projecthd.style.display="block";

canceldiv.innerHTML="<input type=\"button\" onClick=\"innercontain0.innerHTML=''\" value=\"取消\">"

alert(canceldiv.innerHTML)

}

else

{

input0.style.display="none";

innercontain0.innerHTML="";

if(pid!=0)

{

for(var i=1;i<=loopnub;i++)

{

eval(" var hdin=innercontain"+innerc[i]+"; var inputhd=input"+innerc[i]+";")

hdin.innerHTML="";

inputhd.style.display="none";

}

eval("var inputer=input"+tid+";var innercontainer=innercontain"+tid)

inputer.style.display="block"

innercontainer.innerHTML=tempstr

projectinner.innerHTML="<input type=\"text\" name=\"projectid\" value="+pid+">"

projecthd.style.display="none"

canceldiv.innerHTML="<input type=\"button\" onClick=\"innercontain"+tid+".innerHTML=''\" value=\"取消\">"

//alert(canceldiv.innerHTML)

}

else

{

for(var i=1;i<=loopnub;i++)

{

eval(" var hdin=innercontain"+innerc[i]+"; var inputhd=input"+innerc[i]+";")

hdin.innerHTML="";

inputhd.style.display="none";

}

eval("var inputer=input"+tid+";var innercontainer=innercontain"+tid)

inputer.style.display="block"

innercontainer.innerHTML=tempstr

//fid.value=tid;

projectinner.innerHTML=projstr

projecthd.style.display="block"

canceldiv.innerHTML="<input type=\"button\" onClick=\"innercontain"+tid+".innerHTML=''\" value=\"取消\">"

//alert(canceldiv.innerHTML)

}

}

}

</script>

<style>

a

{

color:#000000;

text-decoration:none;

}

</style>

</head>

<body>

<table id=TABLE border="1" cellspacing="0" cellpadding="0" style="font-size:12px " bordercolordark="#0066CC">

<tr><td width="500" onClick="expandall()">&nbsp;</td><td width="50" onClick="closeall()">完成与否</td><td width="80">创立时间</td><td width="80">下放时间</td><td width="120" onClick="addtake(0,0)">添加New Takes</td></tr>

<tr id="input0" style="display:none"><td id="innercontain0" colspan="6"></td></tr>

</table>

<%

response.Write("<script language=javascript> var innerc=new Array();"&vbcrlf&"</script>")

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 %>

<table id=TABLE border="1" cellspacing="0" cellpadding="0" style="font-size:12px; border-top-color:#FFFFFF" bordercolordark="#0066CC">

<tr><%For i=1 to Level %>

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

<td nowrap width=28>&nbsp;</td>

<% Else %>

<td nowrap width=28>&nbsp;</td>

<% End if %>

<% Next %>

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

<td width="28">

<% Else %>

<td width=28>

<% End if %>

<% If hasChild(Cint(rs("takelistid"))) then %><a href="#" onClick="expandall(<%=get_pid(rs("takelistid"))%>,<%=Cint(rs("takelistid"))%>)">展</a><img id=IMG<%= 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 %><img name="" src="images/sub.gif" width="16" height="16" alt=""><% End if %></td>

<td width="<%=500-30*get_level(Cint(rs("takelistid")))%>"><a href="#"><%=rs("takedesc")%></a></td>

<td width="50"><%

if rs("isfinished")=0 then

response.Write("未")

else

response.write("已")

end if

%></a></td>

<td width="80"><%=rs("createtime")%></td>

<td width="80"><%=rs("starttime")%></td>

<td width="120"><a href="#" onClick="addtake(<%=rs("takelistid")%>,<%=rs("fk_projectid")%>)">添加该类别下Takes</a></td>

</tr>

<tr id="input<%=rs("takelistid")%>" style="display:none"><td id="innercontain<%=rs("takelistid")%>" colspan="<%=6+get_level(rs("takelistid"))%>">

<%

innercn=innercn+1

response.Write("<script language=javascript>"&vbcrlf&"innerc["&innercn&"]="&rs("takelistid")&";"&vbcrlf&"</script>")

%>

</td></tr>

</table>

<%

If hasChild(rs("takelistid")) then

divid=divid+1

%>

<div id=DIVs md=<%=get_pid(rs("takelistid"))%> Fid=<%=rs("takelistid")%> style="display:none">

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

</div>

<% Else

%>

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

<% End if %>

<%

rs.movenext

Loop

rs.close

set rs=nothing

End Sub

%>

<div id="addtk" align="center" title="Takes Add" lang="zh" style="position:absolute;left:350;top:290; width: 400px; height: 89px; display:none">

<table border="0" width="100%" cellspacing="0" cellpadding="0" height="200" bgcolor="#999999"><tr> <td bgcolor="#CCCCCC" style="padding:4px" colspan="2" align="center">

<table width="400" border="0" cellpadding="2" cellspacing="2" bgcolor="#CCCCCC">

<tr id="projecthd" style="display:block;">

<td align="left">&nbsp;</td>

<td align="left">Project</td>

<td id="projectinner" align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left">create user</td>

<td id="createuserinner" align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left">take user</td>

<td id="takeuserinner" align="left">&nbsp;</td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left">create time</td>

<td align="left"><input type="text" size="12" name="createtime" value=""><input type="hidden" name="fid" value=""></td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left">start time</td>

<td align="left"><input type="text" size="12" name="starttime" value=""></td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">&nbsp;</td>

<td align="left">finish time</td>

<td align="left"><input type="text" size="12" name="finishtime" value=""></td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left" width="68">&nbsp;</td>

<td align="left" width="121">Take Description</td>

<td align="left"><textarea name="takedesc" rows="6" cols="28" style="border:0; "></textarea></td>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left" width="68">&nbsp;</td>

<td align="left" width="121"><input type="button" onClick="takesubmit()" value="提交"></td>

<td align="left" id="canceldiv"></td>

<td align="left">&nbsp;</td>

</tr>

</table></td>

</tr></table></div>

<div id=projlist style="display:none;">

<%

Response.write("<select name=""projectid"">")

do while not Recordset2.eof

Response.write("<option value="&Recordset2("projectid")&">"&Recordset2("projectname")&"</option>")

Recordset2.MoveNext

loop

Response.write("</select>")

%>

</div>

<div id=userlist style="display:none">

<%

Response.write("<select name=""userid"">")

do while not Recordset1.eof

Response.write("<option value="&Recordset1("userid")&">"&Recordset1("username")&"</option>")

Recordset1.MoveNext

loop

Response.write("</select>")

%>

</div>

<%

response.Write("<script language=javascript> var loopnub="&innercn&"</script>")

%>

<script>

document.getElementById("createuserinner").innerHTML=document.getElementById("userlist").innerHTML

document.getElementById("takeuserinner").innerHTML=document.getElementById("userlist").innerHTML

var tempstr=document.getElementById("addtk").innerHTML

document.getElementById("addtk").innerHTML=""

var projstr=document.getElementById("projlist").innerHTML

document.getElementById("projlist").innerHTML=""

</script>

</body>

</html>

<%

Recordset1.Close()

Set Recordset1 = Nothing

%>

<%

Recordset2.Close()

Set Recordset2 = Nothing

%>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有