PageRenderTime 6ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 1ms

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