Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
7.3 KiB

  1. <%
  2. Response.Expires = 0
  3. %>
  4. <!--
  5. edit display list or sort list ( as used by raid2.asp )
  6. QueryString : type=sort|list
  7. if sort then Session("FieldSort") is updated
  8. otherwise Session("FieldList")
  9. -->
  10. <html>
  11. <head>
  12. <style type="text/css">
  13. .st1 {color:red}
  14. .act {color:menutext; background:menu; cursor:default}
  15. .list {cursor:hand;}
  16. .list UL {list-style-type:none; margin-left:2pt;
  17. margin-top:0pt; margin-bottom:0pt}
  18. .list UL LI {margin-top:0pt; margin-bottom:0pt}
  19. .list UL LI.selected {background:navy; color:white}
  20. .ac {width:60pt}
  21. </style>
  22. <%
  23. Set Conn = Server.CreateObject("ADODB.Connection")
  24. Set Comm = Server.CreateObject("ADODB.Command")
  25. Set RS = Server.CreateObject("ADODB.Recordset")
  26. Conn.Open "DSN=Windows NT Bugs:Raid4;UID=ntbugRW;PWD=ntbugRW"
  27. Comm.CommandText = "Select DBColName,FriendlyName,Type from flds Order by DBColName"
  28. Set Comm.ActiveConnection = Conn
  29. Set RS.Source = Comm
  30. RS.Open
  31. FldArray = RS.GetRows()
  32. RS.Close
  33. Conn.Close
  34. if Request.QueryString("type") = "sort" then
  35. fl = "," & Session("FieldSort") & ","
  36. Response.Write "<title>Field sort order</title>"
  37. fSort = TRUE
  38. sClick = "setorder('dest');"
  39. else
  40. fl = "," & Session("FieldList") & ","
  41. Response.Write "<title>Field list</title>"
  42. fSort = FALSE
  43. sClick = ""
  44. end if
  45. Response.Write "<script language=" & chr(34) & "JavaScript" & chr(34) & ">"
  46. Response.Write "var FldDBName = new Array("
  47. for i = 0 to UBound(FldArray,2)
  48. if FldArray(2,i) < 12 then
  49. if i > 0 then
  50. Response.Write ","
  51. end if
  52. Response.Write chr(34) & FldArray(0,i) & chr(34)
  53. end if
  54. next
  55. Response.Write ");"
  56. %>
  57. // set asc/desc radio button based on current selected option
  58. function setorder( dest ) {
  59. var elDest = document.all[dest];
  60. for ( i = 0 ; i < elDest.options.length ; ++i )
  61. if ( elDest.options[i].selected ) {
  62. if ( elDest.options[i].value.indexOf(" Desc") != -1 ) {
  63. bl.Asce.checked = false;
  64. bl.Desc.checked = true;
  65. }
  66. else {
  67. bl.Asce.checked = true;
  68. bl.Desc.checked = false;
  69. }
  70. break;
  71. }
  72. }
  73. // update option order info
  74. function updord( dest, va ) {
  75. var elDest = document.all[dest];
  76. for ( i = 0 ; i < elDest.options.length ; ++i )
  77. if ( elDest.options[i].selected ) {
  78. p = elDest.options[i].value.indexOf(" ");
  79. if ( p == -1 )
  80. s = elDest.options[i].value + " ";
  81. else
  82. s = elDest.options[i].value.substring(0,p+1)
  83. elDest.options[i].value = s + va;
  84. break;
  85. }
  86. }
  87. function copy(src, dest, va ) {
  88. if ( va != null && va != "" ) {
  89. var elSrc = document.all[src];
  90. var elDest = document.all[dest];
  91. var elOption = new Option;
  92. elOption.value = va;
  93. for ( i = 0 ; i < elSrc.options.length ; ++i ) {
  94. if ( elSrc.options[i].value == elOption.value ) {
  95. elOption.text = elSrc.options[i].text;
  96. elSrc.options.remove( i );
  97. break;
  98. }
  99. }
  100. for ( i = 0 ; i < elDest.options.length ; ++i )
  101. if ( elDest.options[i].selected )
  102. break;
  103. elDest.options.add(elOption,i);
  104. }
  105. }
  106. function trans() {
  107. var elDest = document.all['dest'];
  108. s = "";
  109. for ( i = 0 ; i < elDest.options.length ; ++i ) {
  110. if ( i != 0 )
  111. s = s + ",";
  112. s = s + elDest.options[i].value;
  113. }
  114. window.returnValue = s;
  115. event.returnValue = false;
  116. window.close();
  117. }
  118. function moveup() {
  119. var elDest = document.all['dest'];
  120. for ( i = 1 ; i < elDest.options.length ; ++i )
  121. if ( elDest.options[i].selected ) {
  122. elOption = elDest.options[i];
  123. elDest.options.remove(i);
  124. elDest.options.add(elOption,i-1);
  125. elDest.options[i-1].selected = true;
  126. break;
  127. }
  128. }
  129. function movedown() {
  130. var elDest = document.all['dest'];
  131. for ( i = 0 ; i < elDest.options.length - 1; ++i )
  132. if ( elDest.options[i].selected ) {
  133. elOption = elDest.options[i];
  134. elDest.options.remove(i);
  135. elDest.options.add(elOption,i+1);
  136. elDest.options[i+1].selected = true;
  137. break;
  138. }
  139. }
  140. </script>
  141. </head>
  142. <body bgcolor=#c0c0c0>
  143. <FORM action="bl.asp" method=POST ID=bl>
  144. <INPUT TYPE=HIDDEN ID="fl"></INPUT>
  145. <TABLE>
  146. <TR>
  147. <TD>
  148. <DIV CLASS="list">
  149. <SELECT ID="src" SIZE=8 ONDBLCLICK="copy('src', 'dest', event.srcElement.value);">
  150. <%
  151. ix = 0
  152. for i = 0 to UBound(FldArray,2)
  153. if FldArray(2,i) < 12 then
  154. if instr(1,fl,"," & FldArray(0,i)) = 0 then
  155. Response.Write "<OPTION VALUE=" & chr(34) & FldArray(0,i)
  156. if fSort then
  157. Response.Write " Asc"
  158. end if
  159. Response.Write chr(34) & ">" & FldArray(0,i)
  160. end if
  161. ix = ix + 1
  162. end if
  163. next
  164. %>
  165. </SELECT>
  166. </DIV>
  167. </TD><TD>
  168. <BR><br>
  169. <P><INPUT TYPE=BUTTON VALUE="->"
  170. ONCLICK="copy('src', 'dest', src.value );">
  171. <P><INPUT TYPE=BUTTON VALUE="<-"
  172. ONCLICK="copy('dest', 'src', dest.value );">
  173. <BR><BR><br>
  174. </TD><TD>
  175. <DIV class="list">
  176. <SELECT ID="dest" SIZE=8 ONDBLCLICK="copy('dest','src', event.srcElement.value);" ONCLICK="<%=sClick%>">
  177. <%
  178. ix = 1
  179. do while true
  180. nx = instr(ix,fl,",")
  181. if nx = 0 then
  182. exit do
  183. end if
  184. if nx > 1 then
  185. Response.Write "<OPTION ORDER=" & chr(34) & ">" & chr(34) & " VALUE=" & chr(34) & mid(fl,ix,nx-ix) & chr(34) & ">"
  186. if fSort then
  187. Response.Write mid(fl,ix,instr(ix,fl," ")-ix)
  188. else
  189. Response.Write mid(fl,ix,nx-ix)
  190. end if
  191. end if
  192. ix = nx + 1
  193. loop
  194. %>
  195. </SELECT>
  196. </DIV>
  197. </TD>
  198. <td align="center">
  199. <INPUT class="ac" TYPE=BUTTON onclick="trans()" VALUE="OK"></INPUT><br>
  200. <INPUT class="ac" TYPE=RESET onclick="window.close();" VALUE="Cancel"></INPUT><br>
  201. <%
  202. if fSort then
  203. Response.Write "<INPUT name=" & chr(34) & "AscDes" & chr(34) & " id=" & chr(34) & "Asce" & chr(34) & " class=" & chr(34) & "ac" & chr(34) & " TYPE=RADIO VALUE=" & chr(34) & "Asc" & chr(34)
  204. Response.Write " CHECKED onclick=" & chr(34) & "updord('dest','Asc');" & chr(34)
  205. Response.Write ">Ascending</INPUT><br>"
  206. Response.Write "<INPUT name=" & chr(34) & "AscDes" & chr(34) & " id=" & chr(34) & "Desc" & chr(34) & " class=" & chr(34) & "ac" & chr(34) & " TYPE=RADIO VALUE=" & chr(34) & "Desc" & chr(34)
  207. Response.Write " onclick=" & chr(34) & "updord('dest','Desc');" & chr(34)
  208. Response.Write ">Descending</INPUT><br>"
  209. end if
  210. %>
  211. <INPUT class="ac" TYPE=BUTTON onclick="moveup()" VALUE="Move Up"></INPUT><br>
  212. <INPUT class="ac" TYPE=BUTTON onclick="movedown()" VALUE="Move Down"></INPUT><br>
  213. </td>
  214. </TR>
  215. </TABLE>
  216. </FORM>
  217. </BODY>
  218. </html>