PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/members_only/fema_rotation/index.asp

https://github.com/evizitei/bcfpd_asp
ASP | 281 lines | 261 code | 19 blank | 1 comment | 23 complexity | 098a11139c50b4754c1c2664aca54ffe MD5 | raw file
  1. <!-- #include virtual="/members_only/include/functions.asa"-->
  2. <%
  3. If Not Session("Authorized")(11) Then
  4. Response.Redirect "/members_only/index.asp"
  5. End If
  6. ' Create a recordset object called rsRotation.
  7. set rsRotation = Server.CreateObject("ADODB.Recordset")
  8. set rsRotation2 = Server.CreateObject("ADODB.Recordset")
  9. set rsMonth = Server.CreateObject("ADODB.Recordset")
  10. set rsRegion = Server.CreateObject("ADODB.Recordset")
  11. set rsTeams = Server.CreateObject("ADODB.Recordset")
  12. set rsTeams2 = Server.CreateObject("ADODB.Recordset")
  13. rsRotation2.Open "Select * from Fema_Rotation", cnnBCFPD, 3
  14. ArrRotation = rsRotation2.GetRows rsRotation2.Close
  15. rsTeams2.Open "Select Name from Fema_Teams ORDER BY Name", cnnBCFPD, 3
  16. ArrTeams = rsTeams2.GetRows rsTeams2.Close
  17. Rotation_ID = GetVal("Rotation_ID", "")
  18. If Request.Form("Submit") = "Save" then
  19. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  20. For each item in Request.Form("First_Due")
  21. rsRotation("First_Due") = item
  22. rsRotation.Update
  23. rsRotation.MoveNext
  24. next
  25. rsRotation.close
  26. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  27. For each item in Request.Form("Second_Due")
  28. rsRotation("Second_Due") = item
  29. rsRotation.Update
  30. rsRotation.MoveNext
  31. next
  32. rsRotation.close
  33. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  34. For each item in Request.Form("Third_Due")
  35. rsRotation("Third_Due") = item
  36. rsRotation.Update
  37. rsRotation.MoveNext
  38. next
  39. rsRotation.close
  40. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  41. For each item in Request.Form("Fourth_Due")
  42. rsRotation("Fourth_Due") = item
  43. rsRotation.Update
  44. rsRotation.MoveNext
  45. next
  46. rsRotation.close
  47. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  48. For each item in Request.Form("Fifth_Due")
  49. rsRotation("Fifth_Due") = item
  50. rsRotation.Update
  51. rsRotation.MoveNext
  52. next
  53. rsRotation.close
  54. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  55. For each item in Request.Form("Sixth_Due")
  56. rsRotation("Sixth_Due") = item
  57. rsRotation.Update
  58. rsRotation.MoveNext
  59. next
  60. rsRotation.close
  61. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  62. For each item in Request.Form("Seventh_Due")
  63. rsRotation("Seventh_Due") = item
  64. rsRotation.Update
  65. rsRotation.MoveNext
  66. next
  67. rsRotation.close
  68. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  69. For each item in Request.Form("Eighth_Due")
  70. rsRotation("Eighth_Due") = item
  71. rsRotation.Update
  72. rsRotation.MoveNext
  73. next
  74. rsRotation.close
  75. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3,3
  76. For each item in Request.Form("Ninth_Due")
  77. rsRotation("Ninth_Due") = item
  78. rsRotation.Update
  79. rsRotation.MoveNext
  80. next
  81. rsRotation.close
  82. Response.Redirect "index.asp"
  83. end if
  84. %>
  85. <!--#include virtual="/members_only/include/templates/top.asa"-->
  86. <!--#include virtual="/members_only/include/templates/members.asa"-->
  87. <% if Rotation_ID = "" then %>
  88. <form method="POST" action="index.asp" id=form1 name=form1>
  89. <table border="0" width="98%" cellspacing="0" cellpadding="5">
  90. <tr>
  91. <td class="PageTitle">FEMA Rotation Schedule</td>
  92. </tr>
  93. <tr>
  94. <td width="100%" valign="bottom">
  95. <table border="0" cellpadding="3" cellspacing="0">
  96. <tr>
  97. <td></td>
  98. <td>
  99. <table border="1" cellpadding="5" cellspacing="0" bordercolor="#f2f2f2">
  100. <tr>
  101. <td class="subheadercenter"><nobr>Month</nobr></td>
  102. <td class="subheadercenter"><nobr>Region</nobr></td>
  103. <td class="subheadercenter"><nobr>1st Due</nobr></td>
  104. <td class="subheadercenter"><nobr>2nd Due</nobr></td>
  105. <td class="subheadercenter"><nobr>3rd Due</nobr></td>
  106. <td class="subheadercenter"><nobr>4th Due</nobr></td>
  107. <td class="subheadercenter"><nobr>5th Due</nobr></td>
  108. <td class="subheadercenter"><nobr>6th Due</nobr></td>
  109. <td class="subheadercenter"><nobr>7th Due</nobr></td>
  110. <td class="subheadercenter"><nobr>8th Due</nobr></td>
  111. <td class="subheadercenter"><nobr>9th Due</nobr></td>
  112. <td class="subheadercenter"><nobr>Edit</td>
  113. </tr>
  114. <% rsMonth.Open "SELECT * FROM Month ORDER BY Month_ID", cnnBCFPD,3
  115. do while not rsMonth.EOF %>
  116. <td rowspan="3"><font size="2"><%=rsMonth("Name")%></font></td>
  117. <% rsRegion.Open "SELECT * FROM FEMA_Region ORDER BY Region_ID", cnnBCFPD,3
  118. do while not rsRegion.EOF %>
  119. <td><font size="2"><nobr><%=rsRegion("Name")%></nobr></font></td>
  120. <% rsRotation.Open "SELECT * FROM FEMA_Rotation where Month_ID = " & rsMonth("Month_ID") & " AND Region_ID = " & "'" & rsRegion("Name") & "'" & " ORDER BY Rotation_ID", cnnBCFPD,3
  121. do while not rsRotation.eof %>
  122. <td <%ReturnClass rsRotation("First_Due"), "MO-TF1", "MOTF1", "AppLabel"%> ><nobr><%=rsRotation("First_Due")%></nobr></td>
  123. <td <%ReturnClass rsRotation("Second_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Second_Due")%></nobr></td>
  124. <td <%ReturnClass rsRotation("Third_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Third_Due")%></nobr></td>
  125. <td <%ReturnClass rsRotation("Fourth_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Fourth_Due")%></nobr></td>
  126. <td <%ReturnClass rsRotation("Fifth_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Fifth_Due")%></nobr></td>
  127. <td <%ReturnClass rsRotation("Sixth_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Sixth_Due")%></nobr></td>
  128. <td <%ReturnClass rsRotation("Seventh_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Seventh_Due")%></nobr></td>
  129. <td <%ReturnClass rsRotation("Eighth_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Eighth_Due")%></nobr></td>
  130. <td <%ReturnClass rsRotation("Ninth_Due"), "MO-TF1", "MOTF1", "AppLabel"%>><nobr><%=rsRotation("Ninth_Due")%></nobr></td>
  131. <td><a class="Update" href="index.asp?Rotation_ID=<%=rsRotation("Rotation_ID")%>">edit</a></td>
  132. </tr>
  133. <% rsRotation.MoveNext
  134. loop
  135. rsRotation.close
  136. rsRegion.MoveNext
  137. loop
  138. rsRegion.Close
  139. rsMonth.MoveNext
  140. loop
  141. rsMonth.Close %>
  142. <tr>
  143. <td align="right" colspan="12">
  144. <table>
  145. <tr>
  146. <td>
  147. <a style="cursor: hand" OnClick="window.history.back();"><img src="/images/members/buttons/cancel.gif" border="0" width="45" height="34"></a>
  148. </td>
  149. </tr>
  150. </table>
  151. </td>
  152. </tr>
  153. </table>
  154. </td>
  155. </tr>
  156. </table>
  157. </td>
  158. </tr>
  159. </table>
  160. <% else
  161. rsRotation.Open "SELECT * FROM FEMA_Rotation where Rotation_ID = " & Rotation_ID, cnnBCFPD,3
  162. rsMonth.Open "SELECT * FROM Month WHERE Month_ID = " & rsRotation("Month_ID"), cnnBCFPD,3
  163. %>
  164. <form method="POST" action="index.asp?Rotation_ID=<%=Rotation_ID%>" id=form1 name=form1>
  165. <table border="0" width="98%" cellspacing="0" cellpadding="5">
  166. <tr>
  167. <td class="PageTitle">FEMA Rotation Schedule</td>
  168. </tr>
  169. <tr>
  170. <td width="100%" valign="bottom">
  171. <table border="0" cellpadding="3" cellspacing="0">
  172. <tr>
  173. <td></td>
  174. <td>
  175. <table border="1" cellpadding="5" cellspacing="0" bordercolor="#f2f2f2">
  176. <tr>
  177. <td class="subheadercenter">Month</td>
  178. <td class="subheadercenter">Region</td>
  179. <td class="subheadercenter">1st Due</td>
  180. <td class="subheadercenter">2nd Due</td>
  181. <td class="subheadercenter">3rd Due</td>
  182. <td class="subheadercenter">4th Due</td>
  183. <td class="subheadercenter">5th Due</td>
  184. <td class="subheadercenter">6th Due</td>
  185. <td class="subheadercenter">7th Due</td>
  186. <td class="subheadercenter">8th Due</td>
  187. <td class="subheadercenter">9th Due</td>
  188. </tr>
  189. <td rowspan="3"><font size="2"><%=rsMonth("Name")%></font></td>
  190. <td><font size="2"><nobr><%=rsRotation("Region_ID")%></nobr></font></td>
  191. <% do while not rsRotation.eof %>
  192. <td><SELECT id=select1 name="First_Due"> <% for each item in ArrTeams %>
  193. <OPTION <%ReturnClass rsRotation("First_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("First_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  194. <% next %>
  195. </SELECT>
  196. </td>
  197. <td><SELECT id=select1 name="Second_Due"> <% for each item in ArrTeams %>
  198. <OPTION <%ReturnClass rsRotation("Second_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Second_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  199. <% next %>
  200. </SELECT>
  201. </td>
  202. <td><SELECT id=select1 name="Third_Due"> <% for each item in ArrTeams %>
  203. <OPTION <%ReturnClass rsRotation("Third_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Third_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  204. <% next %>
  205. </SELECT>
  206. </td>
  207. <td><SELECT id=select1 name="Fourth_Due"> <% for each item in ArrTeams %>
  208. <OPTION <%ReturnClass rsRotation("Fourth_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Fourth_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  209. <% next %>
  210. </SELECT>
  211. </td>
  212. <td><SELECT id=select1 name="Fifth_Due"> <% for each item in ArrTeams %>
  213. <OPTION <%ReturnClass rsRotation("Fifth_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Fifth_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  214. <% next %>
  215. </SELECT>
  216. </td>
  217. <td><SELECT id=select1 name="Sixth_Due"> <% for each item in ArrTeams %>
  218. <OPTION <%ReturnClass rsRotation("Sixth_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Sixth_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  219. <% next %>
  220. </SELECT>
  221. </td>
  222. <td><SELECT id=select1 name="Seventh_Due"> <% for each item in ArrTeams %>
  223. <OPTION <%ReturnClass rsRotation("Seventh_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Seventh_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  224. <% next %>
  225. </SELECT>
  226. </td>
  227. <td><SELECT id=select1 name="Eighth_Due"> <% for each item in ArrTeams %>
  228. <OPTION <%ReturnClass rsRotation("Eighth_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Eighth_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  229. <% next %>
  230. </SELECT>
  231. </td>
  232. <td><SELECT id=select1 name="Ninth_Due"> <% for each item in ArrTeams %>
  233. <OPTION <%ReturnClass rsRotation("Ninth_Due"), "MO-TF1", "MOTF1", "AppLabel"%> <% if rsRotation("Ninth_Due") = item then%> selected<%end if%>><%=item%></OPTION>
  234. <% next %>
  235. </SELECT>
  236. </td>
  237. </tr>
  238. <% rsRotation.MoveNext
  239. loop
  240. rsRotation.close%>
  241. <tr>
  242. <td align="right" colspan="12">
  243. <table cellpadding="0" cellspacing="0" border="0">
  244. <tr>
  245. <td><a href="javascript:submit(document.form1, 'Save');"><img SRC="/images/members/buttons/Save.gif" border="0"></a></td>
  246. <td><img src="/images/spacer.gif" border="0" height="1" width="35"></td>
  247. <td><a style="cursor: hand" OnClick="window.history.back();"><img src="/images/members/buttons/cancel.gif" border="0" width="45" height="34"></a></td>
  248. <td><input type="Hidden" name="Submit"></td>
  249. </tr>
  250. </table>
  251. </td>
  252. </tr>
  253. </table>
  254. </td>
  255. </tr>
  256. </table>
  257. </td>
  258. </tr>
  259. </table>
  260. <% end if%>
  261. </form>
  262. <!--#include virtual="/members_only/include/templates/bottom.asa"-->