/beta/AR/include_SelectQuote.asp

http://github.com/khaneh/Orders · ASP · 72 lines · 61 code · 4 blank · 7 comment · 4 complexity · b55035c51b366f8f6cddc6415227d272 MD5 · raw file

  1. <%
  2. ' This Include File Needs Following Variables to have values:
  3. '
  4. ' SQ_Action (the Action of the submit button onclick)
  5. ' SQ_Customer (AccountTitle or Name to be searched)
  6. ' SQ_StepText (e.g. ' : ')
  7. '
  8. '
  9. function Link2TraceQuote(QuoteNo)
  10. Link2TraceQuote = "<A HREF='../order/Inquiry.asp?act=show&quote="& QuoteNo & "' target='_balnk'>"& QuoteNo & "</A>"
  11. end function
  12. %>
  13. <div dir='rtl'><B><%=SQ_StepText%></B>
  14. </div><br>
  15. <!-- -->
  16. <%
  17. SQ_mySQL="SELECT * From Accounts WHERE (ID='"& SQ_Customer & "')"
  18. Set SQ_RS1 = conn.Execute(SQ_mySQL)
  19. if (SQ_RS1.eof) then
  20. response.write "Error ! No such customer"
  21. response.end
  22. else
  23. SQ_AccountTitle=SQ_RS1("AccountTitle")
  24. end if
  25. SQ_mySQL="SELECT * From Quotes WHERE (Customer='"& SQ_Customer & "') AND (Closed=0) ORDER BY ID"
  26. Set SQ_RS1 = conn.Execute(SQ_mySQL)
  27. if (SQ_RS1.eof) then ' Not Found %>
  28. <table class="RcpTable" align='center' cellpadding='5'><tr><td bgcolor='#FFCCCC' dir='rtl' align='center'> <br></td></tr></table><br>
  29. <% else
  30. %>
  31. <br>
  32. <TABLE class="RcpTable" align="center" border="1" cellspacing="1" cellpadding="5" dir="RTL">
  33. <tr bgcolor='#DDDDEE'>
  34. <td align='center' colspan="3"> <br>'<%=SQ_AccountTitle%>'<br> </td>
  35. </tr>
  36. <tr bgcolor='#C3C3FF'>
  37. <td align='center' width="30"> <input type="checkbox" disabled checked> </td>
  38. <td align='center' width="70"> </td>
  39. <td align='center' width="80"> </td>
  40. </tr>
  41. <% SQ_tempCounter=0
  42. while Not (SQ_RS1.EOF)
  43. SQ_tempCounter=SQ_tempCounter+1
  44. if (SQ_tempCounter Mod 2 = 1)then
  45. SQ_tempColor="#FFFFFF"
  46. else
  47. SQ_tempColor="#DDDDEE"
  48. end if
  49. %> <tr bgcolor='<%=SQ_tempColor%>'>
  50. <td align='center'><input type="checkbox" name="selectedQuotes" value="<%=SQ_RS1("ID")%>">&nbsp;</td>
  51. <td dir='ltr' align='center'><%=Link2TraceQuote(SQ_RS1("ID"))%>&nbsp;</td>
  52. <td dir='ltr' align='center'><%=SQ_RS1("CreatedDate")%>&nbsp;</td>
  53. </tr>
  54. <% SQ_RS1.movenext
  55. wend
  56. %>
  57. <tr bgcolor='#C3C3FF'>
  58. <td align='center' colspan="4"><input name="SQ_SelectButton" class="GenButton" type="submit" value="" onclick="<%=SQ_Action%>" >&nbsp;<input name="selectedCustomer" type="hidden" value="<%=SQ_Customer%>"></td>
  59. </tr>
  60. </TABLE>
  61. <SCRIPT LANGUAGE="JavaScript">
  62. <!--
  63. //document.all.SQ_SelectButton.focus();
  64. //-->
  65. </SCRIPT>
  66. <%
  67. end if
  68. %>