PageRenderTime 29ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/AC/m001e0603.asp

http://github.com/boss2009/ASP-site
ASP | 270 lines | 259 code | 11 blank | 0 comment | 33 complexity | 7309ff16a1a25bc0ac5c9443071d5ea0 MD5 | raw file
  1. <%@language="JAVASCRIPT"%>
  2. <!--#include file="../inc/ASPUtility.inc" -->
  3. <!--#include file="../Connections/cnnASP02.asp" -->
  4. <!--#include file="../inc/ASPCheckLogin.inc" -->
  5. <%
  6. var MM_editAction = Request.ServerVariables("URL");
  7. if (Request.QueryString) {
  8. MM_editAction += "?" + Request.QueryString;
  9. }
  10. if (String(Request.Form("MM_update")) == "true"){
  11. var rsGrantEligibility = Server.CreateObject("ADODB.Recordset");
  12. rsGrantEligibility.ActiveConnection = MM_cnnASP02_STRING;
  13. rsGrantEligibility.Source = "{call dbo.cp_grant_elgbty3("+ Request.Form("ReferralDate") + ","+Request.QueryString("intAdult_id")+","+Request.Form("GrantPeriod")+",0,'E',0)}";
  14. rsGrantEligibility.CursorType = 0;
  15. rsGrantEligibility.CursorLocation = 2;
  16. rsGrantEligibility.LockType = 3;
  17. rsGrantEligibility.Open();
  18. Response.Redirect("UpdateSuccessful.asp?page=m001q0603.asp&intAdult_id="+Request.QueryString("intAdult_id"));
  19. }
  20. var rsGrantEligibility = Server.CreateObject("ADODB.Recordset");
  21. rsGrantEligibility.ActiveConnection = MM_cnnASP02_STRING;
  22. rsGrantEligibility.Source = "{call dbo.cp_grant_elgbty3("+ Request.QueryString("intReferral_id") + ","+Request.QueryString("intAdult_id")+",0,1,'Q',0)}";
  23. rsGrantEligibility.CursorType = 0;
  24. rsGrantEligibility.CursorLocation = 2;
  25. rsGrantEligibility.LockType = 3;
  26. rsGrantEligibility.Open();
  27. var rsGrantPeriod = Server.CreateObject("ADODB.Recordset");
  28. rsGrantPeriod.ActiveConnection = MM_cnnASP02_STRING;
  29. rsGrantPeriod.Source = "{call dbo.cp_list_elgbty_period2(0,"+ Request.QueryString("intAdult_id") + ",0,'','',0.0,0.0,0.0,0,'',0,'',0,'Q',0)}";
  30. rsGrantPeriod.CursorType = 0;
  31. rsGrantPeriod.CursorLocation = 2;
  32. rsGrantPeriod.LockType = 3;
  33. rsGrantPeriod.Open();
  34. var rsReferralDate = Server.CreateObject("ADODB.Recordset");
  35. rsReferralDate.ActiveConnection = MM_cnnASP02_STRING;
  36. rsReferralDate.Source = "{call dbo.cp_list_referrals("+ Request.QueryString("intAdult_id") + ",0,0,1,0)}";
  37. rsReferralDate.CursorType = 0;
  38. rsReferralDate.CursorLocation = 2;
  39. rsReferralDate.LockType = 3;
  40. rsReferralDate.Open();
  41. var rsReferralDate_Total = 0
  42. while (!rsReferralDate.EOF) {
  43. rsReferralDate_Total++;
  44. rsReferralDate.MoveNext();
  45. }
  46. if (rsReferralDate_Total > 0) rsReferralDate.MoveFirst();
  47. var ChkGrantEligibility = Server.CreateObject("ADODB.Command");
  48. ChkGrantEligibility.ActiveConnection = MM_cnnASP02_STRING;
  49. ChkGrantEligibility.CommandText = "dbo.cp_Chk_Grant_Elgbty";
  50. ChkGrantEligibility.CommandType = 4;
  51. ChkGrantEligibility.CommandTimeout = 0;
  52. ChkGrantEligibility.Prepared = true;
  53. ChkGrantEligibility.Parameters.Append(ChkGrantEligibility.CreateParameter("RETURN_VALUE", 3, 4));
  54. ChkGrantEligibility.Parameters.Append(ChkGrantEligibility.CreateParameter("@intAdult_id", 3, 1,10000,Request.QueryString("intAdult_id")));
  55. ChkGrantEligibility.Parameters.Append(ChkGrantEligibility.CreateParameter("@insRtnFlag", 2, 2));
  56. ChkGrantEligibility.Execute();
  57. %>
  58. <html>
  59. <head>
  60. <title>Update Grant Eligibility</title>
  61. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  62. <link rel="stylesheet" href="../css/MyStyle.css" type="text/css">
  63. <script language="Javascript" src="../js/MyFunctions.js"></script>
  64. <script for="document" event="onkeyup()" language="JavaScript">
  65. if (window.event.ctrlKey) {
  66. switch (window.event.keyCode) {
  67. case 83 :
  68. //alert("S");
  69. Save();
  70. break;
  71. case 85:
  72. //alert("U");
  73. document.frm0603.reset();
  74. break;
  75. case 76 :
  76. //alert("L");
  77. window.location.href='m001q0603.asp?<%=Request.QueryString%>';
  78. break;
  79. }
  80. }
  81. </script>
  82. <script language="Javascript">
  83. function openWindow(page, name){
  84. if (page!='nothing') win1=window.open(page, name, "width=600,height=570,scrollbars=1,left=0,top=0,status=1");
  85. return ;
  86. }
  87. var ReferralArray = new Array(<%=rsReferralDate_Total%>);
  88. ReferralArray[0] = new Array(6);
  89. ReferralArray[0][0] = 0;
  90. ReferralArray[0][1] = 0;
  91. ReferralArray[0][2] = 0;
  92. ReferralArray[0][3] = 0;
  93. ReferralArray[0][4] = 0;
  94. ReferralArray[0][5] = 0;
  95. <%
  96. var i = 1;
  97. while (!rsReferralDate.EOF) {
  98. %>
  99. ReferralArray[<%=i%>] = new Array(6);
  100. ReferralArray[<%=i%>][0] = <%=rsReferralDate.Fields.Item("intReferral_id").Value%>;
  101. ReferralArray[<%=i%>][1] = <%=((rsReferralDate.Fields.Item("bitIs_Re-referral")=="1")?"1":"0")%>;
  102. ReferralArray[<%=i%>][2] = <%=((rsReferralDate.Fields.Item("bitIs_PS_CSG_Grant")=="1")?"1":"0")%>;
  103. ReferralArray[<%=i%>][3] = <%=((rsReferralDate.Fields.Item("bitIs_PS_APSD_Grant")=="1")?"1":"0")%>;
  104. ReferralArray[<%=i%>][4] = <%=((rsReferralDate.Fields.Item("bitIs_VRS_CSG_Grant")=="1")?"1":"0")%>;
  105. ReferralArray[<%=i%>][5] = <%=((rsReferralDate.Fields.Item("insGrnt_Elgbty").Value>0)?rsReferralDate.Fields.Item("insGrnt_Elgbty").Value:"0")%>;
  106. <%
  107. i++;
  108. rsReferralDate.MoveNext();
  109. }
  110. if (rsReferralDate_Total>0) rsReferralDate.MoveFirst();
  111. %>
  112. function Save(){
  113. if (document.frm0603.ReferralDate.value==0) {
  114. alert("Select a referral date before linking to grant period.");
  115. return ;
  116. }
  117. var j = 0
  118. if (String(document.frm0603.LinkToReferral.length)=="undefined") {
  119. if (document.frm0603.LinkToReferral.checked) j++;
  120. } else {
  121. for (var i=0; i< document.frm0603.LinkToReferral.length; i++) {
  122. if (document.frm0603.LinkToReferral[i].checked) j++;
  123. }
  124. }
  125. if (j==0) {
  126. alert("Select a grant study period.");
  127. return ;
  128. }
  129. if (j>1) {
  130. alert("A referral can only have one grant period assigned.");
  131. return ;
  132. }
  133. document.frm0603.GrantPeriod.value=0;
  134. if (String(document.frm0603.LinkToReferral.length)=="undefined") {
  135. if (document.frm0603.LinkToReferral.checked) document.frm0603.GrantPeriod.value=document.frm0603.LinkToReferral.value;
  136. } else {
  137. for (var i=0; i< document.frm0603.LinkToReferral.length; i++) {
  138. if (document.frm0603.LinkToReferral[i].checked) document.frm0603.GrantPeriod.value=document.frm0603.LinkToReferral[i].value;
  139. }
  140. }
  141. document.frm0603.submit();
  142. }
  143. function Init(){
  144. document.frm0603.ReferralDate.focus();
  145. ChangeReferralDate();
  146. }
  147. function SetGrantPeriod(grant_id){
  148. <%
  149. if (!rsGrantPeriod.EOF) {
  150. %>
  151. if (String(document.frm0603.LinkToReferral.length)=="undefined") {
  152. if (document.frm0603.LinkToReferral.value==grant_id) {
  153. document.frm0603.LinkToReferral.checked=true;
  154. } else {
  155. document.frm0603.LinkToReferral.checked=false;
  156. }
  157. } else {
  158. for (var i=0; i< document.frm0603.LinkToReferral.length; i++) {
  159. if (document.frm0603.LinkToReferral[i].value==grant_id) {
  160. document.frm0603.LinkToReferral[i].checked=true;
  161. } else {
  162. document.frm0603.LinkToReferral[i].checked=false;
  163. }
  164. }
  165. }
  166. <%
  167. }
  168. %>
  169. }
  170. function ChangeReferralDate(){
  171. document.frm0603.ReferralType.value=ReferralArray[document.frm0603.ReferralDate.selectedIndex][1];
  172. document.frm0603.PostSecondaryCSG.checked=ReferralArray[document.frm0603.ReferralDate.selectedIndex][2];
  173. document.frm0603.PostSecondaryAPSD.checked=ReferralArray[document.frm0603.ReferralDate.selectedIndex][3];
  174. document.frm0603.EPPDCSG.checked=ReferralArray[document.frm0603.ReferralDate.selectedIndex][4];
  175. SetGrantPeriod(ReferralArray[document.frm0603.ReferralDate.selectedIndex][5]);
  176. }
  177. </script>
  178. </head>
  179. <body onLoad="Init();">
  180. <form name="frm0603" method="POST" action="<%=MM_editAction%>">
  181. <table cellpadding="1" cellspacing="1">
  182. <tr>
  183. <td nowrap>Referral Date:</td>
  184. <td nowrap><select name="ReferralDate" acccesskey="F" tabindex="1" onChange="ChangeReferralDate();">
  185. <option value="0">(not linked)
  186. <%
  187. while (!rsReferralDate.EOF){
  188. %>
  189. <option value="<%=rsReferralDate.Fields.Item("intReferral_id").Value%>" <%=((rsReferralDate.Fields.Item("intReferral_id").Value==rsGrantEligibility.Fields.Item("intReferral_id").Value)?"SELECTED":"")%>><%=rsReferralDate.Fields.Item("dtsRefral_date").Value%>
  190. <%
  191. rsReferralDate.MoveNext();
  192. }
  193. %>
  194. </select></td>
  195. </tr>
  196. <tr>
  197. <td nowrap>Referral Type:</td>
  198. <td nowrap><select name="ReferralType" tabindex="2">
  199. <option value="0">Referral
  200. <option value="1">Re-referral
  201. </select></td>
  202. </tr>
  203. <tr>
  204. <td nowrap>Grant Type:</td>
  205. <td nowrap>
  206. <input type="checkbox" name="PostSecondaryCSG" value="1" tabindex="3" class="chkstyle">PS-CSG
  207. <input type="checkbox" name="PostSecondaryAPSD" value="1" tabindex="4" class="chkstyle">PS-APSD
  208. <input type="checkbox" name="EPPDCSG" value="1" tabindex="5" class="chkstyle">EPPD-CSG
  209. </td>
  210. </tr>
  211. </table><br>
  212. <b>Grant Study Periods:</b>
  213. <table cellpadding="1" cellspacing="1" class="MTable">
  214. <tr>
  215. <th class="headrow" nowrap>Link To Referral</th>
  216. <th class="headrow" nowrap>Funding Source</th>
  217. <th class="headrow" nowrap>Start Date</th>
  218. <th class="headrow" nowrap>End Date</th>
  219. <th class="headrow" nowrap>Grant Amount</th>
  220. </tr>
  221. <%
  222. var count = 0;
  223. while (!rsGrantPeriod.EOF) {
  224. %>
  225. <tr>
  226. <td align="center"><input type="checkbox" name="LinkToReferral" value="<%=rsGrantPeriod.Fields.Item("insGrnt_Elgbty").Value%>" class="chkstyle" style="background-color: #ffffe6"></td>
  227. <!-- + Nov.03.2005
  228. -->
  229. <td align="center"><%=(rsGrantPeriod.Fields.Item("chvfunding_source_name").Value)%></td>
  230. <td align="center"><%=FilterDate(rsGrantPeriod.Fields.Item("dtmEligibility_start").Value)%></td>
  231. <td align="center"><%=FilterDate(rsGrantPeriod.Fields.Item("dtmEligibility_end").Value)%></td>
  232. <td align="right"><%=FormatCurrency(rsGrantPeriod.Fields.Item("fltGrantAmt").Value)%></td>
  233. </tr>
  234. <%
  235. count++;
  236. rsGrantPeriod.MoveNext();
  237. }
  238. %>
  239. </table>
  240. <br><br>
  241. <a href="javascript: openWindow('m001e0603a.asp?intAdult_id=<%=Request.QueryString("intAdult_id")%>','W0603E');">Add Financial Eligibility Information</a>
  242. <hr>
  243. <table cellpadding="1" cellspacing="1">
  244. <tr>
  245. <td><input type="button" value="Save" onClick="Save();" <%=((count==0)?"DISABLED":"")%> class="btnstyle"></td>
  246. <td><input type="reset" value="Undo Changes" class="btnstyle"></td>
  247. <td><input type="button" value="Close" onClick="window.location.href='m001q0603.asp?<%=Request.QueryString%>';" class="btnstyle"></td>
  248. </tr>
  249. </table>
  250. <input type="hidden" name="MM_update" value="true">
  251. <input type="hidden" name="GrantPeriod" value="">
  252. </form>
  253. </body>
  254. </html>
  255. <%
  256. rsGrantPeriod.Close();
  257. rsGrantEligibility.Close();
  258. rsReferralDate.Close();
  259. %>