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.

230 lines
7.2 KiB

  1. <%@ Language=VBScript %>
  2. <!-- #include file="asp.inc" -->
  3. <%
  4. DIM sSel, iRS, iRE, iRET, iRP, iRT, oConn, oCmd, oRs, oRecord, iStat, sStat
  5. DIM iML, iMH
  6. iRP = 200
  7. iRS = 1
  8. iRE = 1
  9. iRT = 0
  10. iRET = 0
  11. Response.Expires = -1000
  12. iML = Request.QueryString ("ML")
  13. iMH = Request.QueryString ("MH")
  14. On Error Resume Next
  15. Set oConn = Server.CreateObject("ADODB.Connection")
  16. oConn.Open Application("StrConnect")
  17. if Err.number <> 0 Then
  18. Response.Write Err.description
  19. Response.End
  20. End If
  21. On Error Goto 0
  22. Set oCmd = Server.CreateObject("ADODB.Command")
  23. oCmd.ActiveConnection = oConn
  24. oCmd.CommandType = adCmdStoredProc
  25. if (Request.ServerVariables("REQUEST_METHOD") = "POST") Then
  26. DIM xmldoc, objXML
  27. set xmldoc = CreateObject("Microsoft.XMLDOM")
  28. if xmldoc.load(Request) = false Then %>
  29. <h4>Not a valid XML.</h4>
  30. <% End If
  31. Set objXML = xmldoc.getElementsByTagName("RS")
  32. if (objXML.length > 0) Then iRS = CLng(objXML.item(0).text)
  33. Set objXML = xmldoc.getElementsByTagName("RP")
  34. if (objXML.length > 0) Then iRP = CLng(objXML.item(0).text)
  35. Set objXML = Nothing
  36. Set xmldoc = Nothing
  37. ' start query
  38. sWhere = "[TblRCIncidents].[iMemberHigh] = " + iMH + " And [TblRCIncidents].[iMemberLow] = " + iML
  39. oCmd.CommandText = "RunRCIncidentQueryCust"
  40. oCmd.Parameters.Append oCmd.CreateParameter("@sWhere", adVarWChar,adParamInput,2000,sWhere)
  41. oCmd.Parameters.Append oCmd.CreateParameter("@iStart",adInteger,adParamInput,,iRS)
  42. oCmd.Parameters.Append oCmd.CreateParameter("@iGet",adInteger,adParamInput,,iRP)
  43. oCmd.Parameters.Append oCmd.CreateParameter("@iTotal",adInteger,adParamOutput)
  44. oCmd.Parameters.Append oCmd.CreateParameter("@iRet",adInteger,adParamOutput)
  45. Set oRecord = oCmd.Execute
  46. if oRecord.state <> adStateClosed Then
  47. avarData = oRecord.GetRows
  48. End If
  49. Set oRecord = Nothing
  50. iRT = oCmd.Parameters("@iTotal")
  51. iRET = oCmd.Parameters("@iRet")
  52. iRE = iRS + iRET - 1 %>
  53. <table width="100%">
  54. <tr>
  55. <% If iRET = 0 Then %>
  56. <td>No record.</td>
  57. <td style="display:none"><font id="idRS"><%=iRS%></font> through <font id="idRE"><%=iRE%></font> of <font id="idRT"><%=iRT%></font> records.</td>
  58. <% Else %>
  59. <td><font id="idRS"><%=iRS%></font> through <font id="idRE"><%=iRE%></font> of <font id="idRT"><%=iRT%></font> records.</td>
  60. <td align="right" valign="center" NOWRAP>
  61. <img src="images/first.bmp" OnClick="NavRec()">
  62. <img src="images/c_left.gif" OnClick="NavRec()" WIDTH="15" HEIGHT="15">
  63. <img src="images/c_right.gif" OnClick="NavRec()" WIDTH="15" HEIGHT="15">
  64. <img src="images/last.bmp" OnClick="NavRec()">
  65. &nbsp;</td>
  66. <% End If %>
  67. <td width="35pt">
  68. <input value="<%=iRP%>" style="width:100%" id="idRP"></td>
  69. <td align="left" width="100px">
  70. records/page</td>
  71. </tr>
  72. </table>
  73. <% ' Records of Report %>
  74. <table id="TblRpt" width="100%" border="1" cellPadding="0" cellSpacing="0" style="table-layout:fixed;border-bottom;solid 1px CFD5E5" bordercolor="PowderBlue" bordercolordark="LightBlue" bordercolorlight="AliceBlue">
  75. <thead>
  76. <tr bgcolor="Gainsboro">
  77. <td class="SortColTitle" OnClick="Sort()" width=80 align="center">IncidentID</td>
  78. <td class="SortColTitle" OnClick="Sort()">sDescription</td>
  79. <td class="SortColTitle" OnClick="Sort()" width=140 align="center">dtUploadDate</td>
  80. <td class="SortColTitle" OnClick="Sort()" width=80 align="center">sStatus</td>
  81. </tr>
  82. </thead>
  83. <tbody>
  84. <% if iRET > 0 Then
  85. For i =0 To UBound(avarData, 2)
  86. %>
  87. <tr>
  88. <td width=80 align="center"><%=avarData(0, i)%></td>
  89. <td><%=Trim(avarData(2, i))%></td>
  90. <td width=140 align="center"><%=Trim(avarData(1, i))%></td>
  91. <% iStat = avarData(3, i)
  92. sStat = "Unknown"
  93. If iStat = 0 Then sStat = "Active"
  94. If iStat = 1 Then sStat = "Resolved" %>
  95. <td width=80 align="center"><%=sStat%></td>
  96. </tr>
  97. <% Next
  98. End If %>
  99. </tbody>
  100. </table>
  101. <% Response.End
  102. Else
  103. ' Do nothing.
  104. End If
  105. set oRs = Nothing
  106. %>
  107. <!-- #include file="header.inc" -->
  108. <html>
  109. <head>
  110. <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  111. <title>Remote control</title>
  112. <link REL="STYLESHEET" HREF="style.css" TYPE="text/css">
  113. </head>
  114. <body onload="Go()">
  115. <center>
  116. <font color="MediumBlue" size="4"><b>Remote Control</b></font>&nbsp;[ Customer Query Tool ]
  117. </center>
  118. <hr>
  119. <div id="idRpt">
  120. <table width="100%">
  121. <tr>
  122. <td>No record.</td>
  123. <td style="display:none"><font id="idRS">1</font> through <font id="idRE">1</font> of <font id="idRT"><%=iRT%></font> records.</td>
  124. <td width="35pt">
  125. <input value="<%=iRP%>" style="width:100%" id="idRP"></td>
  126. <td align="left" width="100px">
  127. records/page</td>
  128. </tr>
  129. </table>
  130. <table id="TblRpt" width="100%" border="1" cellPadding="0" cellSpacing="0" style="table-layout:fixed;border-bottom;solid 1px CFD5E5" bordercolor="PowderBlue" bordercolordark="LightBlue" bordercolorlight="AliceBlue">
  131. <thead>
  132. <tr bgcolor="Gainsboro">
  133. <td class="SortColTitle" OnClick="Sort()" width=80 align="center">iIncidentID</td>
  134. <td class="SortColTitle" OnClick="Sort()">sDescription</td>
  135. <td class="SortColTitle" OnClick="Sort()" width=140 align="center">dtUploadDate</td>
  136. <td class="SortColTitle" OnClick="Sort()" width=80 align="center">sStatus</td>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. </tbody>
  141. </table>
  142. </div>
  143. <textarea id="tTest" style="display:none"></textarea>
  144. <div id="idHide" style="display:none;">
  145. <%=sSel%>
  146. <%=sOpInt%>
  147. <%=sOpStr%>
  148. <%=sOpDate%>
  149. <%=sOpTxt%>
  150. </div>
  151. </body>
  152. <%
  153. set oCmd = Nothing
  154. oConn.Close
  155. set oConn = Nothing
  156. %>
  157. <script Language="JavaScript">
  158. var sDel = '<A href="JavaScript:NoOp()" OnClick="DelRow()" class="EnableInput">X</A>';
  159. var sInput = '<input value="" width="100%" OnBlur="DisableInput()">';
  160. var sGrp1 = '<A href="JavaScript:NoOp()" class="GRPTAG" OnClick="GrpClick()">(</A>';
  161. var sGrp2 = '<A href="JavaScript:NoOp()" class="GRPTAG" OnClick="GrpClick()">)</A>';
  162. var sAnd = '<A href="JavaScript:NoOp()" OnClick="TogAnd()" class="clsAND">And</A>';
  163. var sQry = '';
  164. var sWrap0 = '<A href="JavaScript:NoOp()" OnClick="EnableInput()" class="EnableInput">';
  165. var sWrap1 = '</A>';
  166. // Read in the values passed as Request.
  167. var iMemL = <%=iML%>
  168. var iMemH = <%=iMH%>
  169. function TxtWrap( s ) {
  170. return sWrap0 + s + sWrap1;
  171. }
  172. function Go( iiRS ) {
  173. var L_RECPAGE_MSG = "The number of records/page should be between 0 and 200.";
  174. var oRow = null, i=0, iGrp = 0;
  175. var oField, oOp, oInput;
  176. if ( iiRS == null)
  177. sQry += '<RS>' + 1 + '</RS>';
  178. else
  179. sQry += '<RS>' + iiRS + '</RS>';
  180. sQry += '<RP>' + idRP.value + '</RP>';
  181. sQry = '<XML>' + sQry + '</XML>';
  182. var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  183. var sPostAsp = "IncidentCustomer.asp?MH=" + iMemH + "&ML=" + iMemL;
  184. xmlhttp.Open("POST", sPostAsp, false);
  185. xmlhttp.Send(sQry);
  186. idRpt.innerHTML = xmlhttp.responseText;
  187. }
  188. function NavRec() {
  189. var obj = window.event.srcElement;
  190. var iRP = parseInt(idRP.value);
  191. var iRT = parseInt(idRT.innerText);
  192. var iRS = parseInt(idRS.innerText);
  193. var iRET = parseInt(idRE.innerText) - iRS + 1;
  194. if (obj.src.indexOf('first') > 0) {
  195. if (iRS <= 1) return;
  196. iRS = 1;
  197. }
  198. else if (obj.src.indexOf('last') > 0) {
  199. if (iRS + iRET >= iRT) return;
  200. iRS = iRT - ((iRT - iRET) % iRP) + 1;
  201. if (iRS%iRP == 1)
  202. iRS = iRS - iRP;
  203. }
  204. else if (obj.src.indexOf('right') > 0) {
  205. if (iRS + iRET >= iRT) return;
  206. if (iRS + iRP >= iRT) iRS += iRET + 1;
  207. else iRS += iRP;
  208. }
  209. else { // left
  210. if (iRS <= 1) return;
  211. iRS -= iRP;
  212. if (iRS < 0) iRS = 1;
  213. }
  214. Go( iRS );
  215. }
  216. </script>
  217. <script Language="JavaScript" Src="sort.js">
  218. </script>
  219. </html>