PageRenderTime 82ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/members_only/volunteer/index.asp

https://github.com/evizitei/bcfpd_asp
ASP | 115 lines | 91 code | 24 blank | 0 comment | 3 complexity | 45ddd26f466c03cc969d56b449c1695e MD5 | raw file
  1. <!-- #include virtual="/members_only/include/functions.asa"-->
  2. <%
  3. server.ScriptTimeout = 300
  4. If Not Session("Authorized")(19) Then
  5. Response.Redirect "/members_only/index.asp"
  6. End If
  7. if Request.QueryString("Delete") <> "" then
  8. cnnMain.execute("Delete from VolunteerOpportunities where nID = " & Request.QueryString("Delete"))
  9. end if
  10. if Request.ServerVariables("REQUEST_METHOD") = "POST" then
  11. Dim mySmartUpload
  12. Dim intCount
  13. dim rs
  14. Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
  15. set rs = server.CreateObject("ADODB.Recordset")
  16. mySmartUpload.Upload
  17. rs.Open "VolunteerOpportunities", cnnMain, 3, 3
  18. rs.AddNew
  19. rs("JobTitle") = mySmartUpload.Form("JobTitle")
  20. rs("JobApplicationContentType") = trim(mySmartUpload.files.item(1).ContentType)
  21. mySmartUpload.Files.item(1).FileToField rs("JobApplication")
  22. rs.Update
  23. rs.Close
  24. end if
  25. function GetPageByContent(ContentType)
  26. select case ContentType
  27. case "application/msword"
  28. GetPageByContent = "viewword"
  29. case "application/pdf"
  30. GetPageByContent = "viewpdf"
  31. case "application/vnd.ms-excel"
  32. GetPageByContent = "viewexcel"
  33. case "text/plain"
  34. GetPageByContent = "viewtext"
  35. case else
  36. GetPageByContent = "viewtext"
  37. end select
  38. end function
  39. %>
  40. <!--#include virtual="/members_only/include/templates/top.asa"-->
  41. <!--#include virtual="/members_only/include/templates/members.asa"-->
  42. <table width="98%" border="0" cellspacing="0" cellpadding="5" bordercolor="orange">
  43. <tr>
  44. <td class="PageTitle">Volunteer Opportunities Update</td>
  45. </tr>
  46. <tr>
  47. <td valign="bottom">
  48. <!-- 8. A form is created that contains a table with update fields.-->
  49. <form name="form1" method="post" action="index.asp" ENCTYPE="multipart/form-data">
  50. <!-- 8a. A table is created that contains the requested information.-->
  51. <table border="0" cellpadding="3" cellspacing="3">
  52. <tr>
  53. <td class="ContactInfo">Job Title:</td>
  54. <td colspan="2"><input type="text" id="JobTitle" name="JobTitle"></td>
  55. </tr>
  56. <tr>
  57. <td class="ContactInfo">Job Application:</td>
  58. <td colspan="2"><input type="file" id="JobApplication" name="JobApplication"></td>
  59. </tr>
  60. <tr>
  61. <td align="right" colspan="3">
  62. <a href="javascript:document.form1.submit();"><img SRC="/images/members/buttons/Save.gif" border="0"></a>
  63. <img src="/images/spacer.gif" border="0" height="1" width="35">
  64. <a style="cursor: hand" OnClick="window.history.back();"><img src="/images/members/buttons/cancel.gif" border="0" width="45" height="34"></a>
  65. </td>
  66. </tr>
  67. </table>
  68. </form>
  69. <p>
  70. <%set rs = cnnMain.execute("select * from VolunteerOpportunities order by nID Desc")%>
  71. <table border="1" cellpadding="4" cellspacing="0">
  72. <tr>
  73. <td class="subheadercenter">Delete</td>
  74. <td class="subheadercenter">Job Title</td>
  75. <td class="subheader">Job Application</td>
  76. </tr>
  77. <% Do while not rs.EOF %>
  78. <tr>
  79. <td align="center"><a href="index.asp?Delete=<%=rs("nID")%>">delete</a></td>
  80. <td class="AppLabel" align="center"><%=rs("JobTitle")%></td>
  81. <td class="AppLabel" align="center"><a target="_blank" href="/joinbcfpd/volunteer/<%=GetPageByContent(rs("JobApplicationContentType"))%>.asp?nid=<%=rs("nID")%>&amp;Document=JobApplication">view</a></td>
  82. </tr>
  83. <% rs.MoveNext
  84. Loop
  85. rs.Close
  86. %>
  87. </table>
  88. </td>
  89. </tr>
  90. </table>
  91. <!--#include virtual="/members_only/include/templates/bottom.asa"-->