/beta/CRM/AccountInfo.asp

http://github.com/khaneh/Orders · ASP · 537 lines · 494 code · 26 blank · 17 comment · 59 complexity · ef87c96b61905a6fb487bd7ca72707ab MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2. 'CRM (1)
  3. PageTitle=""
  4. SubmenuItem=1
  5. if not Auth(1 , 1) then NotAllowdToViewThisPage()
  6. '--------------------------------------------
  7. function echoTels(tels)
  8. result=""
  9. if not IsNull(tels) then
  10. tels = Replace(Replace(Replace(Replace(tels," ",","),"-",","),"*",","),"",",")
  11. numbers = Split(tels,",")
  12. for each tel in numbers
  13. if Len(tel)>2 then
  14. result = result & "<a href='#' title=' "& tel &" ' onclick=""dial('" & tel & "','" & session("exten") & "');"">"&tel&"</a> &nbsp;"
  15. else
  16. result = result & tel & " &nbsp;"
  17. end if
  18. NEXT
  19. end if
  20. echoTels = result
  21. end function
  22. %>
  23. <!--#include file="top.asp" -->
  24. <!--#include File="../include_farsiDateHandling.asp"-->
  25. <!--#include File="../include_JS_InputMasks.asp"-->
  26. <STYLE>
  27. .GetCustTbl {font-family:tahoma; background-color: #DDDDDD; width:630; direction: RTL; }
  28. .GetCustTbl td {padding:2; font-size: 9pt; height:25;}
  29. .GetCustInp { font-family:tahoma; font-size: 9pt;}
  30. .CusTableHeader {background-color: #33AACC; text-align: center; font-weight:bold;}
  31. .CustContactTable {font-family:tahoma; width:100%; border:1 solid black; direction: RTL; background-color:#CCCCCC;}
  32. .CustContactTable td {padding:5;}
  33. .CustTable1 {font-family:tahoma; width:100%; height:100%; border:2px solid black; direction: RTL; background-color:#CCCCCC; }
  34. .CustTable1 a {text-decoration:none;color:#000088}
  35. .CustTable1 a:hover {text-decoration:underline;}
  36. .CustTable2 {font-family:tahoma; border:none; direction: RTL; width:100%; height:100%;}
  37. .CustTable3 {font-family:tahoma; border:1px solid black; direction: RTL; background-color:black; }
  38. .CustTable3 td {padding:5px;}
  39. .CustTable4 {font-family:tahoma; direction: RTL; width:100%; background-color:#C3DBEB;}
  40. .CustTableMenu {width:100%; border:none; direction: RTL;}
  41. .CustTableMenu td {border-bottom:1 solid black; height:25px; padding:5px;}
  42. .CustTableMenuSelected {background-color:#C3DBEB;}
  43. .CusTD1 {background-color: #CCCC66; text-align: left; font-weight:bold;}
  44. .CusTD2 {background-color: #DDDDDD; direction: LTR; text-align: right; font-size:9pt;}
  45. OPTION.mar{background-color:maroon; color:white;}
  46. </STYLE>
  47. <script language="javascript">
  48. function dial(tel,exten){
  49. window.showModalDialog('../home/dial.asp?tel='+tel+'&exten='+exten,'dialogHeight:20px; dialogWidth:50px; dialogTop:; dialogLeft:; edge:None; center:Yes; help:No; resizable:No; status:No;');
  50. }
  51. </script>
  52. <%
  53. if request("act")="select" then
  54. if request.form("submitButton")=" " then
  55. if request("search") <> "" then
  56. SA_TitleOrName=Replace(Replace(request("search"),"",""),"","")
  57. SA_Action="return selectOperations();"
  58. SA_SearchAgainURL="AccountInfo.asp"
  59. SA_StepText="" '" : "
  60. SA_ActName = "select"
  61. SA_SearchBox = "search"
  62. %>
  63. <FORM METHOD=POST ACTION="?act=show">
  64. <!--#include File="../AR/include_SelectAccountComplex.asp"-->
  65. </FORM>
  66. <%
  67. end if
  68. '-------------------------------------------S A M-----------------------------------------
  69. elseif request("submitButton")=" " then
  70. 'response.write "test"
  71. 'if request("search") <> "" then
  72. SA_TitleOrName=request("search")
  73. SA_Action="return selectOperations();"
  74. SA_SearchAgainURL="AccountInfo.asp"
  75. SA_StepText="" '" : "
  76. SA_ActName = "select"
  77. SA_SearchBox = "search"
  78. createDateFrom = request("createDateFrom")
  79. createDateTo = request("createDateTo")
  80. accountGroup = request("accountGroup")
  81. isPostable = request("isPostable")
  82. createdBy = request("createdBy")
  83. lastInvoiceDateFrom = request("lastInvoiceDateFrom")
  84. lastInvoiceDateTo = request("lastInvoiceDateTo")
  85. salesInvoiceDateFrom = request("salesInvoiceDateFrom")
  86. salesInvoiceDateTo = request("salesInvoiceDateTo")
  87. submitButton = request("submitButton")
  88. 'response.write "test" & lastInvoiceDateFrom & "<br>" & lastInvoiceDateTo & "<br>"
  89. %>
  90. <FORM METHOD=POST ACTION="?act=show">
  91. <!--#include File="../AR/include_SelectAccountAdvanced.asp"-->
  92. </FORM>
  93. <%
  94. 'end if
  95. '-------------------------------------------S A M-----------------------------------------
  96. else
  97. if isnumeric(request("search")) then
  98. conn.close
  99. response.redirect "?act=show&selectedCustomer=" & request("search")
  100. elseif request("search") <> "" then
  101. SA_TitleOrName=Replace(Replace(request("search"),"",""),"","")
  102. SA_Action="return selectOperations();"
  103. SA_SearchAgainURL="AccountInfo.asp"
  104. SA_StepText="" '" : "
  105. SA_ActName = "select"
  106. SA_SearchBox = "search"
  107. %>
  108. <FORM METHOD=POST ACTION="?act=show">
  109. <!--#include File="../AR/include_SelectAccount.asp"-->
  110. </FORM>
  111. <%
  112. end if
  113. end if
  114. elseif request("act")="show" then
  115. NextOf=request("NextOf")
  116. PrevOf=request("PrevOf")
  117. CusID=request("selectedCustomer")
  118. '---------------------------------------------S A M-------------------------------
  119. if request("searchtype")="advanced" then
  120. createDateFrom = request("createDateFrom")
  121. createDateTo = request("createDateTo")
  122. accountGroup = request("accountGroup")
  123. isPostable = request("isPostable")
  124. createdBy = request("createdBy")
  125. lastInvoiceDateFrom = request("lastInvoiceDateFrom")
  126. lastInvoiceDateTo = request("lastInvoiceDateTo")
  127. salesInvoiceDateFrom = request("salesInvoiceDateFrom")
  128. salesInvoiceDateTo = request("salesInvoiceDateTo")
  129. submitButton = request("submitButton")
  130. if createDateFrom <> "" then
  131. extraConditions = extraConditions & " AND CreatedDate >= '" & createDateFrom &"' "
  132. end if
  133. if createDateTo <> "" then
  134. extraConditions = extraConditions & " AND CreatedDate <= '" & createDateTo &"' "
  135. end if
  136. if accountGroup <> "-1" then
  137. extraConditions = extraConditions & " AND Accounts.ID IN (select account from accountGroupRelations where accountGroup=" & accountGroup & ")"
  138. end if
  139. if isPostable = "yes" then
  140. extraConditions = extraConditions & " AND (Postable1=1 OR Postable2=1) "
  141. end if
  142. if isPostable = "no" then
  143. extraConditions = extraConditions & " AND (Postable1=0 OR Postable2=0) "
  144. end if
  145. if lastInvoiceDateFrom <> "" then
  146. extraConditions = extraConditions & " AND Accounts.ID IN (select distinct customer from Invoices where voided=0 and issued=1 and IsReverse=0 group by customer having max(issuedDate) >='" & lastInvoiceDateFrom & "') "
  147. end if
  148. if lastInvoiceDateTo <> "" then
  149. extraConditions = extraConditions & " AND Accounts.ID IN (select distinct customer from Invoices where voided=0 and issued=1 and IsReverse=0 group by customer having max(issuedDate) <='" & lastInvoiceDateTo & "') "
  150. end if
  151. if salesInvoiceDateFrom <> "" then
  152. extraConditions = extraConditions & " AND Accounts.ID IN (select distinct customer from Invoices where issuedDate >='" & salesInvoiceDateFrom & "' and voided=0 and issued=1 and IsReverse=0) "
  153. end if
  154. if salesInvoiceDateTo <> "" then
  155. extraConditions = extraConditions & " AND Accounts.ID IN (select distinct customer from Invoices where issuedDate <='" & salesInvoiceDateTo & "' and voided=0 and issued=1 and IsReverse=0) "
  156. end if
  157. if createdBy<>"0" then
  158. extraConditions = extraConditions & " and Accounts.createdBy = " & createdBy
  159. end if
  160. end if
  161. '---------------------------------------------S A M-------------------------------
  162. if NextOf <> "" AND isNumeric(NextOf) then
  163. NextOf=clng(NextOf)
  164. mySQL="SELECT TOP 1 AccountTitle FROM Accounts WHERE (ID = '"& NextOf & "')"
  165. set RS1=Conn.execute(mySQL)
  166. if RS1.EOF then
  167. response.write "<br>"
  168. call showAlert (" ! !",CONST_MSG_ERROR)
  169. response.write "<br>"
  170. response.end
  171. end if
  172. theTitle = RS1("AccountTitle")
  173. 'mySQL="SELECT TOP 1 ID FROM Accounts WHERE (AccountTitle > N'"& theTitle & "') OR ((ID > '"& NextOf & "') AND (AccountTitle = N'"& theTitle & "')) Order BY AccountTitle, ID"
  174. '-------- changed by Alix (83-4-9) : be khaste mohaghegh tartibe hesaab haa az Alefbaa be Shomare Hesab tagheer kard
  175. '---------------------------------------------S A M-------------------------------
  176. if request("searchtype")="advanced" then
  177. mySQL="SELECT Accounts.*, Users.RealName AS CSRName FROM Accounts LEFT OUTER JOIN Users ON Accounts.CSR = Users.ID WHERE 1=1 "& extraConditions & " ORDER BY Accounts.AccountTitle"
  178. else
  179. mySQL="SELECT TOP 1 ID FROM Accounts WHERE (ID > '"& NextOf & "') Order BY ID"
  180. end if
  181. set RS1=Conn.execute(mySQL)
  182. if request("searchtype")="advanced" then
  183. while not RS1.eof
  184. if NextOf = RS1("ID") then
  185. RS1.MoveNext
  186. if not Rs1.eof then
  187. CusID = RS1("ID")
  188. 'response.write cusID
  189. LinkToNext="<a href=""?act=show&NextOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo&"&salesInvoiceDateFrom=" & salesInvoiceDateFrom & "&salesInvoiceDateTo=" & salesInvoiceDateTo & "&createdBy=" &createdBy& "&submitButton=" & submitButton &"""> &gt;</a>"
  190. else
  191. CusID = NextOf
  192. LinkToNext=" "
  193. end if
  194. end if
  195. if not Rs1.eof then RS1.movenext
  196. wend
  197. else
  198. if not Rs1.eof then
  199. CusID = RS1("ID")
  200. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  201. else
  202. CusID = NextOf
  203. LinkToNext=" "
  204. end if
  205. end if
  206. if request("searchtype")="advanced" then
  207. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo& "&salesInvoiceDateFrom=" &salesInvoiceDateFrom &"&salesInvoiceDateTo="&salesInvoiceDateTo&"&createdBy="&createdBy& "&submitButton="& submitButton &""">&lt; </a>"
  208. else
  209. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  210. end if
  211. '--------------------------------------------------------------------------------
  212. elseif PrevOf <> "" AND isNumeric(PrevOf) then
  213. PrevOf = clng(PrevOf)
  214. mySQL="SELECT TOP 1 AccountTitle FROM Accounts WHERE (ID = '"& PrevOf & "')"
  215. set RS1=Conn.execute(mySQL)
  216. if RS1.EOF then
  217. response.write "<br>"
  218. call showAlert (" ! !",CONST_MSG_ERROR)
  219. response.write "<br>"
  220. response.end
  221. end if
  222. theTitle = RS1("AccountTitle")
  223. 'mySQL="SELECT TOP 1 ID FROM Accounts WHERE (AccountTitle < N'"& theTitle & "') OR ((ID < '"& PrevOf & "') AND (AccountTitle = N'"& theTitle & "')) Order BY AccountTitle DESC, ID DESC"
  224. if request("searchtype")="advanced" then
  225. mySQL="SELECT Accounts.*, Users.RealName AS CSRName FROM Accounts LEFT OUTER JOIN Users ON Accounts.CSR = Users.ID WHERE 1=1 "& extraConditions & " ORDER BY Accounts.AccountTitle"
  226. else
  227. mySQL="SELECT TOP 1 ID FROM Accounts WHERE (ID < '"& PrevOf & "') Order BY ID DESC"
  228. end if
  229. 'Response.write mySQL
  230. set RS1=Conn.execute(mySQL)
  231. if request("searchtype")="advanced" then
  232. while not RS1.eof and break<>"exit"
  233. tmp=RS1("ID")
  234. if tmp=PrevOf then break="exit"
  235. RS1.MoveNext
  236. if RS1("ID")=PrevOf then break="exit"
  237. wend
  238. if tmp=cusID then
  239. CusID = PrevOf
  240. LinkToPrev=" "
  241. else
  242. CusID = tmp
  243. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo&"&salesInvoiceDateFrom=" & salesInvoiceDateFrom&"&salesInvoiceDateTo="&salesInvoiceDateTo&"&createdBy="&createdBy& "&submitButton="& submitButton &""">&lt; </a>"
  244. end if
  245. else
  246. if not Rs1.eof then
  247. CusID = RS1("ID")
  248. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  249. else
  250. CusID = PrevOf
  251. LinkToPrev=" "
  252. end if
  253. end if
  254. if request("searchtype")="advanced" then
  255. LinkToNext="<a href=""?act=show&NextOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo& "&salesInvoiceDateFrom=" &salesInvoiceDateFrom&"&salesInvoiceDateTo="&salesInvoiceDateTo&"&createdBy="&createdBy& "&submitButton="& submitButton &"""> &gt;</a>"
  256. else
  257. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  258. end if
  259. elseif CusID <> "" AND isNumeric(CusID) then
  260. CusID=clng(CusID)
  261. if request("searchtype")="advanced" then
  262. LinkToNext="<a href=""?act=show&NextOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo& "&salesInvoiceDateFrom=" &salesInvoiceDateFrom&"&salesInvoiceDateTo="&salesInvoiceDateTo&"&createdBy="&createdBy& "&submitButton="& submitButton &"""> &gt;</a>"
  263. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & "&searchtype=advanced&createDateFrom="&createDateFrom&"&createDateTo="&createDateTo&"&accountGroup=" &accountGroup& "&isPostable=" &isPostable & "&lastInvoiceDateFrom="& lastInvoiceDateFrom &"&lastInvoiceDateTo="&lastInvoiceDateTo& "&salesInvoiceDateFrom=" &salesInvoiceDateFrom&"&salesInvoiceDateTo="&salesInvoiceDateTo&"&createdBy="&createdBy& "&submitButton="& submitButton &""">&lt; </a>"
  264. else
  265. LinkToNext="<a href=""?act=show&NextOf="& CusID & """> &gt;</a>"
  266. LinkToPrev="<a href=""?act=show&PrevOf="& CusID & """>&lt; </a>"
  267. end if
  268. else
  269. Conn.close
  270. response.redirect "?errmsg=" & Server.URLEncode(" ")
  271. end if
  272. if CusID <> "" then
  273. mySQL="SELECT Users.RealName AS CSRName, Accounts.* FROM Accounts LEFT OUTER JOIN Users ON Accounts.CSR = Users.ID WHERE (Accounts.ID='"& CusID & "')"
  274. Set RS1=conn.execute(mySQL)
  275. if RS1.EOF then
  276. conn.close
  277. response.redirect "?errmsg=" & Server.URLEncode(" ")
  278. end if
  279. AccountTitle = RS1("AccountTitle")
  280. %>
  281. <TABLE class="CustTable1" cellspacing="0" cellpadding="0">
  282. <TR>
  283. <TD colspan="2" valign="top" height="30px;">
  284. <table class="CustTable2" cellspacing='1'>
  285. <tr>
  286. <td colspan="2" class="CusTableHeader">
  287. <TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
  288. <TR class="CusTableHeader">
  289. <TD align="left"><%=LinkToPrev%></TD>
  290. <TD width='70%' align="center"><span style="font-weight:normal;font-size:13pt;"><%=RS1("AccountTitle")%></span><br><a href="javascript:void(0);" onclick="window.open ('oldCusProf.asp?acID=<%=CusID%>',null,'Width=500, height=600, scrollbars=yes, resizable=yes');" style="font-weight:normal;font-size:6pt">( )</a></TD>
  291. <TD><%=LinkToNext%></TD>
  292. </TR>
  293. </TABLE>
  294. </td>
  295. </tr>
  296. <tr>
  297. <td colspan="2">
  298. <%
  299. AccountIsDisabled = false
  300. if RS1("Status")<>1 then
  301. AccountIsDisabled = true
  302. select case RS1("Status")
  303. Case 2: StatusText = ""
  304. Case 3: StatusText = ""
  305. end select
  306. %> <TABLE width=70% align='center'>
  307. <TR>
  308. <TD align=center bgcolor=#FFBBBB style='border: dashed 2px Red'><BR><b><%="!<br> <U>"&StatusText&"</U> "%></b><BR><BR></TD>
  309. </TR>
  310. </TABLE>
  311. <%
  312. end if
  313. %>
  314. </td>
  315. </tr>
  316. </table>
  317. </TD>
  318. </TR>
  319. <TR>
  320. <TD width="100px" valign="top">
  321. <%
  322. tab = request("tab")
  323. if tab = "" then
  324. if session("tab")="" then
  325. tab = "1"
  326. else
  327. tab = session("tab")
  328. end if
  329. end if
  330. if tab = "1" then
  331. css1 = "class='CustTableMenuSelected'"
  332. elseif tab = "0" then
  333. css0 = "class='CustTableMenuSelected'"
  334. elseif tab = "2" then
  335. css2 = "class='CustTableMenuSelected'"
  336. elseif tab = "3" then
  337. css3 = "class='CustTableMenuSelected'"
  338. elseif tab = "4" then
  339. css4 = "class='CustTableMenuSelected'"
  340. elseif tab = "5" then
  341. css5 = "class='CustTableMenuSelected'"
  342. elseif tab = "6" then
  343. css6 = "class='CustTableMenuSelected'"
  344. else
  345. css1 = "class='CustTableMenuSelected'"
  346. tab = "1"
  347. end if
  348. session("tab") = tab
  349. %>
  350. <TABLE width="100%" class="CustTableMenu" cellpadding="0" cellspacing="0">
  351. <TR><TD <%=css1%>><A HREF="AccountInfo.asp?tab=1&act=show&selectedCustomer=<%=cusID%>"></A></TD></TR>
  352. <TR><TD <%=css0%>><A HREF="AccountInfo.asp?tab=0&act=show&selectedCustomer=<%=cusID%>">ǁ </A></TD><TR>
  353. <%if Auth(6 , 0) then %>
  354. <TR><TD <%=css2%>><A HREF="AccountInfo.asp?tab=2&act=show&selectedCustomer=<%=cusID%>"> </A></TD></TR>
  355. <%end if %>
  356. <%if Auth(7 , 0) then %>
  357. <TR><TD <%=css3%>><A HREF="AccountInfo.asp?tab=3&act=show&selectedCustomer=<%=cusID%>"> </A></TD></TR>
  358. <%end if %>
  359. <%if Auth("B" , 0) then %>
  360. <TR><TD <%=css4%>><A HREF="AccountInfo.asp?tab=4&act=show&selectedCustomer=<%=cusID%>"> </A></TD></TR>
  361. <%end if %>
  362. <%if Auth(5 , 0) then %>
  363. <TR><TD <%=css6%>><A HREF="AccountInfo.asp?tab=6&act=show&selectedCustomer=<%=cusID%>"> </A></TD></TR>
  364. <%end if %>
  365. <%if Auth(9 , 0) or Auth("A" , 0) then %>
  366. <TR><TD <%=css5%>><A HREF="AccountInfo.asp?tab=5&act=show&selectedCustomer=<%=cusID%>"> </A></TD></TR>
  367. <%end if %>
  368. <!--TR><TD> </TD></TR>
  369. <TR><TD> </TD></TR>
  370. <TR><TD> </TD></TR>
  371. <TR><TD> </TD></TR>
  372. <TR><TD> </TD></TR-->
  373. </TABLE>
  374. </TD>
  375. <TD valign="top">
  376. <TaBlE class="CustTable4" cellspacing="2" cellspacing="2">
  377. <% if tab = "0" then %>
  378. <!--#include file="include_CRM_PrintForm.asp"-->
  379. <% elseif tab = "1" then %>
  380. <!--#include file="include_CRM_PrimData.asp" -->
  381. <% elseif tab = "2" then %>
  382. <!--#include file="include_CRM_ARData.asp" -->
  383. <% elseif tab = "3" then %>
  384. <!--#include file="include_CRM_APData.asp" -->
  385. <% elseif tab = "4" then %>
  386. <!--#include file="include_CRM_AOData.asp" -->
  387. <% elseif tab = "5" then %>
  388. <!--#include file="include_CRM_Cash.asp" -->
  389. <% elseif tab = "6" then %>
  390. <!--#include file="include_CRM_Inv.asp" -->
  391. <% end if %>
  392. </TaBlE>
  393. </TD>
  394. </TR>
  395. </TABLE>
  396. <%
  397. end if
  398. else
  399. %>
  400. <br>
  401. <FORM METHOD=POST ACTION="?act=select" onsubmit="if ((document.all.search.value=='') && (document.getElementById('btnSearch').value!=' ')) return false;">
  402. <div dir='rtl'><B> : </B>
  403. <INPUT TYPE="text" NAME="search">&nbsp;
  404. <INPUT TYPE="submit" Name="submitButton" value="" id="btnSearch"> &nbsp;
  405. <INPUT TYPE="submit" Name="submitButton" value=" " id='allData'> &nbsp;
  406. <input type="button" name="btnAdvanced" onclick="showAdvanced();" value=" " id="btnAdvanced">
  407. <br>
  408. </div>
  409. <div id="advancedSearch" style='visibility:hidden;'>
  410. <table>
  411. <tr>
  412. <td> :</td>
  413. <td></td>
  414. <td><input type="text" name="createDateFrom" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  415. <td></td>
  416. <td><input type="text" name="createDateTo" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  417. </tr>
  418. <tr>
  419. <td> :</td>
  420. <td></td>
  421. <td><input type="text" name="lastInvoiceDateFrom" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  422. <td></td>
  423. <td><input type="text" name="lastInvoiceDateTo" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  424. </tr>
  425. <tr>
  426. <td> :</td>
  427. <td></td>
  428. <td><input type="text" name="salesInvoiceDateFrom" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  429. <td></td>
  430. <td><input type="text" name="salesInvoiceDateTo" maxlength=10 OnBlur="return acceptDate(this);"/></td>
  431. </tr>
  432. <tr>
  433. <td>:</td>
  434. <td></td>
  435. <td colspan=3>
  436. <select name="accountGroup">
  437. <option value="-1"></option>
  438. <%
  439. set RS=conn.Execute ("SELECT * FROM accountGroups ORDER BY isPartner DESC, Name")
  440. Do while not RS.eof
  441. %>
  442. <option value='<%=RS("ID")%>' class='<% if RS("isPartner")="True" then response.write "mar"%>'><%=RS("name")%></option>
  443. <%
  444. RS.movenext
  445. loop
  446. RS.close
  447. set RS=nothing
  448. %>
  449. </select>
  450. </td>
  451. </tr>
  452. <tr>
  453. <td> :</td>
  454. <td></td>
  455. <td colspan="3">
  456. <input type="radio" name="isPostable" value="yes"><span></span>
  457. <input type="radio" name="isPostable" value="no"><span></span>
  458. <input type="radio" name="isPostable" value="all" checked><span></span>
  459. </td>
  460. </tr>
  461. <tr>
  462. <td> :</td>
  463. <td></td>
  464. <td colspan="3">
  465. <select name="createdBy">
  466. <option value="0">---- ----</option>
  467. <%
  468. set rs=Conn.Execute("select * from users where display=1 order by realName")
  469. while not rs.eof
  470. Response.write "<option value='" & rs("id") & "'>" & rs("realName") & "</option>"
  471. rs.MoveNext
  472. wend
  473. rs.close
  474. %>
  475. </select>
  476. </td>
  477. </tr>
  478. </table>
  479. </div>
  480. </FORM>
  481. <SCRIPT LANGUAGE="JavaScript">
  482. <!--
  483. document.all.search.focus();
  484. //-->
  485. </SCRIPT>
  486. <%end if
  487. conn.Close
  488. %>
  489. </font>
  490. <script language="JavaScript">
  491. <!--
  492. function showAdvanced(){
  493. document.getElementById("advancedSearch").style.visibility='visible';
  494. document.getElementById("btnAdvanced").style.visibility='hidden';
  495. document.getElementById("allData").style.visibility='hidden';
  496. document.getElementById("btnSearch").value=" ";
  497. }
  498. function selectOperations(){
  499. var Arguments = new Array;
  500. notFound=true;
  501. for (i=0;i<document.getElementsByName("selectedCustomer").length;i++){
  502. if(document.getElementsByName("selectedCustomer")[i].checked){
  503. notFound=false;
  504. }
  505. }
  506. if (notFound)
  507. return false;
  508. }
  509. //-->
  510. </script>
  511. <!--#include file="tah.asp" -->