Label_List.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:6k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <%
  6. Response.Buffer = True
  7. Response.Expires = -1
  8. Response.ExpiresAbsolute = Now() - 1
  9. Response.Expires = 0
  10. Response.CacheControl = "no-cache"
  11. Dim Conn
  12. MF_Default_Conn
  13. MF_Session_TF 
  14. Dim TypeSql,RsTypeObj,LableSql,RsLableObj
  15. %>
  16. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  17. <html>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  20. <title>标签插入</title>
  21. </head>
  22. <style>
  23. .LableSelectItem {
  24. background-color:highlight;
  25. cursor: hand;
  26. color: white;
  27. text-decoration: underline;
  28. }
  29. .LableItem {
  30. cursor: hand;
  31. }
  32. </style>
  33. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  34. <body ondragstart="return false;" onselectstart="return false;" topmargin="0" leftmargin="0">
  35. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  36. <%
  37. TypeSql = "Select Id,ClassName,ParentID from FS_MF_LableClass where ParentID=0"
  38. Set RsTypeObj = Conn.Execute(TypeSql)
  39. if Not RsTypeObj.Eof then
  40. do while Not RsTypeObj.Eof
  41. %>
  42.   <tr ParentID="<% = RsTypeObj("ParentID") %>">
  43. <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  44.         <tr>
  45.           <td width="21" valign="top"><img src="../Images/Folder/folder.gif" width="20" height="16"></td>
  46.           <td width="954" valign="bottom"><span Extend="False" class="LableItem" TypeID="<% = RsTypeObj("ID") %>" onClick="SelectFolder(this)">
  47.           <% = RsTypeObj("ClassName") %></span></td>
  48.         </tr>
  49.       </table>
  50.     </td>
  51. </tr>
  52. <%
  53. Response.Write(GetLableList(RsTypeObj("ID"),"&nbsp;&nbsp;&nbsp;&nbsp;"," style=""display:none;"" "))
  54. Response.Write(GetChildTypeList(RsTypeObj("ID"),""," style=""display:none;"" "))
  55. RsTypeObj.MoveNext
  56. loop
  57. end if
  58. Response.Write(GetLableList(0,"",""))
  59. %>
  60. </table>
  61. </body>
  62. </html>
  63. <%
  64. Set Conn = Nothing
  65. Function GetLableList(TypeID,CompatStr,ShowStr)
  66. Dim ListSql,RsListObj,TempStr
  67. ListSql = "Select ID,LableName,LableClassID from FS_MF_Lable where LableClassID=" & TypeID
  68. Set RsListObj = Conn.Execute(ListSql)
  69. TempStr = CompatStr & "&nbsp;"
  70. do while Not RsListObj.Eof
  71.    GetLableList = GetLableList & "<tr ParentID=""" & RsListObj("LableClassID") & """ " & ShowStr & ">" & Chr(13) & Chr(10)
  72. GetLableList = GetLableList & "<td>" & Chr(13) & Chr(10)
  73. GetLableList = GetLableList & "<table border=""0"" cellspacing=""0"" cellpadding=""0"">" & Chr(13) & Chr(10) & "<tr>"  & Chr(13) & Chr(10) & "<td valign=""top"" align=""right"">" & CompatStr & "<img src=""../Images/L.gif""></td>"
  74. GetLableList = GetLableList & "<td  valign=""bottom""><span class=""LableItem"" LableName=""" & RsListObj("LableName") & """ onclick=""SelectLable(this);"" onDblClick=""SubmitLable(this)"">" & Replace(Replace(RsListObj("LableName"),"{FS400_",""),"}","") & "</span></td>" & Chr(13) & Chr(10) & "</tr>" & Chr(13) & Chr(10) & "</table>"
  75. GetLableList = GetLableList & "</td>" & Chr(13) & Chr(10)
  76. GetLableList = GetLableList & "</tr>" & Chr(13) & Chr(10)
  77. RsListObj.MoveNext
  78. Loop
  79. Set RsListObj = Nothing
  80. End Function
  81. Function GetChildTypeList(TypeID,CompatStr,ShowStr)
  82. Dim ChildTypeListRs,ChildTypeListStr,TempStr
  83. Set ChildTypeListRs = Conn.Execute("Select ID,ClassName,ParentID from FS_MF_LableClass where ParentID=" & TypeID)
  84. TempStr = CompatStr & "&nbsp;"
  85. do while Not ChildTypeListRs.Eof
  86.    GetChildTypeList = GetChildTypeList & "<tr TypeFlag=""Class"" ParentID=""" & ChildTypeListRs("ParentID") & """ " & ShowStr & ">" & Chr(13) & Chr(10)
  87. GetChildTypeList = GetChildTypeList & "<td>" & Chr(13) & Chr(10)
  88. GetChildTypeList = GetChildTypeList & "<table border=""0"" cellspacing=""0"" cellpadding=""0"">" & Chr(13) & Chr(10) & "<tr>"  & Chr(13) & Chr(10) & "<td>" & TempStr & "<img src=""../Images/Folder/folder.gif""></td>"
  89. GetChildTypeList = GetChildTypeList & "<td><span class=""LableItem"" TypeID=""" & ChildTypeListRs("ID") & """ Extend=""False"" onClick=""SelectFolder(this)"">" & ChildTypeListRs("ClassName") & "</span></td>" & Chr(13) & Chr(10) & "</tr>" & Chr(13) & Chr(10) & "</table>"
  90. GetChildTypeList = GetChildTypeList & "</td>" & Chr(13) & Chr(10)
  91. GetChildTypeList = GetChildTypeList & "</tr>" & Chr(13) & Chr(10)
  92. GetChildTypeList = GetChildTypeList & Chr(13) & Chr(10) & GetLableList(ChildTypeListRs("ID"),"&nbsp;&nbsp;&nbsp;&nbsp;" & TempStr,ShowStr)
  93. GetChildTypeList = GetChildTypeList & GetChildTypeList(ChildTypeListRs("ID"),TempStr,ShowStr)
  94. ChildTypeListRs.MoveNext
  95. loop
  96. ChildTypeListRs.Close
  97. Set ChildTypeListRs = Nothing
  98. End Function
  99. %>
  100. <script language="JavaScript">
  101. function SelectLable(Obj)
  102. {
  103. for (var i=0;i<document.all.length;i++)
  104. {
  105. if (document.all(i).className=='LableSelectItem') document.all(i).className='LableItem';
  106. }
  107. Obj.className='LableSelectItem';
  108. }
  109. function SelectFolder(Obj)
  110. {
  111. var CurrObj;
  112. for (var i=0;i<document.all.length;i++)
  113. {
  114. if (document.all(i).className=='LableSelectItem') document.all(i).className='LableItem';
  115. }
  116. Obj.className='LableSelectItem';
  117. if (Obj.Extend=='True')
  118. {
  119. ShowOrDisplay(Obj,'none',true);
  120. Obj.Extend='False';
  121. }
  122. else
  123. {
  124. ShowOrDisplay(Obj,'',false);
  125. Obj.Extend='True';
  126. }
  127. }
  128. function ShowOrDisplay(Obj,Flag,Tag)
  129. {
  130. for (var i=0;i<document.all.length;i++)
  131. {
  132. CurrObj=document.all(i);
  133. if (CurrObj.ParentID==Obj.TypeID)
  134. {
  135. CurrObj.style.display=Flag;
  136. if (Tag) 
  137. if (CurrObj.TypeFlag=='Class') ShowOrDisplay(CurrObj.children(0).children(0).children(0).children(0).children(1).children(0),Flag,Tag);
  138. }
  139. }
  140. }
  141. function SubmitLable(Obj)
  142. {
  143. var LableName=Obj.LableName;
  144. window.returnValue=LableName;
  145. window.close();
  146. }
  147. window.onunload=SetReturnValue;
  148. function SetReturnValue()
  149. {
  150. if (typeof(window.returnValue)!='string') window.returnValue='';
  151. }
  152. </script>