/beta/purchase/otherRequests.asp

http://github.com/khaneh/Orders · ASP · 169 lines · 136 code · 22 blank · 11 comment · 19 complexity · e55c9778257a3c643539e3f12b701157 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Purchase (4)
  3. PageTitle=" "
  4. SubmenuItem=2
  5. if not Auth(4 , 2) then NotAllowdToViewThisPage()
  6. 'OutService Page Request
  7. 'By Alix - Last changed: 81/01/13
  8. %>
  9. <!--#include file="top.asp" -->
  10. <!--#include File="../include_farsiDateHandling.asp"-->
  11. <!--#include File="../include_JS_InputMasks.asp"-->
  12. <SCRIPT LANGUAGE="JavaScript">
  13. <!--
  14. function hideIT()
  15. {
  16. if(document.all.tavafogh.checked)
  17. {
  18. document.all.priceTavafoghi.style.visibility= 'visible'
  19. }
  20. else
  21. {
  22. document.all.price.value= ''
  23. document.all.priceComment.value= ''
  24. document.all.priceTavafoghi.style.visibility= 'hidden'
  25. }
  26. }
  27. function hideIT2()
  28. {
  29. if(document.all.tavafogh2.checked)
  30. {
  31. document.all.priceTavafoghi2.style.visibility= 'visible'
  32. }
  33. else
  34. {
  35. document.all.orderID.value= ''
  36. document.all.priceTavafoghi2.style.visibility= 'hidden'
  37. }
  38. }
  39. //-->
  40. </SCRIPT>
  41. <%
  42. catItem1 = request("catItem")
  43. if catItem1="" then catItem1="-1"
  44. '-----------------------------------------------------------------------------------------------------
  45. '--------------------------------------------------- Delete an Inventory Request for Buy from an order
  46. '-----------------------------------------------------------------------------------------------------
  47. if request("di")="y" then
  48. myRequestID=request("i")
  49. set RSX=Conn.Execute ("SELECT * FROM purchaseRequests WHERE id = "& myRequestID )
  50. if RSX("status")="new" then
  51. Conn.Execute ("update purchaseRequests SET status = 'del' where id = "& myRequestID )
  52. end if
  53. response.redirect "otherRequests.asp?radif=" & request("r")
  54. end if
  55. '-----------------------------------------------------------------------------------------------------
  56. '------------------------------------------------------------ Submit an Inventory Item request For Buy
  57. '-----------------------------------------------------------------------------------------------------
  58. if request.form("Submit")=" " then
  59. priceComment = request.form("priceComment")
  60. otypeName = request.form("typeName")
  61. comment = request.form("comment")
  62. price = request.form("price")
  63. CreatedBy = session("id")
  64. qtty = request.form("qtty")
  65. DueDate = request.form("DueDate")
  66. orderID = request.form("orderID")
  67. if comment="" then
  68. comment = "-"
  69. end if
  70. if qtty="" then
  71. qtty = "0"
  72. end if
  73. if price="" then
  74. price = "0"
  75. end if
  76. if priceComment="" then
  77. priceComment = "-"
  78. end if
  79. if otypeName="" then
  80. response.write "error"
  81. response.end
  82. end if
  83. if orderID="" then
  84. orderID = "-1"
  85. end if
  86. mySql="INSERT INTO purchaseRequests (orderID, typeName, typeID, comment, price,priceComment, CreatedBy, qtty, DueDate, IsService) VALUES ( "& orderID & " , N'"& otypeName & "', 0 , N'"& comment & "', "& price & ",N'"& priceComment & "', "& CreatedBy & ", "& qtty & " , dbo.udf_date_solarToDate(" & mid(DueDate,1,4) & "," & mid(DueDate,6,2) & "," & mid(DueDate,9,2) & "), 1)"
  87. conn.Execute mySql
  88. 'RS1.close
  89. response.write "<center><br><br> </center><br>"
  90. end if
  91. %>
  92. <center>
  93. <BR><BR>
  94. <TABLE border="0" cellspacing="0" cellpadding="2" dir="RTL" align="center" width="350" >
  95. <TR >
  96. <TD align="right" colspan=2><H3> </H3></TD>
  97. </TR>
  98. <TR bgcolor="dddddd" ><td colspan=2>
  99. <FORM METHOD=POST ACTION="otherRequests.asp">
  100. : <INPUT TYPE="text" name="typeName" size=31><br><br>
  101. : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="text" NAME="qtty" size=40 onKeyPress="return maskNumber(this);" dir="LTR"><br><br>
  102. <INPUT TYPE="checkbox" onclick="hideIT()" name="tavafogh"> <BR>
  103. <div name="priceTavafoghi" id="priceTavafoghi" style="visibility:'hidden'">: &nbsp;<INPUT TYPE="text" NAME="price" ID="price" size=5 onKeyPress="return maskNumber(this);"> : <INPUT TYPE="text" NAME="priceComment" id="priceComment" size=26 ></div>
  104. <INPUT TYPE="checkbox" onclick="hideIT2()" name="tavafogh2"> <BR>
  105. <div name="priceTavafoghi2" id="priceTavafoghi2" style="visibility:'hidden'"> : &nbsp;<INPUT TYPE="text" NAME="orderID" ID="orderID" size=10 onKeyPress="return maskNumber(this);"> </div>
  106. : <INPUT dir=ltr TYPE="text" NAME="DueDate" size=15 value="<%=shamsiToday()%>" onKeyPress="return maskDate(this);" onblur="acceptDate(this)" maxlength="10"><br><br>
  107. : <TEXTAREA NAME="comment" ROWS="7" COLS="32"></TEXTAREA>
  108. <br><center>
  109. <INPUT class=inputBut TYPE="submit" Name="Submit" Value=" " style="width:125px;" tabIndex="14">
  110. </center>
  111. </FORM>
  112. </FONT></TD>
  113. </TR>
  114. <%
  115. 'Gets Request for services list from DB
  116. set RS3=Conn.Execute ("SELECT * FROM purchaseRequests WHERE (status='new' and TypeID=0)")
  117. %>
  118. <%
  119. Do while not RS3.eof
  120. %>
  121. <TR bgcolor="#CCCCCC" title="<%
  122. Comment = RS3("Comment")
  123. if Comment<>"-" then
  124. response.write ": " & Comment
  125. else
  126. response.write " "
  127. end if
  128. %>">
  129. <TD align="right" valign=top><FONT COLOR="black">
  130. <INPUT TYPE="checkbox" NAME="outReq" VALUE="<%=RS3("id")%>" <%
  131. if RS3("status") = "new" then
  132. response.write " checked disabled "
  133. else
  134. response.write " disabled "
  135. end if
  136. %>><B><%=RS3("TypeName")%></B> <small dir=ltr>(<%=RS3("ReqDate")%>)</small></td>
  137. <td align=left width=5%><%
  138. if RS3("status") = "new" then
  139. %><a href="otherRequests.asp?di=y&i=<%=RS3("id")%>&r=<%=request("radif")%>"><b></b></a><%
  140. end if %></td>
  141. </tr>
  142. <%
  143. RS3.moveNext
  144. Loop
  145. %>
  146. </table><br>
  147. <!--#include file="tah.asp" -->