/beta/Inquiry/dialog_inquiryItems.asp

http://github.com/khaneh/Orders · ASP · 106 lines · 100 code · 6 blank · 0 comment · 9 complexity · 4de4866b2b5d131c2fe5443b7a3295f5 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. </HEAD>
  13. <BODY>
  14. <font face="tahoma">
  15. <%
  16. name=request("name")&""
  17. mySQL="SELECT * From InvoiceItems WHERE ((REPLACE([Name], ' ', '') LIKE REPLACE(N'%"& sqlSafe(name) & "%', ' ', ''))) AND (Enabled=1) ORDER BY [id]"
  18. Set RS1 = conn.Execute(mySQL)
  19. if (RS1.eof) then %>
  20. <br><br><br><hr>
  21. <table align='center'>
  22. <tr><td bgcolor='#FFCCCC' dir='rtl' align='center'> </td>
  23. </tr>
  24. </table>
  25. <hr>
  26. <% else
  27. %>
  28. <TABLE ID="InvoiceItems" border="1" width="100%" cellspacing="1" cellpadding="5" dir="RTL">
  29. <tr bgcolor='#C3C3FF'>
  30. <td align='center' width="5%"> <input type="radio" disabled> </td>
  31. <td align='center' width="15%"> </td>
  32. <td align='center'> </td>
  33. <td align='center'>-</td>
  34. <td align='center'></td>
  35. <td align='center'></td>
  36. </tr>
  37. <% tempCounter=0
  38. while Not (RS1.EOF)
  39. tempCounter=tempCounter+1
  40. if (tempCounter Mod 2 = 1)then
  41. tempColor="#FFFFFF"
  42. else
  43. tempColor="#DDDDEE"
  44. end if
  45. %> <tr bgcolor='<%=tempColor%>'>
  46. <td align='center'><input type="radio" name="selectedItem" value="<%=RS1("ID")%>" onclick="selectItem(this)">&nbsp;</td>
  47. <td dir='ltr'><%=RS1("ID") %>&nbsp;</td>
  48. <td><%=RS1("Name")%>&nbsp;</td>
  49. <td><%=RS1("type")%></td>
  50. <td><%=RS1("fee")%></td>
  51. <td><%if RS1("hasVat") then response.write "" else response.write ""%></td>
  52. </tr>
  53. <% RS1.movenext
  54. wend
  55. %>
  56. <tr bgcolor='#C3C3FF'>
  57. <td align='center' colspan="3"><input type="submit" style="font-family:Tahoma" value="" onclick="selectAndClose();">&nbsp;</td>
  58. </tr>
  59. </TABLE>
  60. <BR>
  61. <HR>
  62. <BR>
  63. <% end if
  64. conn.Close
  65. %>
  66. </font>
  67. </BODY>
  68. </HTML>
  69. <script language="JavaScript">
  70. <!--
  71. var Arguments = new Array(4)
  72. function selectItem(src){
  73. rowNo=src.parentNode.parentNode.rowIndex;
  74. // thePrice=document.getElementsByName("selectedItem")[rowNo-1].value
  75. myRow=document.getElementById("InvoiceItems").getElementsByTagName("tr")[rowNo];
  76. Arguments[0]=myRow.getElementsByTagName("td")[1].innerText;// ID
  77. Arguments[1]=myRow.getElementsByTagName("td")[2].innerText;// Name
  78. Arguments[2]=myRow.getElementsByTagName("td")[3].innerText;// type
  79. Arguments[3]=myRow.getElementsByTagName("td")[4].innerText;// fee
  80. Arguments[4]=myRow.getElementsByTagName("td")[5].innerText;// hasVat
  81. }
  82. function selectAndClose(){
  83. myString=Arguments.join("#");
  84. window.dialogArguments.value=myString
  85. window.close();
  86. }
  87. function documentKeyDown() {
  88. var theKey = event.keyCode;
  89. if (theKey == 27) {
  90. window.close();
  91. }
  92. }
  93. document.onkeydown = documentKeyDown;
  94. radio1=document.getElementsByName("selectedItem")[0];
  95. if (radio1){
  96. radio1.checked=true;
  97. selectItem(radio1);
  98. }
  99. //-->
  100. </script>