/beta/home/furlough.asp

http://github.com/khaneh/Orders · ASP · 127 lines · 104 code · 13 blank · 10 comment · 4 complexity · adc895116aabdffccfb1fbae9a4d54f1 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Home (0)
  3. PageTitle= " "
  4. SubmenuItem=4
  5. if not Auth(0 , 4) then NotAllowdToViewThisPage()
  6. sendTo = session("id")
  7. %>
  8. <!--#include file="top.asp" -->
  9. <!--#include File="../include_farsiDateHandling.asp"-->
  10. <!--#include File="../include_JS_InputMasks.asp"-->
  11. <%
  12. function sqlSafe (s)
  13. st=s
  14. st=replace(St,"'","`")
  15. st=replace(St,chr(34),"`")
  16. sqlsafe=st
  17. end function
  18. '-----------------------------------------------------------------------------------------------------
  19. '------------------------------------------------------------------------------------ Send New Message
  20. '-----------------------------------------------------------------------------------------------------
  21. if request.form("Submit")=" " then
  22. ' MsgTo = "4" '=====> 4 = Mr. Kavakeb
  23. ' Changed by kid 840727
  24. MsgTo = "6" '=====> 1 = Mr. Vazehi
  25. msgTitle = "request for furlough"
  26. msgDate = sqlSafe(request.form("msgDate"))
  27. msgBody = sqlSafe(left(request.form("msgBody"),1999))
  28. fromTime = sqlSafe(request.form("fromTime"))
  29. toTime = sqlSafe(request.form("toTime"))
  30. RelatedTable = "NaN"
  31. relatedID = "0"
  32. replyTo = "0"
  33. IsReply = "0"
  34. MsgFrom = session("ID")
  35. MsgTime = currentTime10()
  36. MsgDate = shamsiToday()
  37. 'msgBody2 = " <span dir=ltr>" & msgDate & "</span> " & fromTime & " " & toTime & "<hr noshade style=''height:1''>" & msgBody
  38. msgBody2 = " " & msgDate & " " & fromTime & " " & toTime & "----------- : " & msgBody
  39. MySQL = "INSERT INTO Messages (MsgFrom, MsgTo, MsgTime, MsgDate, IsRead, MsgTitle, MsgBody, replyTo, IsReply, relatedID, RelatedTable) VALUES ( "& MsgFrom & ", "& MsgTo & ", N'"& MsgTime & "', N'"& MsgDate & "', 0, N'"& MsgTitle & "', N'"& MsgBody2 & "', "& replyTo & ", "& IsReply & ", "& relatedID & ", '"& RelatedTable & "')"
  40. conn.Execute MySQL
  41. response.write "<center><br><br> </center>"
  42. end if
  43. '-----------------------------------------------------------------------------------------------------
  44. '------------------------------------------------------------------------------------ New Message Form
  45. '-----------------------------------------------------------------------------------------------------
  46. %>
  47. <SCRIPT LANGUAGE="JavaScript">
  48. <!--
  49. function hideIT()
  50. {
  51. //alert(document.all.RelatedTable.value)
  52. if(document.all.RelatedTable.value!="no")
  53. {
  54. document.all.relatedIDSpan.style.visibility= 'visible'
  55. document.all.relatedID.value = "0"
  56. document.all.relatedID.focus()
  57. }
  58. else
  59. {
  60. document.all.relatedIDSpan.style.visibility= 'hidden'
  61. document.all.relatedID.value = "0"
  62. }
  63. }
  64. //-->
  65. </SCRIPT>
  66. <center><BR><BR><BR>
  67. <FORM METHOD=POST ACTION="furlough.asp">
  68. <INPUT TYPE="hidden" name="replyTo" value="0">
  69. <INPUT TYPE="hidden" name="IsReply" value="0">
  70. <TABLE>
  71. <TR>
  72. <TD colspan=2 align=center><H3> </H3></TD>
  73. </TR>
  74. <!--TR>
  75. <TD align=left>: </TD>
  76. <TD align=right>
  77. <select name="kind" class=inputBut >
  78. <option value="0"> </option>
  79. <option value="1"> </option>
  80. </select> <BR>
  81. </TD>
  82. </TR-->
  83. <TR>
  84. <TD align=left></TD>
  85. <TD align=right>
  86. <INPUT TYPE="text" NAME="msgDate" value="<%=shamsiDate(date()+1)%>" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" dir=ltr class=inputBut size=31>
  87. </TD>
  88. </TR>
  89. <TR>
  90. <TD align=left> </TD>
  91. <TD align=right>
  92. <INPUT TYPE="text" NAME="fromTime" class=inputBut size=8 onKeyPress="return maskTime(this);" dir=ltr>&nbsp;
  93. :
  94. <INPUT TYPE="text" NAME="toTime" class=inputBut size=9 onKeyPress="return maskTime(this);" dir=ltr>
  95. </TD>
  96. </TR>
  97. <TR>
  98. <TD align=left></TD>
  99. <TD align=right>
  100. <TEXTAREA NAME="msgBody" ROWS="4" class=inputBut COLS="32"></TEXTAREA>
  101. </TD>
  102. </TR>
  103. <TR>
  104. <TD align=left></TD>
  105. <TD align=center><br><INPUT TYPE="submit" name="submit" value=" "></TD>
  106. </TR>
  107. <TR>
  108. <TD align=left></TD>
  109. <TD align=right>
  110. </TD>
  111. </TR>
  112. </TABLE>
  113. </FORM>
  114. <!--#include file="tah.asp" -->