/beta/purchase/outServiceOrder.asp

http://github.com/khaneh/Orders · ASP · 643 lines · 580 code · 43 blank · 20 comment · 73 complexity · 989e99643d5887d8be134f7aee018ce7 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Purchase (4)
  3. PageTitle=" "
  4. SubmenuItem=3
  5. if not Auth(4 , 3) then NotAllowdToViewThisPage()
  6. 'OutService Page Order
  7. 'By Alix - Last changed: 81/01/13
  8. %>
  9. <!--#include file="top.asp" -->
  10. <!--#include File="../include_farsiDateHandling.asp"-->
  11. <style>
  12. .outServTable1 {font-family: Tahoma;font-size: 8pt; border:1 solid navy;}
  13. .outServTable1 th {height:25px;border-bottom:1 solid navy;Background-Color:ddddee}
  14. .outServTable1 td {height:25px;}
  15. .outServTR1 {Background-Color:#CCCCDD;}
  16. </style>
  17. <%
  18. '-----------------------------------------------------------------------------------------------------
  19. '---------------------------------------------------------------------- OutService Order Creation Form
  20. '-----------------------------------------------------------------------------------------------------
  21. if request.form("Submit")=" " then
  22. if request.form("outReq").count < 1 then%>
  23. <div align=center dir=rtl><br><br><br><br><br><br><b>!!<br><h3> </h3></b><br></div>
  24. </body>
  25. </html>
  26. <%
  27. else
  28. %><br>
  29. <!--#include File="../include_JS_InputMasks.asp"-->
  30. <form method=post action="outServiceOrder.asp">
  31. <TABLE dir=rtl align=center width=600>
  32. <TR bgcolor="eeeeee" >
  33. <TD align=center colspan=7><B> </B></TD>
  34. </TR>
  35. <TR bgcolor="eeeeee" >
  36. <TD> </TD>
  37. <TD> </TD>
  38. <TD> </TD>
  39. <TD> </TD>
  40. <TD> </TD>
  41. <TD></TD>
  42. <TD width=8%></TD>
  43. </TR>
  44. <%
  45. tmpCounter=0
  46. pp=100
  47. totalPrice=0
  48. allComments = ""
  49. TypeID_IsService = ""
  50. for i=1 to request.form("outReq").count
  51. myRequestID = clng(request.form("outReq")(i))
  52. percent = cint(pp / (request.form("outReq").count - tmpCounter))
  53. pp = pp - percent
  54. tmpCounter = tmpCounter + 1
  55. if tmpCounter mod 2 = 1 then
  56. tmpColor="#FFFFFF"
  57. tmpColor2="#FFFFBB"
  58. Else
  59. tmpColor="#DDDDDD"
  60. tmpColor2="#EEEEBB"
  61. End if
  62. set RSX=Conn.Execute ("SELECT * FROM purchaseRequests WHERE id = "& myRequestID )
  63. if TypeID_IsService="" then
  64. TypeID_IsService = RSX("TypeID") & "_" & RSX("IsService")
  65. end if
  66. if TypeID_IsService <> RSX("TypeID") & "_" & RSX("IsService") then
  67. conn.close
  68. response.redirect "?errMsg=" & Server.URLEncode("!<br> .")
  69. end if
  70. totalPrice = totalPrice + RSX("price")
  71. totalQtty = totalQtty + RSX("qtty")
  72. Comment = RSX("Comment")
  73. if Comment<>"-" then
  74. Comment = ": " & Comment
  75. allComments = allComments & Comment & chr(13) & chr(13)
  76. else
  77. Comment = " "
  78. end if
  79. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& RSX("CreatedBy") & ")" )
  80. %>
  81. <TR bgcolor="<%=tmpColor%>" title="<%=Comment%>">
  82. <TD><%=RSX("typeName")%></TD>
  83. <TD><span dir=ltr><%=shamsidate(RSX("ReqDate"))%></span></TD>
  84. <TD><span dir=ltr><%=shamsidate(RSX("DueDate"))%></span></TD>
  85. <TD><%=RSX("price")%>
  86. <%
  87. if RSX("price") <> 0 then
  88. response.write "<br><small>" & RSX("priceComment") & "</small>"
  89. end if
  90. %>
  91. </TD>
  92. <TD>
  93. <% if clng(RSX("IsService"))=0 or clng(RSX("Qtty"))<>0 then %>
  94. (: <%=RSX("qtty")%>)
  95. <% end if %>
  96. <% if clng(RSX("orderID"))<>-1 then %>
  97. <%=RSX("orderID")%>
  98. <% end if %>
  99. </TD>
  100. <TD><%=RST("RealName")%></TD>
  101. <TD width=8%><input type="hidden" name="reqID" value="<%=RSX("id")%>">
  102. <input type="text" size=2 name="percent" value="<%=percent%>">%
  103. </TD>
  104. </TR>
  105. <%
  106. RSX_typeID = clng(RSX("typeID"))
  107. RSX_typeName = RSX("typeName")
  108. DueDate = RSX("DueDate")
  109. IsService = RSX("IsService")
  110. RSX.moveNext
  111. if DueDate="" then DueDate =shamsiToday()
  112. next
  113. %>
  114. <TR bgcolor="eeeeee" >
  115. <TD align=center colspan=7 height=10></TD>
  116. </TR>
  117. <TR >
  118. <input type="hidden" Name='tmpDlgArg' value=''>
  119. <input type="hidden" Name='tmpDlgTxt' value=''>
  120. <SCRIPT LANGUAGE="JavaScript">
  121. <!--
  122. function selectVendor(){
  123. document.all.tmpDlgArg.value="#"
  124. document.all.tmpDlgTxt.value=" :"
  125. window.showModalDialog('../dialog_GenInput.asp',document.all.tmpDlgTxt,'dialogHeight:200px; dialogWidth:440px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  126. if (document.all.tmpDlgTxt.value !="") {
  127. window.showModalDialog('../AP/dialog_SelectAccount.asp?act=select&search='+escape(document.all.tmpDlgTxt.value), document.all.tmpDlgArg, 'dialogWidth:780px; dialogHeight:500px; dialogTop:; dialogLeft:; edge:Raised; center:Yes; help:No; resizable:Yes; status:No;');
  128. if (document.all.tmpDlgArg.value!="#"){
  129. Arguments=document.all.tmpDlgArg.value.split("#")
  130. theSpan=document.getElementById("AccountSpan");
  131. theSpan.getElementsByTagName("input")[0].value=Arguments[0];
  132. theSpan.getElementsByTagName("span")[0].innerText=Arguments[1]+"["+Arguments[0]+"]";
  133. }
  134. }
  135. }
  136. //-->
  137. </SCRIPT>
  138. <TD colspan=1 align=left></TD>
  139. <TD colspan=6 align=right>
  140. <INPUT TYPE="hidden" name="IsService" value=<%=IsService%>>
  141. <span id="AccountSpan"><%' after any changes in this span "../AR/Customers.asp" must be revised%>
  142. <INPUT TYPE="hidden" NAME="vendor" value=""><b><span>................................</span></b>
  143. </span>
  144. <INPUT class="GenButton" TYPE="button" value="" onClick="selectVendor();">
  145. </TD>
  146. </TR>
  147. <TR >
  148. <%
  149. if (IsService) then
  150. if RSX_typeID <> 0 then
  151. %>
  152. <TD colspan=1 align=left> </TD>
  153. <TD colspan=6 align=right>
  154. <SELECT NAME="type" class=inputBut size="1" >
  155. <%
  156. set RS4 = conn.Execute ("SELECT * FROM OutServices")
  157. while not (RS4.eof) %>
  158. <OPTION value="<%=RS4("ID")%>" <%
  159. if RS4("ID")=RSX_typeID then
  160. response.write " selected "
  161. end if
  162. %>><%=RS4("Name")%></option>
  163. <%
  164. RS4.MoveNext
  165. wend
  166. RS4.close
  167. %>
  168. </SELECT>
  169. </TD>
  170. <% else %>
  171. <TD colspan=1 align=left> </TD>
  172. <TD colspan=6 align=right>
  173. <INPUT TYPE="hidden" name=type value=0>
  174. <INPUT TYPE="text" class=inputBut NAME="typeName" size=51 value="<%=RSX_typeName%>">
  175. </td>
  176. <% end if %>
  177. <% else %>
  178. <TD colspan=1 align=left> </TD>
  179. <TD colspan=6 align=right>
  180. <SELECT NAME="type" class=inputBut size="1" >
  181. <%
  182. set RS4 = conn.Execute ("SELECT * FROM InventoryItems")
  183. while not (RS4.eof) %>
  184. <OPTION value="<%=RS4("ID")%>" <%
  185. if RS4("ID")=RSX_typeID then
  186. response.write " selected "
  187. end if
  188. %>><%=RS4("Name")%> (<%=RS4("Unit")%>)</option>
  189. <%
  190. RS4.MoveNext
  191. wend
  192. RS4.close
  193. %>
  194. </SELECT>
  195. </TD>
  196. <% end if %>
  197. </TR>
  198. <TR >
  199. <TD colspan=1 align=left></TD>
  200. <TD colspan=6 align=right>
  201. <INPUT TYPE="text" NAME="qtty" class=inputBut size=51 value="<%=totalQtty%>" onKeyPress="return maskNumber(this);">
  202. </TD>
  203. </TR>
  204. <TR >
  205. <TD colspan=1 align=left> </TD>
  206. <TD colspan=6 align=right>
  207. <INPUT TYPE="text" NAME="price" class=inputBut size=51 value="<%=totalPrice%>" onKeyPress="return maskNumber(this);">
  208. </TD>
  209. </TR>
  210. <TR >
  211. <TD colspan=1 align=left> </TD>
  212. <TD colspan=6 align=right>
  213. <INPUT dir=ltr TYPE="text" NAME="date1" class=inputBut size=51 value="<%=shamsiToday()%>" onKeyPress="return maskDate(this);" onblur="acceptDate(this)">
  214. </TD>
  215. </TR>
  216. <TR >
  217. <TD colspan=1 align=left> </TD>
  218. <TD colspan=6 align=right>
  219. <INPUT dir=ltr TYPE="text" NAME="date2" class=inputBut size=51 value="<%=shamsiDate(DueDate)%>" onKeyPress="return maskDate(this);" onblur="acceptDate(this)">
  220. </TD>
  221. </TR>
  222. <TR >
  223. <TD colspan=1 align=left></TD>
  224. <TD colspan=6 align=right>
  225. <TEXTAREA NAME="comment" class=inputBut ROWS="7" COLS="32" ><%=allComments%></TEXTAREA>
  226. </TD>
  227. </TR>
  228. <TR >
  229. <TD colspan=7 align=center>
  230. <INPUT TYPE="submit" class=inputBut Name="Submit" Value=" " style="width:100px;" tabIndex="14">
  231. </TD>
  232. </TR>
  233. </FORM>
  234. </body>
  235. </html>
  236. <%
  237. end if
  238. response.end
  239. end if
  240. '-----------------------------------------------------------------------------------------------------
  241. '-------------------------------------------------------------------------- Submit an OutService Order
  242. '-----------------------------------------------------------------------------------------------------
  243. if request.form("Submit")=" " then
  244. vendorID = request.form("vendor")
  245. otypeID = clng(request.form("type"))
  246. otype = request.form("TypeName")
  247. TotalPrice = request.form("price")
  248. comment = request.form("comment")
  249. ordDate = shamsiToday()
  250. date1 = request.form("date1")
  251. date2 = request.form("date2")
  252. IsService = request.form("IsService")
  253. qtty = request.form("qtty")
  254. a = qtty
  255. if isNumeric(a) and a<>"" then
  256. qttyLetter = ConvertIT(a)
  257. else
  258. response.write "<br>"
  259. call showAlert ("! .", CONST_MSG_ERROR)
  260. response.end
  261. end if
  262. if TotalPrice="" then TotalPrice=0
  263. if comment = "" then
  264. comment = "-"
  265. end if
  266. if vendorID="" then
  267. response.write "<br>"
  268. call showAlert ("! .", CONST_MSG_ERROR)
  269. response.end
  270. end if
  271. TypeID_IsService = otypeID
  272. if IsService then
  273. TypeID_IsService = TypeID_IsService & "_True"
  274. IsServiceFlag = 1
  275. if otypeID <> 0 then
  276. set RS4 = conn.Execute ("SELECT * FROM OutServices where ID=" & otypeID)
  277. if (RS4.eof) then
  278. otype="-unknown-"
  279. else
  280. otype=RS4("Name")
  281. end if
  282. RS4.close
  283. end if
  284. else
  285. TypeID_IsService = TypeID_IsService & "_False"
  286. IsServiceFlag = 0
  287. set RS4 = conn.Execute ("SELECT * FROM InventoryItems where ID=" & otypeID)
  288. if (RS4.eof) then
  289. otype="-unknown-"
  290. else
  291. otype=RS4("Name")
  292. end if
  293. RS4.close
  294. end if
  295. for i=1 to request.form("ReqID").count
  296. RequestID= clng(request.form("ReqID")(i))
  297. set RSX=Conn.Execute ("SELECT * FROM purchaseRequests WHERE id = "& RequestID)
  298. if TypeID_IsService <> RSX("TypeID") & "_" & RSX("IsService") then
  299. conn.close
  300. response.write "<BR><BR>"
  301. call showAlert ("!<br> .", CONST_MSG_ERROR)
  302. response.end
  303. end if
  304. RSX.close
  305. next
  306. mySql="INSERT INTO purchaseOrders (Vendor_ID, typeName, typeID, comment, OrdDate, price, IsService, qtty, qttyLetter) VALUES ("& clng(VendorID) & ", N'"& sqlSafe(otype) & "', "& otypeID & ", N'"& sqlSafe(comment) & "',N'"& sqlSafe(ordDate) & "', "& sqlSafe(TotalPrice) & " , "& IsServiceFlag & ", "& sqlSafe(qtty) & ", N'" & sqlSafe(qttyLetter) & "');SELECT @@Identity AS NewPO"
  307. set RS4 = Conn.execute(mySQL).NextRecordSet
  308. OrdID = RS4 ("NewPO")
  309. RS4.close
  310. for i=1 to request.form("ReqID").count
  311. RequestID=request.form("ReqID")(i)
  312. Percent=request.form("Percent")(i)
  313. conn.Execute ("INSERT INTO purchaseRequestOrderRelations (Req_ID, Ord_ID, PercentOfAll) VALUES ("& RequestID & ", "& ordID & ", "& Percent & " )")
  314. Conn.Execute ("UPDATE purchaseRequests SET status = 'ord' WHERE ID = "& RequestID )
  315. response.write RequestID & "- per: "
  316. response.write Percent & " % <br>"
  317. next
  318. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusTime, statusDate, statusCode, StatusDetail, user_id) VALUES ("& OrdID & ", '"& currentTime10() & "', N'"& ordDate & "', "& 0 & ", N' ' ," & session("ID") & ")")
  319. ' conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusTime, statusDate, statusCode, StatusDetail) VALUES ("& OrdID & ", N'"& Date1 & "', "& 1 & ", N' ' )")
  320. ' conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusTime, statusDate, statusCode, StatusDetail) VALUES ("& OrdID & ", N'"& Date2 & "', "& 2 & ", N' ' )")
  321. '
  322. ' Changed By Kid 821224 Because There was An Error : Number of VALUES does not match the number of Fields.
  323. '
  324. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusDate, statusCode, StatusDetail,user_id) VALUES ("& OrdID & ", N'"& Date1 & "', "& 1 & ", N' ' ," & session("id") & ")")
  325. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusDate, statusCode, StatusDetail,user_id) VALUES ("& OrdID & ", N'"& Date2 & "', "& 2 & ", N' ' ," & session("id") & ")")
  326. response.redirect "outServiceTrace.asp?od=" & ordID
  327. end if
  328. '-----------------------------------------------------------------------------------------------------
  329. '---------------------------------------------------------------------- Submit an Inventory Item Order
  330. '-----------------------------------------------------------------------------------------------------
  331. if request.form("Submit")=" " then
  332. vendorID = request.form("vendor")
  333. otypeID = clng(request.form("type"))
  334. qtty = request.form("qtty")
  335. comment = request.form("comment")
  336. ordDate = shamsiToday()
  337. date1 = request.form("date1")
  338. date2 = request.form("date2")
  339. if qtty="" then qtty=0
  340. set RS4 = conn.Execute ("SELECT * FROM InventoryItems where ID=" & otypeID)
  341. if (RS4.eof) then
  342. otype="-unknown-"
  343. else
  344. otype=RS4("Name")
  345. end if
  346. RS4.close
  347. mySql="INSERT INTO purchaseOrders (Vendor_ID, typeName, typeID, comment, OrdDate, price) VALUES ("& VendorID & ", N'"& otype & "', "& otypeID & ", N'"& comment & "',N'"& ordDate & "', "& TotalPrice & " )"
  348. conn.Execute mySql
  349. set RS4 = conn.Execute ("SELECT max(id) as nid FROM purchaseOrders where Vendor_ID=" & VendorID & " and ordDate='" & ordDate & "' and typeID=" & otypeID )
  350. if (RS4.eof) then
  351. response.write "BAD ERROR!@<br> Contact system admin"
  352. response.end
  353. else
  354. OrdID=RS4("nid")
  355. end if
  356. RS4.close
  357. for i=1 to request.form("ReqID").count
  358. RequestID=request.form("ReqID")(i)
  359. Percent=request.form("Percent")(i)
  360. conn.Execute ("INSERT INTO purchaseRequestOrderRelations (Req_ID, Ord_ID, PercentOfAll) VALUES ("& RequestID & ", "& ordID & ", "& Percent & " )")
  361. Conn.Execute ("update purchaseRequests SET status = 'ord' where id = "& RequestID )
  362. response.write RequestID & "- per: "
  363. response.write Percent & " % <br>"
  364. next
  365. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusDate, statusCode, StatusDetail,user_id,statusTime) VALUES ("& OrdID & ", '"& ordDate & "', "& 0 & ", N' ' ," & session("id") & ", '"& currentTime10() & "')")
  366. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusDate, statusCode, StatusDetail,user_id) VALUES ("& OrdID & ", '"& Date1 & "', "& 1 & ", N' ' ," & session("id") & ")")
  367. conn.Execute ("INSERT INTO purchaseOrderStatus (Ord_ID, statusDate, statusCode, StatusDetail,user_id) VALUES ("& OrdID & ", '"& Date2 & "', "& 2 & ", N' ' ," & session("id") & ")")
  368. response.redirect "outServiceTrace.asp?od=" & ordID
  369. end if
  370. '-----------------------------------------------------------------------------------------------------
  371. '------------------------------------------------------------------------------------------------ Main
  372. '-----------------------------------------------------------------------------------------------------
  373. sortBy=request("s")
  374. if sortBy="4" then
  375. sB="order_ID"
  376. elseif sortBy="2" then
  377. sB="ReqDate"
  378. elseif sortBy="3" then
  379. sB="price"
  380. else
  381. sB="typeName"
  382. end if
  383. %>
  384. <br>
  385. <SCRIPT LANGUAGE="JavaScript">
  386. <!--
  387. function checkValidation(){
  388. result = true;
  389. try{
  390. var slctn = document.getElementsByName("outReq");
  391. var TypeID_IsService = "";
  392. for(i=0;i<slctn.length;i++){
  393. if(slctn[i].checked){
  394. if (TypeID_IsService == ""){
  395. TypeID_IsService = slctn[i].parentNode.getElementsByTagName("INPUT")[0].value;
  396. }
  397. if (TypeID_IsService != slctn[i].parentNode.getElementsByTagName("INPUT")[0].value){
  398. tmpBG=slctn[i].parentNode.parentNode.bgColor;
  399. slctn[i].parentNode.parentNode.bgColor="red";
  400. slctn[i].focus();
  401. alert('!\n .');
  402. slctn[i].parentNode.parentNode.bgColor=tmpBG;
  403. result = false;
  404. break;
  405. }
  406. }
  407. }
  408. }
  409. catch(e){
  410. alert("Error: \n"+e.message)
  411. result = false;
  412. }
  413. return result;
  414. }
  415. //-->
  416. </SCRIPT>
  417. <FORM METHOD="POST" ACTION="OutServiceOrder.asp" OnSubmit="return checkValidation();">
  418. <%
  419. set RSS=Conn.Execute ("SELECT * FROM purchaseRequests WHERE (Status = 'new' AND TypeID <> 0 AND IsService=1) ORDER BY " & sB)
  420. if not RSS.EOF then
  421. %>
  422. <TABLE dir=rtl align=center width=600 class="outServTable1">
  423. <TR class="outServTR1">
  424. <TH align=center colspan=6> </TH>
  425. </TR>
  426. <TR class="outServTR1">
  427. <TD><INPUT TYPE="checkbox" NAME="" disabled></TD>
  428. <TD><A HREF="outServiceOrder.asp?s=1"><SMALL> </SMALL></A></TD>
  429. <TD><A HREF="outServiceOrder.asp?s=2"><SMALL> </SMALL></A></TD>
  430. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  431. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  432. <TD><A HREF="outServiceOrder.asp?s=4"><SMALL> </SMALL></A></TD>
  433. </TR>
  434. <%
  435. tmpCounter=0
  436. Do while not RSS.eof
  437. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& RSS("CreatedBy") & ")" )
  438. tmpCounter = tmpCounter + 1
  439. Comment = RSS("Comment")
  440. if Comment<>"-" then
  441. Comment = ": " & Comment
  442. else
  443. Comment = " "
  444. end if
  445. if tmpCounter mod 2 = 1 then
  446. tmpColor="#FFFFFF"
  447. tmpColor2="#FFFFBB"
  448. Else
  449. tmpColor="#DDDDDD"
  450. tmpColor2="#EEEEBB"
  451. End if
  452. %>
  453. <TR bgcolor="<%=tmpColor%>" title="<%=Comment%>">
  454. <TD><INPUT TYPE="Hidden" Name="TypeID_IsService" Value="<%=RSS("TypeID")&"_"&RSS("IsService")%>"><INPUT TYPE="checkbox" NAME="outReq" VALUE="<%=RSS("id")%>"></TD>
  455. <TD><%=RSS("typeName")%></TD>
  456. <TD><span dir=ltr><%=shamsidate(RSS("ReqDate"))%></span></TD>
  457. <TD><%=RSS("price")%></TD>
  458. <TD><%=RST("RealName")%></TD>
  459. <TD><a href="../order/order.asp?act=show&id=<%=RSS("orderID")%>"><%=RSS("orderID")%></a></small></TD>
  460. </TR>
  461. <%
  462. RSS.moveNext
  463. Loop
  464. %>
  465. </TABLE>
  466. <%
  467. end if
  468. RSS.close
  469. set RSS=Conn.Execute ("SELECT * FROM purchaseRequests WHERE (Status = 'new' AND IsService=0) ORDER BY " & sB)
  470. if not RSS.EOF then
  471. %>
  472. <BR>
  473. <TABLE dir=rtl align=center width=600 class="outServTable1">
  474. <TR class="outServTR1">
  475. <TH align=center colspan=6> </TH>
  476. </TR>
  477. <TR class="outServTR1">
  478. <TD><INPUT TYPE="checkbox" NAME="" disabled></TD>
  479. <TD><A HREF="outServiceOrder.asp?s=1"><SMALL> </SMALL></A></TD>
  480. <TD><A HREF="outServiceOrder.asp?s=2"><SMALL> </SMALL></A></TD>
  481. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  482. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  483. <TD><A HREF="outServiceOrder.asp?s=4"><SMALL> </SMALL></A></TD>
  484. </TR>
  485. <%
  486. tmpCounter=0
  487. Do while not RSS.eof
  488. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& RSS("CreatedBy") & ")" )
  489. tmpCounter = tmpCounter + 1
  490. Comment = RSS("Comment")
  491. if Comment<>"-" then
  492. Comment = ": " & Comment
  493. else
  494. Comment = " "
  495. end if
  496. if tmpCounter mod 2 = 1 then
  497. tmpColor="#FFFFFF"
  498. tmpColor2="#FFFFBB"
  499. Else
  500. tmpColor="#DDDDDD"
  501. tmpColor2="#EEEEBB"
  502. End if
  503. orderIDpos = clng(RSS("OrderID"))
  504. if orderIDpos<>-1 then
  505. orderLink="<small><a href='../shopfloor/manageOrder.asp?radif=" & orderIDpos & "'>" & orderIDpos & "</a></small>"
  506. else
  507. orderLink="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
  508. end if
  509. %>
  510. <TR bgcolor="<%=tmpColor%>" title="<%=Comment%>">
  511. <TD><INPUT TYPE="Hidden" Name="TypeID_IsService" Value="<%=RSS("TypeID")&"_"&RSS("IsService")%>"><INPUT TYPE="checkbox" NAME="outReq" VALUE="<%=RSS("id")%>"></TD>
  512. <TD><%=RSS("typeName")%></TD>
  513. <TD><span dir=ltr><%=RSS("ReqDate")%></span></TD>
  514. <TD><%=RSS("price")%></TD>
  515. <TD><%=RST("RealName")%></TD>
  516. <TD><%=orderLink%> (: <%=RSS("qtty")%>) </TD>
  517. </TR>
  518. <%
  519. RSS.moveNext
  520. Loop
  521. %>
  522. </TABLE>
  523. <%
  524. end if
  525. RSS.close
  526. set RSS=Conn.Execute ("SELECT * FROM purchaseRequests WHERE (Status = 'new' AND TypeID=0) ORDER BY " & sB)
  527. if not RSS.EOF then
  528. %>
  529. <BR>
  530. <TABLE dir=rtl align=center width=600 class="outServTable1">
  531. <TR class="outServTR1">
  532. <TH align=center colspan=6> </TH>
  533. </TR>
  534. <TR class="outServTR1">
  535. <TD><INPUT TYPE="checkbox" NAME="" disabled></TD>
  536. <TD><A HREF="outServiceOrder.asp?s=1"><SMALL> </SMALL></A></TD>
  537. <TD><A HREF="outServiceOrder.asp?s=2"><SMALL> </SMALL></A></TD>
  538. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  539. <TD><A HREF="outServiceOrder.asp?s=3"><SMALL></SMALL></A></TD>
  540. <TD><A HREF="outServiceOrder.asp?s=4"><SMALL> </SMALL></A></TD>
  541. </TR>
  542. <%
  543. tmpCounter=0
  544. Do while not RSS.eof
  545. set RST=Conn.Execute ("SELECT RealName FROM Users WHERE (ID = "& RSS("CreatedBy") & ")" )
  546. Comment = RSS("Comment")
  547. if Comment<>"-" then
  548. Comment = ": " & Comment
  549. else
  550. Comment = " "
  551. end if
  552. tmpCounter = tmpCounter + 1
  553. if tmpCounter mod 2 = 1 then
  554. tmpColor="#FFFFFF"
  555. tmpColor2="#FFFFBB"
  556. Else
  557. tmpColor="#DDDDDD"
  558. tmpColor2="#EEEEBB"
  559. End if
  560. orderIDpos = clng(RSS("OrderID"))
  561. if orderIDpos<>-1 then
  562. orderLink="<small><a href='../order/order.asp?act=show&id=" & orderIDpos & "'>" & orderIDpos & "</a></small>"
  563. else
  564. orderLink="&nbsp;"
  565. end if
  566. if (RSS("qtty")="" or RSS("qtty")="0") then
  567. if orderIDpos = -1 then
  568. orderQtty = "-"
  569. else
  570. orderQtty = ""
  571. end if
  572. else
  573. orderQtty ="(:"& RSS("qtty") & ")"
  574. end if
  575. %>
  576. <TR bgcolor="<%=tmpColor%>" title="<%=Comment%>">
  577. <TD><INPUT TYPE="Hidden" Name="TypeID_IsService" Value="<%=RSS("TypeID")&"_"&RSS("IsService")%>"><INPUT TYPE="checkbox" NAME="outReq" VALUE="<%=RSS("id")%>"></TD>
  578. <TD><%=RSS("typeName")%></TD>
  579. <TD><span dir=ltr><%=shamsidate(RSS("ReqDate"))%></span></TD>
  580. <TD><%=RSS("price")%></TD>
  581. <TD><%=RST("RealName")%></TD>
  582. <TD><%=orderLink%> <%=orderQtty%> </TD>
  583. </TR>
  584. <%
  585. RSS.moveNext
  586. Loop
  587. %>
  588. </TABLE>
  589. <%
  590. end if
  591. RSS.close
  592. %>
  593. <BR>
  594. <center><INPUT TYPE="submit" Name="Submit" Value=" " style="width:150px;" tabIndex="14"></center>
  595. <br>
  596. </FORM>
  597. <%
  598. Conn.Close
  599. %>
  600. <!--#include file="tah.asp" -->