/beta/inventory/dialog_selectInvItem.asp

http://github.com/khaneh/Orders · ASP · 97 lines · 89 code · 8 blank · 0 comment · 7 complexity · 02dddee3dcb05aa13fc6ceb975d8d47f MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <!--#include file="../config.asp" -->
  3. <HTML>
  4. <HEAD>
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
  6. <meta http-equiv="Content-Language" content="fa">
  7. <style>
  8. Table { font-size: 9pt;}
  9. Input { font-family:tahoma; font-size: 9pt;}
  10. </style>
  11. <TITLE> </TITLE>
  12. <script language="JavaScript">
  13. <!--
  14. var Arguments = new Array(2)
  15. function documentKeyDown() {
  16. var theKey = event.keyCode;
  17. if (theKey == 27) {
  18. window.close();
  19. }
  20. }
  21. document.onkeydown = documentKeyDown;
  22. //-->
  23. </script>
  24. </HEAD>
  25. <BODY>
  26. <font face="tahoma">
  27. <%
  28. mySQL="SELECT * From InventoryItems WHERE (REPLACE([Name], ' ', '') LIKE REPLACE(N'%"& sqlSafe(request("name")) & "%', ' ', '')) ORDER BY Name"
  29. Set RS1 = conn.Execute(mySQL)
  30. if (RS1.eof) then %>
  31. <br><br><br><hr>
  32. <table align='center'>
  33. <tr><td bgcolor='#FFCCCC' dir='rtl' align='center'> </td>
  34. </tr>
  35. </table>
  36. <hr>
  37. <% else
  38. %>
  39. <TABLE ID="InvoiceItems" border="1" width="100%" cellspacing="1" cellpadding="5" dir="RTL">
  40. <tr bgcolor='#C3C3FF'>
  41. <td align='center' width="5%"> <input type="radio" disabled> </td>
  42. <td align='center' width="15%"> </td>
  43. <td align='center'> </td>
  44. </tr>
  45. <% tempCounter=0
  46. while Not (RS1.EOF)
  47. tempCounter=tempCounter+1
  48. if (tempCounter Mod 2 = 1)then
  49. tempColor="#FFFFFF"
  50. else
  51. tempColor="#DDDDEE"
  52. end if
  53. %> <tr bgcolor='<%=tempColor%>'>
  54. <td align='center'><input type="radio" name="selectedItem" value="<%=RS1("ID")%>" onclick="selectItem(this)">&nbsp;</td>
  55. <td dir='ltr'><%=RS1("OldItemID") %>&nbsp;</td>
  56. <td><%=RS1("Name")%>&nbsp;</td>
  57. </tr>
  58. <% RS1.movenext
  59. wend
  60. %>
  61. <tr bgcolor='#C3C3FF'>
  62. <td align='center' colspan="3"><input type="submit" style="font-family:Tahoma" value="" onclick="selectAndClose();">&nbsp;</td>
  63. </tr>
  64. </TABLE>
  65. <BR>
  66. <HR>
  67. <BR>
  68. <% end if
  69. conn.Close
  70. %>
  71. </font>
  72. </BODY>
  73. </HTML>
  74. <script language="JavaScript">
  75. <!--
  76. function selectItem(src){
  77. rowNo=src.parentNode.parentNode.rowIndex;
  78. // thePrice=document.getElementsByName("selectedItem")[rowNo-1].value
  79. myRow=document.getElementById("InvoiceItems").getElementsByTagName("tr")[rowNo];
  80. Arguments[0]=myRow.getElementsByTagName("td")[1].innerText;
  81. Arguments[1]=myRow.getElementsByTagName("td")[2].innerText;
  82. }
  83. function selectAndClose(){
  84. myString=Arguments.join("#");
  85. window.dialogArguments.value=myString
  86. window.close();
  87. }
  88. //-->
  89. </script>