/beta/AR/rep_CustomerNoCredit.asp

http://github.com/khaneh/Orders · ASP · 188 lines · 171 code · 15 blank · 2 comment · 16 complexity · 8ebb1e67444c0ac0aec02158d81c3289 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'Order (2)
  3. PageTitle=" "
  4. SubmenuItem=11
  5. if not Auth("C" , 9) then NotAllowdToViewThisPage()
  6. %>
  7. <!--#include file="top.asp" -->
  8. <!--#include File="../include_farsiDateHandling.asp"-->
  9. <!--#include File="../include_JS_InputMasks.asp"-->
  10. <!--#include File="../include_UtilFunctions.asp"-->
  11. <STYLE>
  12. .GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
  13. .GetCustTbl td {padding:2; font-size: 9pt; height:25;}
  14. .GetCustInp { font-family:tahoma; font-size: 9pt;}
  15. .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
  16. .CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
  17. .CustContactTable td {padding:5;}
  18. .CustTable {font-family:tahoma; width:80%; border:1 solid black; direction: RTL; background-color:black;}
  19. .CustTable td {padding:5;}
  20. .CustTable a {text-decoration:none;color:#000088}
  21. .CustTable a:hover {text-decoration:underline;}
  22. .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
  23. .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
  24. .CusTD3 {background-color: #DDDDDD; direction: LTR; text-align: center; font-size:9pt;}
  25. .CusTD4 {background-color: #CCCC66; direction: LTR; text-align: center; font-size:9pt;}
  26. .CustTable4 {font-family:tahoma; direction: RTL; width:100%; height:100%; background-color:#C3DBEB;}
  27. </STYLE>
  28. <%
  29. if request("act")="show" then
  30. 'ON ERROR RESUME Next
  31. Ord = request("Ord")
  32. If Ord="" Then Ord = 0
  33. select case Ord
  34. case "1":
  35. order="accounts.id"
  36. case "-1":
  37. order="accounts.id DESC"
  38. case "2":
  39. order="AccountTitle"
  40. case "-2":
  41. order="AccountTitle DESC"
  42. case "3":
  43. order="creditLimit"
  44. case "-3":
  45. order="creditLimit DESC"
  46. case "4":
  47. order="arBalance"
  48. case "-4":
  49. order="arBalance DESC"
  50. case "5":
  51. order="apBalance"
  52. case "-5":
  53. order="apBalance DESC"
  54. case "6":
  55. order="aoBalance"
  56. case "-6":
  57. order="aoBalance DESC"
  58. case "7":
  59. order="realName"
  60. case "-7":
  61. order="realName DESC"
  62. case else:
  63. order="accounts.id"
  64. Ord=1
  65. end select
  66. %>
  67. <TABLE dir=rtl align=center width=640 cellspacing=2 cellpadding=2 style="border:2 solid #330066;">
  68. <TR bgcolor="eeeeee" style="cursor:hand;" title=" ">
  69. <TD width=50 onclick='go2Page(1,1);' style="<%if abs(ord)=1 then response.write style%>"> <%if abs(ord)=1 then response.write arrow%></TD>
  70. <td onclick='go2Page(1,2);' style="<%if abs(ord)=2 then response.write style%>"> <%if abs(ord)=2 then response.write arrow%></td>
  71. <td onclick='go2Page(1,3);' style="<%if abs(ord)=3 then response.write style%>"> <%if abs(ord)=3 then response.write arrow%></td>
  72. <td onclick='go2Page(1,4);' style="<%if abs(ord)=4 then response.write style%>"> <%if abs(ord)=4 then response.write arrow%></td>
  73. <td onclick='go2Page(1,5);' style="<%if abs(ord)=5 then response.write style%>"> <%if abs(ord)=5 then response.write arrow%></td>
  74. <td onclick='go2Page(1,6);' style="<%if abs(ord)=6 then response.write style%>"> <%if abs(ord)=6 then response.write arrow%></td>
  75. <td onclick='go2Page(1,7);' style="<%if abs(ord)=7 then response.write style%>"> <%if abs(ord)=7 then response.write arrow%></td>
  76. </TR>
  77. <TR bgcolor="eeeeee" >
  78. <TD colspan=7 height=2 bgcolor=0></TD>
  79. </TR>
  80. <%
  81. mySQL="select accounts.*,users.realName from accounts left outer join users on accounts.csr=users.id where creditLimit>0 ORDER BY " & order
  82. Set rs=Server.CreateObject("ADODB.Recordset")'Conn.Execute(mySQL)
  83. PageSize = 50
  84. rs.PageSize = PageSize
  85. rs.CursorLocation=3 'in ADOVBS_INC adUseClient=3
  86. rs.Open mySQL ,Conn,3
  87. TotalPages = rs.PageCount
  88. CurrentPage=1
  89. if isnumeric(Request.QueryString("p")) then
  90. pp=clng(Request.QueryString("p"))
  91. if pp <= TotalPages AND pp > 0 then
  92. CurrentPage = pp
  93. end if
  94. end if
  95. if not rs.eof then
  96. rs.AbsolutePage=CurrentPage
  97. end if
  98. if rs.eof then
  99. %> <tr>
  100. <td bgcolor="#BBBBBB" height="30" colspan="7" align=center><b> .</b></td>
  101. </tr>
  102. <% else
  103. Do While NOT rs.eof AND (rs.AbsolutePage = CurrentPage)
  104. tmpCounter = tmpCounter + 1
  105. if tmpCounter mod 2 = 1 then
  106. tmpColor="#FFFFFF"
  107. tmpColor2="#FFFFBB"
  108. Else
  109. tmpColor="#DDDDDD"
  110. tmpColor2="#EEEEBB"
  111. End if
  112. %>
  113. <TR bgcolor="<%=tmpColor%>" >
  114. <TD dir=ltr align=right><A href="../CRM/AccountInfo.asp?act=show&selectedCustomer=<%=rs("ID")%>"><%=rs("id")%></A></TD>
  115. <TD><%=rs("accountTitle")%></TD>
  116. <TD style='direction:LTR;text-align:right;'><%=Separate(rs("creditLimit"))%></TD>
  117. <TD style='direction:LTR;text-align:right;'><%=Separate(rs("arBalance"))%></TD>
  118. <TD style='direction:LTR;text-align:right;'><%=Separate(rs("apBalance"))%></TD>
  119. <TD style='direction:LTR;text-align:right;'><%=Separate(rs("aoBalance"))%></TD>
  120. <TD><%=rs("realName")%></TD>
  121. </TR>
  122. <%
  123. rs.moveNext
  124. Loop
  125. if TotalPages > 1 then
  126. pageCols=20
  127. %>
  128. <TR bgcolor="eeeeee" >
  129. <TD colspan=7 height=2 bgcolor=0></TD>
  130. </TR>
  131. <TR class="RepTableTitle">
  132. <TD bgcolor="#CCCCEE" height="30" colspan="7">
  133. <table width=100% cellspacing=0 style="cursor:hand;color:gray;">
  134. <tr>
  135. <td style="height:25;border-bottom:1 solid black;" colspan=<%=pagecols%>>
  136. <b> <%=CurrentPage%> <%=TotalPages%></b>
  137. &nbsp;&nbsp;<a href="javascript:go2Page(<%=CurrentPage+1%>,0);"> &gt;</a>
  138. </td>
  139. </tr>
  140. <tr>
  141. <% for i=1 to TotalPages
  142. if i = CurrentPage then
  143. %> <td style="color:black;"><b>[<%=i%>]</b></td>
  144. <% else
  145. %> <td onclick="go2Page(<%=i%>,0);"><%=i%></td>
  146. <% end if
  147. if i mod pageCols = 0 then response.write "</tr><tr>"
  148. next
  149. %> </tr>
  150. </table>
  151. </TD>
  152. </TR>
  153. <% end if
  154. %>
  155. </TABLE>
  156. <br>
  157. <SCRIPT LANGUAGE="JavaScript">
  158. function go2Page(p,ord) {
  159. if(ord==0){
  160. ord=<%=Ord%>;
  161. }
  162. else if(ord==<%=Ord%>){
  163. ord= 0-ord;
  164. }
  165. str = '?act=show&FromDate=' + escape('<%=FromDate%>') + '&ToDate=' + escape('<%=ToDate%>') + '&Ord=' + escape(ord) + '&p=' + escape(p);
  166. window.location = str;
  167. }
  168. </SCRIPT>
  169. <%
  170. End if
  171. End If
  172. %>
  173. <!--#include file="tah.asp" -->