home *** CD-ROM | disk | FTP | other *** search
/ bombers.k12.ar.us / bombers.k12.ar.us.tar / bombers.k12.ar.us / subs / request.asp < prev    next >
Text File  |  2004-02-04  |  5KB  |  126 lines

  1. <%@ Language=VBScript %>
  2. <html>
  3.  
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  6. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  7. <meta name="ProgId" content="FrontPage.Editor.Document">
  8. <title>Substitute request processor</title>
  9. </head>
  10. <body>
  11. <p>
  12. The following information has been entered into the system:
  13. <p>
  14. <%
  15. Response.Write("<b>" & "Name: " & "</b>" & Request.Form("txtName") & "<br>")
  16. Response.Write("<b>" & "School: " & "</b>" & Request.Form("txtSchool") & "<br>")
  17. Response.Write("<b>" & "Reason for absence: " & "</b>" & Request.Form("txtReason") & "<br>")
  18. Response.Write("<b>" & "Length of absence: " & "</b>" & Request.Form("txtLength") & "<br>")
  19. Response.Write("<b>" & "Date of absence: " & "</b>" & Request.Form("txtMonth") & " " & Request.Form("txtDay") & ", " & Request.Form("txtYear")& " ")
  20. Response.Write("     through " & Request.Form("txtMonth2") & " " & Request.Form("txtDay2") & ", " & Request.Form("txtYear2") & "<br>")
  21. Response.Write("<b>" & "Requested substitute 1: " & "</b>" & Request.Form("txtSub1") & "<br>")
  22. Response.Write("<b>" & "Requested substitute 2: " & "</b>" & Request.Form("txtSub2") & "<br>")
  23. Response.Write("<b>" & "Requested substitute 3: " & "</b>" & Request.Form("txtSub3") & "<br>")
  24. Response.Write("<b>" & "Notes/arrival time/extra duties: " & "</b>" & Request.Form("txtNotes") & "<br>")
  25. %>
  26. <br>
  27. An email has been seen to Sub Central containing your request. <br>
  28. Thank you.
  29. </body>
  30. </html>
  31. <%
  32. Dim myCDONTSMail
  33. Dim strFrom
  34. Dim strTo
  35. Dim strName
  36. Dim strSchool
  37. 'Dim strDate
  38. Dim strMonth
  39. Dim strDay
  40. Dim strYear
  41. Dim strMonth2
  42. Dim strDay2
  43. Dim Year2
  44. Dim strReason
  45. Dim strSub1
  46. Dim strSub2
  47. Dim strSub3
  48. Dim strSubject
  49. Dim strBody
  50. Dim strLength
  51. Dim strNotes
  52. '52
  53. strFrom="autoreply@mtnhome.k12.ar.us"
  54. strTo="mblum@mtnhome.k12.ar.us"
  55. strName=Request.Form("txtName")
  56. strSchool=Request.Form("txtSchool")
  57. strReason=Request.Form("txtReason")
  58. strLength=Request.Form("txtLength")
  59. strMonth=Request.Form("txtMonth")
  60. strDay=Request.Form("txtDay")
  61. strYear=Request.Form("txtYear")
  62. strMonth2=Request.Form("txtMonth2")
  63. strDay2=Request.Form("txtDay2")
  64. strYear2=Request.Form("txtYear2")
  65. strSub1=Request.Form("txtSub1")
  66. strSub2=Request.Form("txtSub2")
  67. strSub3=Request.Form("txtSub3")
  68. strNotes=Request.Form("txtNotes")
  69. strSubject = "Request for substitute"
  70. strBody="The following substitute request has been submitted:" & chr(13)
  71. strBody=strbody & "Name: " & strName & Chr(13)
  72. strBody = strBody & "School/Department: " & strSchool & chr(13) 
  73. strBody = strBody & "Reason for absence: " & strReason & chr(13)
  74. strBody = strBody & "Length of absence: " & strLength & chr(13)
  75. strBody = strBody& "Date: " & strMonth & " " & strDay & ", " & strYear & chr(13)
  76. strBody = strBody & "     Through: " & strMonth2 & " " & strDay2 & ", " & strYear2 & chr(13)
  77. strBody = strBody & "First Requested Substitute: " & strSub1 & chr(13)
  78. strBody = strBody & "Second Requested Substitute: " & strSub2 & chr(13)
  79. strBody = strBody & "Third Requested Substitute: " & strSub3 & chr(13)
  80. strBody = strBody & "Other Notes: " & strNotes & chr(13)
  81. '81
  82. 'Create a new mail message object
  83. Set myCDONTSMail = CreateObject("CDONTS.NewMail")
  84.  
  85. 'Send the new mail message object by passing the parameter 
  86. 'defined above
  87. myCDONTSMail.Send strFrom,strTo,StrSubject,strBody
  88.  
  89. 'Set the new mail message object to Nothing to free resources
  90. Set myCDONTSMail = Nothing
  91. '91
  92. 'Now for the database part of our show
  93. 'Variable declaration
  94. '    myConnString = Connection string to database
  95. '    myConnection = The database connection object
  96. '     mySQL = the query string to be used
  97. Dim myConnString
  98. Dim myConnection
  99. Dim mySQL
  100. '100
  101. myConnString = Application("Request_ConnectionString")
  102. Set myConnection = Server.CreateObject("ADODB.Connection")
  103. myConnection.Open myConnString
  104. 'Write information to database
  105. mySQL= "INSERT INTO results "
  106. mySQL= mySQL & "(NAME,SCHOOL,REASON,LENGTH,MONTH,DAY,YEAR,MONTH2,DAY2,YEAR2,SUB1,SUB2,SUB3,NOTES) "
  107. mySQL= mySQL & "VALUES ('" & Request.Form("txtName") & "','"
  108. mySQL= mySQL & Request.Form("txtSchool") & "','"
  109. mySQL= mySQL & Request.Form("txtReason") & "','"
  110. mySQL= mySQL & Request.Form("txtLength") & "','"
  111. mySQL= mySQL & Request.Form("txtMonth") & "','"
  112. mySQL= mySQL & Request.Form("txtDay") & "','"
  113. mySQL= mySQL & Request.Form("txtYear") & "','"
  114. mySQL= mySQL & Request.Form("txtMonth2") & "','"
  115. mySQL= mySQL & Request.Form("txtDay2") & "','"
  116. mySQL= mySQL & Request.Form("txtYear2") & "','"
  117. mySQL= mySQL & Request.Form("txtSub1") & "','"
  118. mySQL= mySQL & Request.Form("txtSub2") & "','"
  119. mySQL= mySQL & Request.Form("txtSub3") & "','"
  120. mySQL= mySQL & Request.Form("txtNotes") & "')"
  121. '101
  122. myConnection.Execute mySQL
  123. myConnection.Close
  124. Set myConnection = Nothing
  125. %>
  126.