PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/AC/m001r0103.asp

http://github.com/boss2009/ASP-site
ASP | 404 lines | 387 code | 17 blank | 0 comment | 43 complexity | 8abfae9fc1c1cc97bebc0cdafd5ba04b MD5 | raw file
  1. <%@language="JAVASCRIPT"%>
  2. <!--#include virtual="ASP/inc/ASPUtility.inc" -->
  3. <!--#include virtual="ASP/inc/ASPCheckLogin.inc" -->
  4. <!--#include virtual="ASP/Connections/cnnASP02.asp" -->
  5. <%
  6. // retrieve the sort columns
  7. var rsCol = Server.CreateObject("ADODB.Recordset");
  8. rsCol.ActiveConnection = MM_cnnASP02_STRING;
  9. rsCol.Source = "{call dbo.cp_ASP_Lkup(714)}";
  10. rsCol.CursorType = 0;
  11. rsCol.CursorLocation = 2;
  12. rsCol.LockType = 3;
  13. rsCol.Open();
  14. // retrieve only the B-code service type + Jun.16.2004
  15. var rsServiceType = Server.CreateObject("ADODB.Recordset");
  16. rsServiceType.ActiveConnection = MM_cnnASP02_STRING;
  17. rsServiceType.Source = "{call dbo.cp_service_type(0,0,0,3)}";
  18. rsServiceType.CursorType = 0;
  19. rsServiceType.CursorLocation = 2;
  20. rsServiceType.LockType = 3;
  21. rsServiceType.Open();
  22. %>
  23. <html>
  24. <head>
  25. <title>Service, Date Range Report</title>
  26. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  27. <link rel="stylesheet" href="../css/MyStyle.css" type="text/css">
  28. <script language="JavaScript" src="../js/m001Srh04.js"></script>
  29. <script language="JavaScript" src="../js/MyFunctions.js"></script>
  30. <script language="javascript">
  31. // -----------------------------------------
  32. // function CnstrFltr()
  33. // -----------------------------------------
  34. function CnstrFltr(output) {
  35. // var inspSrtBy = document.frm01r0103.SortByColumn.value;
  36. // var inspSrtOrd = document.frm01r0103.OrderBy.value;
  37. // Sort by Service type followed by Adult Client is a must + Jun.23.2004
  38. var inspSrtBy = 11;
  39. var inspSrtOrd = 0;
  40. var stgFilter = document.frm01r0103.QueryString.value;
  41. // var Show = document.frm01r0103.Show.value;
  42. if (output==1) {
  43. // document.frm01r0103.action = "m001r0103q.asp?Show="+Show+"&inspSrtBy="+inspSrtBy+"&inspSrtOrd="+inspSrtOrd+"&chvFilter=" + stgFilter ;
  44. document.frm01r0103.action = "m001r0103q.asp?inspSrtBy="+inspSrtBy+"&inspSrtOrd="+inspSrtOrd+"&chvFilter=" + stgFilter ;
  45. document.frm01r0103.submit();
  46. } else {
  47. var SearchExcel = window.open("m001r0103excel.asp?inspSrtBy="+inspSrtBy+"&inspSrtOrd="+inspSrtOrd+"&chvFilter=" + stgFilter);
  48. }
  49. }
  50. // -----------------------------------------
  51. // function initscr()
  52. // -----------------------------------------
  53. function initscr() {
  54. oStg1.style.visibility="visible";
  55. oStg2.style.visibility="hidden";
  56. oStg3.style.visibility="hidden";
  57. initializeList('frm01r0103.MultiValueServiceType','frm01r0103.MultiValueSearchOptions');
  58. document.frm01r0103.SearchType[0].focus();
  59. }
  60. function SelOpt() {
  61. var len = document.frm01r0103.SearchType.length;
  62. var Idparam = 1;
  63. for (var i=0;i <len; i++){
  64. if (document.frm01r0103.SearchType[i].checked) Idparam = i;
  65. }
  66. switch ( Idparam ) {
  67. case 0:
  68. oStg1.style.visibility="visible";
  69. oStg2.style.visibility="hidden";
  70. oStg3.style.visibility="hidden";
  71. break;
  72. case 1:
  73. oStg1.style.visibility="hidden";
  74. oStg2.style.visibility="visible";
  75. oStg3.style.visibility="visible";
  76. break;
  77. }
  78. }
  79. function Savtxt() {
  80. var stgPgQuery = "";
  81. var stgFilter = "" ;
  82. var blnFlg = false ;
  83. var len = document.frm01r0103.SearchType.length;
  84. var Idparam = 1;
  85. var stgTemp,j,k;
  86. for (var i=0;i <len; i++){
  87. if (document.frm01r0103.SearchType[i].checked) Idparam = i;
  88. }
  89. stgTemp = document.frm01r0103.QueryString.value;
  90. switch (Idparam) {
  91. case 0:
  92. var chvStg1 = document.frm01r0103.StringSearchTextOne.value;
  93. var chvStg2 = document.frm01r0103.StringSearchTextTwo.value;
  94. var chvAO1 = document.frm01r0103.AndOr.value ;
  95. if (chvStg1 == "") {
  96. alert("Enter Start Date");
  97. document.frm01r0103.StringSearchTextOne.focus();
  98. return ;
  99. }
  100. if (chvStg2 == "") {
  101. alert("Enter End Date");
  102. document.frm01r0103.StringSearchTextTwo.focus();
  103. return ;
  104. }
  105. if (!CheckDateBetween(Trim(chvStg1)+" and "+Trim(chvStg2))) {
  106. return ;
  107. }
  108. stgFilter = ACfltr_03("14","","",chvStg1,chvStg2);
  109. if (stgTemp.length > 0 ) stgTemp += " (" ;
  110. stgTemp += stgFilter + ((stgTemp.length > 0) ? ") " : " ") + chvAO1 ;
  111. break;
  112. case 1:
  113. l = "";
  114. var count = 0;
  115. var optList = document.frm01r0103.MultiValueSearchOptions;
  116. for (var x= 0; x < optList.length; x++){
  117. if (optList[x].selected) count++;
  118. }
  119. if (count == 0) {
  120. alert("Select at least one value.");
  121. optList.focus();
  122. return ;
  123. }
  124. var m = optList.length;
  125. if (optList.multiple) {
  126. for(var ii = 0; ii < m; ii++) {
  127. if (document.frm01r0103.MultiValueSearchOptions[ii].selected) {
  128. if (l.length > 0 ) l += "," ;
  129. l += document.frm01r0103.MultiValueSearchOptions[ii].value ;
  130. }
  131. }
  132. } else {
  133. l = document.frm01r0103.MultiValueSearchOptions[document.frm01r0103.MultiValueSearchOptions.selectedIndex].value
  134. }
  135. if (stgTemp.length > 0 ) stgTemp += " (" ;
  136. blnFlg = true;
  137. stgFilter += " insSrv_Code_id IN (" + l + ") " ;
  138. break;
  139. default:
  140. break;
  141. }
  142. document.frm01r0103.StringSearchTextOne.value="";
  143. if (blnFlg) {
  144. var chvAO1 = document.frm01r0103.AndOr.value ;
  145. stgTemp += stgFilter + ((stgTemp.length > 0) ? ") " : " ") + chvAO1 + " ";
  146. }
  147. document.frm01r0103.QueryString.value = stgTemp;
  148. }
  149. /////////////////////////////////////////////
  150. // -----------------------------------------
  151. // function Tip_on()
  152. // -----------------------------------------
  153. function Tip_on(stgchar){
  154. //alert("Tip_on - "+stgchar);
  155. switch (stgchar) {
  156. case "1" :
  157. TheTip1.style.visibility="visible";
  158. break;
  159. case "2" :
  160. TheTip2.style.visibility="visible";
  161. break;
  162. case "3" :
  163. TheTip3.style.visibility="visible";
  164. break;
  165. }
  166. }
  167. // -----------------------------------------
  168. // function Tip_off()
  169. // -----------------------------------------
  170. function Tip_off(stgchar) {
  171. //alert("Tip_off - "+stgchar);
  172. switch (stgchar) {
  173. case "1" :
  174. // TheTip1.innerHTML = "";
  175. // TheTip1.outerHTML = "";
  176. TheTip1.style.visibility="hidden";
  177. break;
  178. case "2" :
  179. // TheTip2.innerHTML = "";
  180. // TheTip2.outerHTML = "";
  181. TheTip2.style.visibility="hidden";
  182. break;
  183. case "3" :
  184. TheTip3.style.visibility="hidden";
  185. break;
  186. }
  187. }
  188. ////////////////////////////////////////////
  189. var objParent ;
  190. var objChild ;
  191. // -----------------------------------------
  192. // function initializeList to populate list.
  193. // -----------------------------------------
  194. function initializeList(parentList, childList){
  195. objParent = eval("document." + parentList);
  196. objChild = eval("document." + childList);
  197. if (objParent.selectedIndex < 0) {
  198. objParent.options[0].selected = true
  199. }
  200. var OptnID = objParent.options[objParent.selectedIndex].value;
  201. // map the Operand ID to the detailArray
  202. // OptnID -= 26 ;
  203. // var hfrm = document.frm01r0103 ;
  204. // oOld2.style.visibility="hidden";
  205. // hfrm.ckbOld.disabled = true;
  206. //
  207. //alert("OptnID - "+OptnID);
  208. clearList(objChild)
  209. fillDetail(OptnID)
  210. }
  211. // -----------------------------------------
  212. // function fillDetail()
  213. // -----------------------------------------
  214. function fillDetail(deptID){
  215. if(detailData2[deptID]){
  216. for(x=0; x < detailData2[deptID].length; x++){
  217. if (detailData2[deptID][x]) {
  218. var sDesc = detailData2[deptID][x];
  219. var valOption = new Option(sDesc);
  220. valOption.value = x;
  221. objChild.options[objChild.length] = valOption;
  222. }
  223. }
  224. if (objChild.length) {
  225. objChild.options[0].selected = true;
  226. }
  227. }
  228. objChild = null;
  229. objParent = null;
  230. }
  231. // -----------------------------------------
  232. // function clearList()
  233. // -----------------------------------------
  234. function clearList(obj){
  235. if (obj.length){obj.options.length = 0;}
  236. }
  237. </script>
  238. <script language="javascript">
  239. // -----------------------------------------
  240. // Build the List Box Array which house multiple lookups content
  241. // -----------------------------------------
  242. var detailData2 = new Array();
  243. // EPPD is Group 1
  244. // ------------------------ set up parameters for EPPD Service Type lookup
  245. <%
  246. // server side variables
  247. var intEPPDCnt = 0;
  248. var intSSBCnt = 0;
  249. var intID,chrData;
  250. // -----------------------------------------
  251. // EPPD Service Type lookup
  252. // -----------------------------------------
  253. var rsServiceTypeEPPD = Server.CreateObject("ADODB.Recordset");
  254. rsServiceTypeEPPD.ActiveConnection = MM_cnnASP02_STRING;
  255. rsServiceTypeEPPD.Source = "{call dbo.cp_service_type(0,0,0,3)}";
  256. rsServiceTypeEPPD.CursorType = 0;
  257. rsServiceTypeEPPD.CursorLocation = 2;
  258. rsServiceTypeEPPD.LockType = 3;
  259. rsServiceTypeEPPD.Open();
  260. if (!rsServiceTypeEPPD.EOF){
  261. Response.Write("detailData2[1] = new Array();")
  262. while (!rsServiceTypeEPPD.EOF) {
  263. Response.Write("detailData2[1]["+rsServiceTypeEPPD("insService_type_id")+"] = '"+rsServiceTypeEPPD("chvname")+"';");
  264. rsServiceTypeEPPD.MoveNext
  265. }
  266. } else {
  267. Response.Write("EPPD Service Code lookup does not exist.")
  268. }
  269. rsServiceTypeEPPD.Close();
  270. var rsServiceTypeSSB = Server.CreateObject("ADODB.Recordset");
  271. rsServiceTypeSSB.ActiveConnection = MM_cnnASP02_STRING;
  272. rsServiceTypeSSB.Source = "{call dbo.cp_service_type(0,0,0,4)}";
  273. rsServiceTypeSSB.CursorType = 0;
  274. rsServiceTypeSSB.CursorLocation = 2;
  275. rsServiceTypeSSB.LockType = 3;
  276. rsServiceTypeSSB.Open();
  277. if (!rsServiceTypeSSB.EOF){
  278. Response.Write("detailData2[2] = new Array();")
  279. while (!rsServiceTypeSSB.EOF) {
  280. Response.Write("detailData2[2]["+rsServiceTypeSSB("insService_type_id")+"] = '"+rsServiceTypeSSB("chvname")+"';");
  281. rsServiceTypeSSB.MoveNext
  282. }
  283. } else {
  284. Response.Write("SSB Service Code lookup does not exist.")
  285. }
  286. rsServiceTypeSSB.Close();
  287. %>
  288. </script>
  289. </head>
  290. <body onload="initscr();">
  291. <form name="frm01r0103" method="post" action="">
  292. <h5>B-Code Service, Date Range Report</h5>
  293. <hr>
  294. <table cellpadding="1" cellspacing="1" border="0">
  295. <tr>
  296. <td nowrap valign="top" width="120"><input type="radio" name="SearchType" value="1" checked onClick="SelOpt()" accesskey="F" tabindex="1" class="chkstyle">Service Date</td>
  297. <td nowrap valign="center"><DIV ID="oStg1" STYLE="visibility:visible">
  298. Between
  299. <input type="text" name="StringSearchTextOne" tabindex="2" size="11" maxlength="10">
  300. <span style="font-size: 7pt">(mm/dd/yyyy)</span>
  301. <input type="text" name="StringSearchTextTwo" value="<%=CurrentDate()%>" tabindex="3" size="11" maxlength="10">
  302. <span style="font-size: 7pt">(mm/dd/yyyy)</span>
  303. </DIV></td>
  304. </tr>
  305. </table>
  306. <table cellpadding="1" cellspacing="1" border="0" width="448">
  307. <tr>
  308. <td nowrap valign="top" width="117">
  309. <input type="radio" name="SearchType" value="2" onClick="SelOpt()" tabindex="4" class="chkstyle">Service Type</td>
  310. <td nowrap valign="top" width="65">
  311. <DIV ID="oStg3" STYLE="visibility:hidden">
  312. <select name="MultiValueServiceType" OnChange="initializeList('frm01r0103.MultiValueServiceType','frm01r0103.MultiValueSearchOptions')" tabindex="11">
  313. <option value="1">EPPD</option>
  314. <option value="2">SSB</option>
  315. </select>
  316. </DIV></td>
  317. <td nowrap valign="center" width="256">
  318. <DIV ID="oStg2" STYLE="visibility:hidden">
  319. Contains:
  320. <select name="MultiValueSearchOptions" size="8" width="150" align="top" multiple tabindex="5">
  321. <%
  322. while (!rsServiceType.EOF) {
  323. %>
  324. <option value="<%=rsServiceType.Fields.Item("insService_type_id").Value%>"><%=rsServiceType.Fields.Item("chvname").Value%>
  325. <%
  326. rsServiceType.MoveNext
  327. }
  328. %>
  329. </select>
  330. </DIV></td>
  331. </tr>
  332. </table>
  333. <table cellpadding="1" cellspacing="1">
  334. <tr>
  335. <td valign="top"><select name="AndOr" tabindex="6">
  336. <option value=" ">None</option>
  337. <option value="And">And</option>
  338. <option value="Or">Or</option>
  339. </select></td>
  340. </tr>
  341. </table>
  342. <br>
  343. <table cellpadding="1" cellspacing="1">
  344. <tr>
  345. <td valign="top" nowrap><input type="button" name="AddToQueryString" value="Add" tabindex="7" onClick="Savtxt()" class="btnstyle"></td>
  346. <td valign="top" nowrap><textarea name="QueryString" cols="80" rows="6" tabindex="8" accesskey="L"></textarea></td>
  347. </tr>
  348. </table>
  349. <br>
  350. <table cellpadding="1" cellspacing="1" width="205">
  351. <!--
  352. // + Jun.17.2004
  353. <tr>
  354. <td nowrap>
  355. Sort by:
  356. <select name="SortByColumn" tabindex="9">
  357. <%
  358. while (!rsCol.EOF) {
  359. %>
  360. <option value="<%=(rsCol.Fields.Item("insObjOrder").Value)%>" <%=((rsCol.Fields.Item("insObjOrder").Value == 1)?"SELECTED":"")%>><%=(rsCol.Fields.Item("chvName").Value)%></option>
  361. <%
  362. rsCol.MoveNext();
  363. }
  364. %>
  365. </select>
  366. <select name="OrderBy" tabindex="10">
  367. <option value="0">Ascending</option>
  368. <option value="1">Descending</option>
  369. </select>
  370. </td>
  371. </tr>
  372. -->
  373. <tr>
  374. <td nowrap>
  375. <input type="button" value="Search" onClick="CnstrFltr(1);" tabindex="12" class="btnstyle">
  376. <input type="button" value="Excel" onClick="CnstrFltr(2);" tabindex="13" class="btnstyle">
  377. <input type="button" value="Clear All" onClick="window.location.reload();" tabindex="14" class="btnstyle">
  378. </td>
  379. </tr>
  380. </table>
  381. </form>
  382. </body>
  383. </html>
  384. <%
  385. rsServiceType.Close();
  386. rsCol.Close();
  387. %>