PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/beta/shopfloor/TraceOrder.asp

http://github.com/khaneh/Orders
ASP | 642 lines | 612 code | 28 blank | 2 comment | 41 complexity | 3d698fa6195f441d6af7e58251d93b78 MD5 | raw file
  1<%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%><%
  2'shopfloor (3)
  3PageTitle="������ �����"
  4SubmenuItem=3
  5if not Auth(3 , 3) then NotAllowdToViewThisPage()
  6%>
  7<!--#include file="top.asp" -->
  8<!--#include File="../include_farsiDateHandling.asp"-->
  9<%
 10Server.ScriptTimeout = 3600
 11%>
 12<SCRIPT LANGUAGE='JavaScript'>
 13<!--
 14function checkValidation(){
 15	if (document.all.search_box.value != ''){
 16		return true;
 17	}
 18	else{
 19		document.all.search_box.focus();
 20		return false;
 21	}
 22}
 23//-->
 24</SCRIPT>
 25<font face="tahoma">
 26<%
 27if request("act")="search" then
 28%>
 29	<br><br>
 30	<TABLE border="4" cellspacing="0" cellpadding="0" width="600" align="center" bordercolor="#555599">
 31	<FORM METHOD=POST ACTION="TraceOrder.asp?act=search" onSubmit="return checkValidation();">
 32	<TR><TD>
 33		<TABLE border="0" cellspacing="0" cellpadding="5" dir="RTL" width="100%">
 34		<TR bgcolor="#AAAAEE">
 35			<TD>��� ����� �� ���� �� ����� �����:</TD>
 36			<TD><INPUT TYPE="text" NAME="search_box" value="<%=request.form("search_box")%>"></TD>
 37			<TD><INPUT TYPE="submit" NAME="SubmitB" Value="�����" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
 38			<TD align="left"><% if Auth(3 , 4) then %><A HREF="TraceOrder.asp?act=advancedSearch">������ �������</A><% end if %></TD>
 39		</TR>
 40		</TABLE>
 41	</TD></TR>
 42	</FORM>
 43	</TABLE>
 44	<script language="JavaScript">
 45	<!--
 46		document.all.search_box.focus();
 47	//-->
 48	</script>
 49	<br>
 50<%
 51	searchText=request("search_box")
 52	if isNumeric(searchText) then
 53		myCriteria= "radif_sefareshat = '"& clng(searchText) & "'"
 54	else
 55		searchText=sqlSafe(searchText)
 56		myCriteria= "REPLACE([company_name], ' ', '') LIKE REPLACE(N'%"& searchText & "%', ' ', '') OR REPLACE([customer_name], ' ', '') LIKE REPLACE(N'%"& searchText & "%', ' ', '')"
 57	end if
 58	mySQL="SELECT     orders_trace.*, OrderTraceStatus.Icon FROM Orders INNER JOIN orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN OrderTraceStatus ON orders_trace.status = OrderTraceStatus.ID WHERE ("& myCriteria & ") AND (Orders.Closed=0) ORDER BY radif_sefareshat DESC"	
 59	set RS1=Conn.Execute (mySQL)
 60	if not RS1.eof then
 61		tmpCounter=0
 62%>
 63	<div align="left">
 64	<table border="1" cellspacing="0" cellpadding="0" dir="RTL">
 65		<TR bgcolor="#CCCCFF">
 66			<TD width="44"># �����</TD>
 67			<TD width="64">����� �����</TD>
 68			<TD width="64">����� �����</TD>
 69			<TD width="122">��� ����</TD>
 70			<TD width="122">��� �����</TD>
 71			<TD width="84">����� ���</TD>
 72			<TD width="44">���</TD>
 73			<TD width="73">�����</TD>
 74			<TD width="63">����� ������</TD>
 75			<TD width="24">���</TD>
 76		</TR>
 77	</table>
 78	</div>
 79	<div id="results" align="left" style="overflow:auto; width:752; height:330;border:0px;" dir="LTR" >
 80	<TABLE border="1" cellspacing="0" cellpadding="2" borderColor="#555588" dir="RTL">
 81<%		Do while not RS1.eof
 82		tmpCounter = tmpCounter + 1
 83		if tmpCounter mod 2 = 1 then
 84			tmpColor="#FFFFFF"
 85		Else
 86			tmpColor="#DDDDDD"
 87		End if 
 88%>
 89		<TR bgcolor="<%=tmpColor%>">
 90<!-- 				<TD><%=tmpCounter%></TD> -->
 91			<TD width="40" DIR="LTR"><A HREF="manageOrder.asp?radif=<%=RS1("radif_sefareshat")%>" target="_blank"><%=RS1("radif_sefareshat")%></A></TD>
 92			<TD width="60" DIR="LTR"><%=RS1("order_date")%></TD>
 93			<TD width="60" DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
 94			<TD width="118"><%=RS1("company_name") & "<br>����:("& RS1("telephone")& ")"%>&nbsp;</TD>
 95			<TD width="118"><%=RS1("customer_name")%>&nbsp;</TD>
 96			<TD width="80"><%=RS1("order_title")%>&nbsp;</TD>
 97			<TD width="40"><%=RS1("order_kind")%></TD>
 98			<TD width="69"><%=RS1("marhale")%></TD>
 99			<TD width="59"><%=RS1("salesperson")%>&nbsp;</TD>
100			<TD width="20"><IMG SRC="<%=RS1("Icon")%>" WIDTH="20" HEIGHT="20" BORDER=0 ALT="�������"></TD>
101		</TR>
102		<TR bgcolor="#FFFFFF">
103			<TD colspan="10" style="height:10px"></TD>
104		</TR>
105<%			RS1.moveNext
106		Loop
107%>		<TR bgcolor="#ccccFF">
108			<TD colspan="10">����� ����� �����: <%=tmpCounter%></TD>
109		</TR>
110	</TABLE>
111	</div>
112	<HR>
113<%	elseif request("search_box")<>"" then
114%>	<TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
115		<TR bgcolor="#FFFFDD">
116			<TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red">��� ����� ���� ������ ��� �� ���� ���� �����.<br>���� ������� �� <A HREF="orderTraceEdit.asp">����� � �����</A> ������ ����.</TD>
117		</TR>
118	</TABLE>
119<%		End if
120elseif request("act")="advancedSearch" then
121'------  Advanced Search 
122%>
123<!--#include File="../include_JS_InputMasks.asp"-->
124<%
125	Server.ScriptTimeout = 3600
126	tmpTime=time
127	tmpTime=Hour(tmpTime)&":"&Minute(tmpTime)
128	if instr(tmpTime,":")<3 then tmpTime="0" & tmpTime
129	if len(tmpTime)<5 then tmpTime=Left(tmpTime,3) & "0" & Right(tmpTime,1)
130%>
131	<br><br>
132	<TABLE border="4" cellspacing="0" cellpadding="0" width="700" align="center" bordercolor="#555599">
133	<FORM METHOD=POST ACTION="TraceOrder.asp?act=advancedSearch" onSubmit="return checkValidation();">
134	<TR><TD>
135		<TABLE border="0" cellspacing="0" cellpadding="1" dir="RTL" width="100%" bgcolor="white">
136		<TR bgcolor="#EEEEEE">
137			<TD><INPUT TYPE="checkbox" NAME="check_sefaresh" onclick="check_sefaresh_Click()" checked></TD>
138			<TD>����� �����</TD>
139			<TD><INPUT TYPE="text" NAME="az_sefaresh" dir="LTR" value="<%=request.form("az_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);"></TD>
140			<TD>��</TD>
141			<TD><INPUT TYPE="text" NAME="ta_sefaresh" dir="LTR" value="<%=request.form("ta_sefaresh")%>" size="8" maxlength="6" onKeyPress="return maskNumber(this);" ></TD>
142			<td rowspan="11" style="width:1px" bgcolor="#555599"></td>
143			<TD><INPUT TYPE="checkbox" NAME="check_kind" onclick="check_kind_Click()" checked></TD>
144			<TD>��� �����</TD>
145			<TD colspan="3"><SELECT NAME="order_kind_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
146				<OPTION value="����" <%if request.form("order_kind_box")="����" then response.write "selected" %> >����</option>
147				<OPTION value="�������" <%if request.form("order_kind_box")="�������" then response.write "selected" %> >�������</option>
148				<OPTION value="���� � ����" <%if request.form("order_kind_box")="���� � ����" then response.write "selected" %> >���� � ����</option>
149				<OPTION value="�����" <%if request.form("order_kind_box")="�����" then response.write "selected" %> >�����</option>
150				<OPTION value="�����" <%if request.form("order_kind_box")="�����" then response.write "selected" %> >�����</option>
151				<OPTION value="����" <%if request.form("order_kind_box")="����" then response.write "selected" %> >����</option>
152				<OPTION value="����" <%if request.form("order_kind_box")="����" then response.write "selected" %> >����</option>
153				<OPTION value="�����" <%if request.form("order_kind_box")="�����" then response.write "selected" %> >�����</option>
154			</SELECT></TD>
155		</TR>
156		<TR bgcolor="#555599">
157			<td colspan="11" style="height:2px"></td>
158		</TR>
159		<TR>
160			<TD><INPUT TYPE="checkbox" NAME="check_tarikh_sefaresh" onclick="check_tarikh_sefaresh_Click()" checked></TD>
161			<TD>����� �����</TD>
162			<TD><INPUT TYPE="text" NAME="az_tarikh_sefaresh" dir="LTR" value="<%=request.form("az_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);" onBlur="if(acceptDate(this))document.all.ta_tarikh_sefaresh.value=this.value;" maxlength="10"></TD>
163			<TD>��</TD>
164			<TD><INPUT TYPE="text" NAME="ta_tarikh_sefaresh" dir="LTR" value="<%=request.form("ta_tarikh_sefaresh")%>" size="10" onKeyPress="return maskDate(this);"  onblur="acceptDate(this)" maxlength="10"></TD>
165			<TD><INPUT TYPE="checkbox" NAME="check_marhale" onclick="check_marhale_Click()" checked></TD>
166			<TD>�����</TD>
167			<TD><SELECT NAME="marhale_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
168					<%
169					set RS_STEP=Conn.Execute ("SELECT * FROM OrderTraceSteps WHERE (IsActive=1)")
170					Do while not RS_STEP.eof	
171					%>
172						<OPTION value="<%=RS_STEP("ID")%>" <%if cint(request.form("marhale_box"))=cint(RS_STEP("ID")) then response.write "selected" %> ><%=RS_STEP("name")%></option>
173						<%
174						RS_STEP.moveNext
175					loop
176					%>
177			</SELECT></TD>
178			<TD><span id="marhale_not_check_label" style='font-weight:bold;color:red'>�����</span></TD>
179			<TD><INPUT TYPE="checkbox" NAME="marhale_not_check" onclick="marhale_not_check_Click();" checked></TD>
180		</TR>
181		<TR bgcolor="#555599">
182			<td colspan="11" style="height:2px"></td>
183		</TR>
184		<TR bgcolor="#EEEEEE">
185			<TD><INPUT TYPE="checkbox" NAME="check_tarikh_tahvil" onclick="check_tarikh_tahvil_Click()" checked></TD>
186			<TD>����� �����</TD>
187			<TD><INPUT TYPE="text" NAME="az_tarikh_tahvil" dir="LTR" value="<%=request.form("az_tarikh_tahvil")%>" size="10" onKeyPress="return maskDate(this);"  onblur="acceptDate(this)" maxlength="10"></TD>
188			<TD>��</TD>
189			<TD><INPUT TYPE="text" NAME="ta_tarikh_tahvil" dir="LTR" value="<%=request.form("ta_tarikh_tahvil")%>" size="10" onKeyPress="return maskDate(this);"  onblur="acceptDate(this)" maxlength="10"></TD>
190			<TD><INPUT TYPE="checkbox" NAME="check_vazyat" onclick="check_vazyat_Click()" checked></TD>
191			<TD>�����</TD>
192			<TD><SELECT NAME="vazyat_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
193				<%
194				set RS_STATUS=Conn.Execute ("SELECT * FROM OrderTraceStatus WHERE (IsActive=1)")
195				Do while not RS_STATUS.eof	
196				%>
197					<OPTION value="<%=RS_STATUS("ID")%>" <%if cint(request.form("vazyat_box"))=cint(RS_STATUS("ID")) then response.write "selected" %> ><%=RS_STATUS("Name")%></option>
198					<%
199					RS_STATUS.moveNext
200				loop
201				%>
202			</SELECT></TD>
203			<TD><span id="vazyat_not_check_label" style='font-weight:bold;color:red'>�����</span></TD>
204			<TD><INPUT TYPE="checkbox" NAME="vazyat_not_check" onclick="vazyat_not_check_Click();" checked></TD>
205		</TR>
206		<TR bgcolor="#555599">
207			<td colspan="11" style="height:2px"></td>
208		</TR>
209		<TR>
210			<TD colspan="5">&nbsp;</TD>
211			<TD><INPUT TYPE="checkbox" NAME="check_salesperson" onclick="check_salesperson_Click()" checked></TD>
212			<TD>����� ������</TD>
213			<TD colspan="3"><SELECT NAME="salesperson_box" style='font-family: tahoma,arial ; font-size: 8pt; font-weight: bold; width: 140px'>
214				<OPTION value="��������" <%if request.form("salesperson_box")="��������" then response.write "selected" %> >��������</option>
215				<OPTION value="�����" <%if request.form("salesperson_box")="�����" then response.write "selected" %> >�����</option> 
216				<OPTION value="������" <%if request.form("salesperson_box")="������" then response.write "selected" %> >������</option>
217				<OPTION value="�ѐ�" <%if request.form("salesperson_box")="�ѐ�" then response.write "selected" %> >�ѐ�</option>
218				<OPTION value="����" <%if request.form("salesperson_box")="����" then response.write "selected" %> >����</option>
219				<OPTION value="�����" <%if request.form("salesperson_box")="�����" then response.write "selected" %> >�����</option>
220				<OPTION value="����" <%if request.form("salesperson_box")="����" then response.write "selected" %> >����</option>
221				<OPTION value="����� ����" <%if request.form("salesperson_box")="����� ����" then response.write "selected" %> >����� ����</option>
222				<OPTION value="�����" <%if request.form("salesperson_box")="�����" then response.write "selected" %> >�����</option>
223				<OPTION value="�������" <%if request.form("salesperson_box")="�������" then response.write "selected" %> >�������</option>
224				<OPTION value="�����" <%if request.form("salesperson_box")="�����" then response.write "selected" %> >�����</option>
225			</SELECT></TD>
226		</TR>
227		<TR bgcolor="#555599">
228			<td colspan="11" style="height:2px"></td>
229		</TR>
230		<TR bgcolor="#EEEEEE">
231			<TD><INPUT TYPE="checkbox" NAME="check_company_name" onclick="check_company_name_Click()" checked></TD>
232			<TD>��� ����</TD>
233			<TD colspan="3"><INPUT TYPE="text" NAME="company_name_box" value="<%=request.form("company_name_box")%>"></TD>
234			<TD><INPUT TYPE="checkbox" NAME="check_telephone" onclick="check_telephone_Click()" checked></TD>
235			<TD>����</TD>
236			<TD colspan="3"><INPUT TYPE="text" NAME="telephone_box" value="<%=request.form("telephone_box")%>"></TD>
237		</TR>
238		<TR bgcolor="#555599">
239			<td colspan="11" style="height:2px"></td>
240		</TR>
241		<TR>
242			<TD><INPUT TYPE="checkbox" NAME="check_customer_name" onclick="check_customer_name_Click()" checked></TD>
243			<TD>��� �����</TD>
244			<TD colspan="3"><INPUT TYPE="text" NAME="customer_name_box" value="<%=request.form("customer_name_box")%>"></TD>
245			<TD><INPUT TYPE="checkbox" NAME="check_order_title" onclick="check_order_title_Click()" checked></TD>
246			<TD>����� �����</TD>
247			<TD colspan="3"><INPUT TYPE="text" NAME="order_title_box" value="<%=request.form("order_title_box")%>"></TD>
248		</TR>
249		<TR bgcolor="#555599">
250			<td colspan="11" style="height:2px"></td>
251		</TR>
252		<TR bgcolor="#AAAAEE">
253			<td colspan="11" style="height:30px">
254			<TABLE align="center" width="50%">
255			<TR>
256				<TD><INPUT TYPE="submit" Name="Submit" Value="�����" style="font-family:tahoma,arial; font-size:10pt;width:100px;"></TD>
257				<TD>&nbsp;<INPUT disabled TYPE="button" onclick="if(document.selection.createRange().text != ''){document.execCommand('Delete');};"></TD>
258				<TD align="left"><INPUT TYPE="button" Name="Cancel" Value="��� ��" style="font-family:tahoma,arial; font-size:10pt;width:100px;" onclick="window.location='advancedsearch.asp';"></TD>
259			</TR>
260			</TABLE>
261			</td>
262		</TR>
263		</TABLE>
264	</TD></TR>
265	</FORM>
266	</TABLE>
267	<br>
268	<SCRIPT LANGUAGE='JavaScript'>
269	<!--
270	function check_sefaresh_Click(){
271		if ( document.all.check_sefaresh.checked ) {
272			document.all.az_sefaresh.style.visibility = "visible";
273			document.all.ta_sefaresh.style.visibility = "visible";
274			document.all.az_sefaresh.focus();
275		}
276		else{
277			document.all.az_sefaresh.style.visibility = "hidden";
278			document.all.ta_sefaresh.style.visibility = "hidden";
279		}
280	}
281
282	function check_tarikh_sefaresh_Click(){
283		if ( document.all.check_tarikh_sefaresh.checked ) {
284			document.all.az_tarikh_sefaresh.style.visibility = "visible";
285			document.all.ta_tarikh_sefaresh.style.visibility = "visible";
286			document.all.az_tarikh_sefaresh.focus();
287		}
288		else{
289			document.all.az_tarikh_sefaresh.style.visibility = "hidden";
290			document.all.ta_tarikh_sefaresh.style.visibility = "hidden";
291		}
292	}
293
294	function check_tarikh_tahvil_Click(){
295		if ( document.all.check_tarikh_tahvil.checked ) {
296			document.all.az_tarikh_tahvil.style.visibility = "visible";
297			document.all.ta_tarikh_tahvil.style.visibility = "visible";
298			document.all.az_tarikh_tahvil.focus();
299		}
300		else{
301			document.all.az_tarikh_tahvil.style.visibility = "hidden";
302			document.all.ta_tarikh_tahvil.style.visibility = "hidden";
303		}
304	}
305
306	function check_company_name_Click(){
307		if (document.all.check_company_name.checked) {
308			document.all.company_name_box.style.visibility = "visible";
309			document.all.company_name_box.focus();
310		}
311		else{
312			document.all.company_name_box.style.visibility = "hidden";
313		}
314	}
315
316	function check_customer_name_Click(){
317		if (document.all.check_customer_name.checked) {
318			document.all.customer_name_box.style.visibility = "visible";
319			document.all.customer_name_box.focus();
320		}
321		else{
322			document.all.customer_name_box.style.visibility = "hidden";
323		}
324	}
325
326	function check_kind_Click(){
327		if (document.all.check_kind.checked) {
328			document.all.order_kind_box.style.visibility = "visible";
329			document.all.order_kind_box.focus();
330		}
331		else{
332			document.all.order_kind_box.style.visibility = "hidden";
333		}
334	}
335
336	function check_marhale_Click(){
337		if (document.all.check_marhale.checked) {
338			document.all.marhale_box.style.visibility = "visible";
339			document.all.marhale_box.focus();
340			document.all.marhale_not_check.style.visibility = "visible";
341			marhale_not_check_Click();	
342		}
343		else{
344			document.all.marhale_box.style.visibility = "hidden";
345			document.all.marhale_not_check.style.visibility = "hidden";
346			document.all.marhale_not_check_label.style.color='#BBBBBB'
347		}
348	}
349
350	function check_vazyat_Click(){
351		if (document.all.check_vazyat.checked) {
352			document.all.vazyat_box.style.visibility = "visible";
353			document.all.vazyat_box.focus();
354			document.all.vazyat_not_check.style.visibility = "visible";
355			vazyat_not_check_Click();
356		}
357		else{
358			document.all.vazyat_box.style.visibility = "hidden";
359			document.all.vazyat_not_check.style.visibility = "hidden";
360			document.all.vazyat_not_check_label.style.color='#BBBBBB'
361		}
362	}
363
364	function check_salesperson_Click(){
365		if (document.all.check_salesperson.checked) {
366			document.all.salesperson_box.style.visibility = "visible";
367			document.all.salesperson_box.focus();
368		}
369		else{
370			document.all.salesperson_box.style.visibility = "hidden";
371		}
372	}
373
374	function check_telephone_Click(){
375		if (document.all.check_telephone.checked) {
376			document.all.telephone_box.style.visibility = "visible";
377			document.all.telephone_box.focus();
378		}
379		else{
380			document.all.telephone_box.style.visibility = "hidden";
381		}
382	}
383
384	function check_order_title_Click(){
385		if (document.all.check_order_title.checked) {
386			document.all.order_title_box.style.visibility = "visible";
387			document.all.order_title_box.focus();
388		}
389		else{
390			document.all.order_title_box.style.visibility = "hidden";
391		}
392	}
393
394	function marhale_not_check_Click(){
395		if (document.all.marhale_not_check.checked) {
396			document.all.marhale_not_check_label.style.color='red'
397		}
398		else{
399			document.all.marhale_not_check_label.style.color='#BBBBBB'
400		}
401	}
402
403	function vazyat_not_check_Click(){
404		if (document.all.vazyat_not_check.checked) {
405			document.all.vazyat_not_check_label.style.color='red'
406		}
407		else{
408			document.all.vazyat_not_check_label.style.color='#BBBBBB'
409		}
410	}
411
412	function Form_Load(){
413	<%
414	maybeAND = ""
415	myCriteria = ""
416	If request.form("check_sefaresh") = "on" Then
417		if request.form("az_sefaresh") <> "" then
418			myCriteria = myCriteria & maybeAND & "radif_sefareshat >= " & request.form("az_sefaresh")
419			maybeAND=" AND "
420		end if
421		if request.form("ta_sefaresh") <> "" then
422			myCriteria = myCriteria & maybeAND & "radif_sefareshat <= " & request.form("ta_sefaresh")
423			maybeAND=" AND "
424		end if
425		If (request.form("az_sefaresh") = "") AND (request.form("ta_sefaresh") = "") then
426			response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
427			response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
428			response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
429		End if
430	Else
431		response.write "document.all.check_sefaresh.checked = false;" & vbCrLf
432		response.write "document.all.az_sefaresh.style.visibility = 'hidden';" & vbCrLf
433		response.write "document.all.ta_sefaresh.style.visibility = 'hidden';" & vbCrLf
434
435	End If
436
437	If request.form("check_tarikh_sefaresh") = "on" Then
438		if request.form("az_tarikh_sefaresh") <> "" then
439			myCriteria = myCriteria & maybeAND & "order_date >= '" & request.form("az_tarikh_sefaresh") & "'"
440			maybeAND=" AND "
441		end if
442		if request.form("ta_tarikh_sefaresh") <> "" then
443			myCriteria = myCriteria & maybeAND & "order_date <= '" & request.form("ta_tarikh_sefaresh") & "'"
444			maybeAND=" AND "
445		end if 
446		If (request.form("az_tarikh_sefaresh") = "") AND (request.form("ta_tarikh_sefaresh") = "") then
447			response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
448			response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
449			response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
450		End if
451	Else
452		response.write "document.all.check_tarikh_sefaresh.checked = false;" & vbCrLf
453		response.write "document.all.az_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
454		response.write "document.all.ta_tarikh_sefaresh.style.visibility = 'hidden';" & vbCrLf
455	End If
456
457	If request.form("check_tarikh_tahvil") = "on" Then
458		if request.form("az_tarikh_tahvil") <> "" then
459			myCriteria = myCriteria & maybeAND & "return_date >= '" & request.form("az_tarikh_tahvil") & "'"
460			maybeAND=" AND "
461		end if
462		if request.form("ta_tarikh_tahvil") <> "" then
463			myCriteria = myCriteria & maybeAND & "return_date <= '" & request.form("ta_tarikh_tahvil") & "'"
464			maybeAND=" AND "
465		end if
466		If (request.form("az_tarikh_tahvil") = "") AND (request.form("ta_tarikh_tahvil") = "") then
467			response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
468			response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
469			response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
470		End if
471	Else
472		response.write "document.all.check_tarikh_tahvil.checked = false;" & vbCrLf
473		response.write "document.all.az_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
474		response.write "document.all.ta_tarikh_tahvil.style.visibility = 'hidden';" & vbCrLf
475	End If
476
477	If (request.form("check_company_name") = "on" AND request.form("company_name_box") <> "" ) then
478		myCriteria = myCriteria & maybeAND & "company_name Like N'%" & request.form("company_name_box") &"%'"
479		maybeAND=" AND "
480	Else
481		response.write "document.all.check_company_name.checked = false;" & vbCrLf
482		response.write "document.all.company_name_box.style.visibility = 'hidden';" & vbCrLf
483	End if
484
485	If (request.form("check_customer_name") = "on" AND request.form("customer_name_box") <> "")then
486		myCriteria = myCriteria & maybeAND & "customer_name Like N'%" & request.form("customer_name_box") &"%'"
487		maybeAND=" AND "
488	Else
489		response.write "document.all.check_customer_name.checked = false;" & vbCrLf
490		response.write "document.all.customer_name_box.style.visibility = 'hidden';" & vbCrLf
491	End if
492
493	If request.form("check_kind") = "on" then
494		myCriteria = myCriteria & maybeAND & "order_kind = N'" & request.form("order_kind_box") & "'"
495		maybeAND=" AND "
496	Else
497		response.write "document.all.check_kind.checked = false;" & vbCrLf
498		response.write "document.all.order_kind_box.style.visibility = 'hidden';" & vbCrLf
499	End if
500
501	If request.form("check_marhale") = "on" then
502		If request.form("marhale_not_check") = "on" then
503			myCriteria = myCriteria & maybeAND & "NOT(step = " & request.form("marhale_box") & ")"
504		Else
505			myCriteria = myCriteria & maybeAND & "step = " & request.form("marhale_box") 
506			response.write "document.all.marhale_not_check.checked = false;" & vbCrLf
507			response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
508		End If
509		maybeAND=" AND "
510	Else
511		response.write "document.all.check_marhale.checked = false;" & vbCrLf
512		response.write "document.all.marhale_box.style.visibility = 'hidden';" & vbCrLf
513		response.write "document.all.marhale_not_check.style.visibility = 'hidden';" & vbCrLf
514		response.write "document.all.marhale_not_check_label.style.color='#BBBBBB';"& vbCrLf
515	End if
516
517	If request.form("check_vazyat") = "on" then
518		If request.form("vazyat_not_check") = "on" then
519			myCriteria = myCriteria & maybeAND & "NOT(status = " & request.form("vazyat_box") & ")"
520		Else
521			myCriteria = myCriteria & maybeAND & "status = " & request.form("vazyat_box") 
522			response.write "document.all.vazyat_not_check.checked = false;" & vbCrLf
523			response.write "document.all.vazyat_not_check_label.style.color='#BBBBBB';"& vbCrLf
524		End If
525		maybeAND=" AND "
526	Else
527		response.write "document.all.check_vazyat.checked = false;" & vbCrLf
528		response.write "document.all.vazyat_box.style.visibility = 'hidden';" & vbCrLf
529		response.write "document.all.vazyat_not_check.style.visibility = 'hidden';" & vbCrLf
530		response.write "document.all.vazyat_not_check_label.style.color='#BBBBBB';"& vbCrLf
531	End if
532
533	If request.form("check_salesperson") = "on" then
534		myCriteria = myCriteria & maybeAND & "salesperson = N'" & request.form("salesperson_box") & "'"
535		maybeAND=" AND "
536	Else
537		response.write "document.all.check_salesperson.checked = false;" & vbCrLf
538		response.write "document.all.salesperson_box.style.visibility = 'hidden';" & vbCrLf
539	End if
540
541	If (request.form("check_order_title") = "on" AND request.form("order_title_box") <> "")then
542		myCriteria = myCriteria & maybeAND & "order_title Like N'%" & request.form("order_title_box") &"%'"
543		maybeAND=" AND "
544	Else
545		response.write "document.all.check_order_title.checked = false;" & vbCrLf
546		response.write "document.all.order_title_box.style.visibility = 'hidden';" & vbCrLf
547	End if
548
549	If (request.form("check_telephone") = "on" AND request.form("telephone_box") <> "")then
550		myCriteria = myCriteria & maybeAND & "telephone Like N'%" & request.form("telephone_box") &"%'"
551		maybeAND=" AND "
552	Else
553		response.write "document.all.check_telephone.checked = false;" & vbCrLf
554		response.write "document.all.telephone_box.style.visibility = 'hidden';" & vbCrLf
555	End if
556
557	%>
558	}
559	function checkValidation(){
560		return true;
561	}
562
563	Form_Load();
564
565	//-->
566	</SCRIPT>
567<%
568	if request("Submit")="�����" then
569		IF maybeAND <> " AND " THEN
570			response.write "Nothing !!!!!!!!!!"
571		ELSE
572			mySQL="SELECT orders_trace.*, OrderTraceStatus.Icon FROM Orders INNER JOIN  orders_trace ON Orders.ID = orders_trace.radif_sefareshat INNER JOIN  OrderTraceStatus ON orders_trace.status = OrderTraceStatus.ID WHERE ("& myCriteria & ") AND (Orders.Closed=0) ORDER BY radif_sefareshat DESC"	
573			set RS1=Conn.Execute (mySQL)
574			if not RS1.eof then
575				tmpCounter=0
576%>
577			<div align="left">
578			<table border="1" cellspacing="0" cellpadding="0" dir="RTL">
579				<TR bgcolor="#CCCCFF">
580					<TD width="44"># �����</TD>
581					<TD width="64">����� �����</TD>
582					<TD width="64">����� �����</TD>
583					<TD width="122">��� ����</TD>
584					<TD width="122">��� �����</TD>
585					<TD width="84">����� ���</TD>
586					<TD width="44">���</TD>
587					<TD width="73">�����</TD>
588					<TD width="63">����� ������</TD>
589					<TD width="24">���</TD>
590				</TR>
591			</table>
592			</div>
593			<div id="results" align="left" style="overflow:auto; width:752; height:330;border:0px;" dir="LTR" >
594			<TABLE border="1" cellspacing="0" cellpadding="2" borderColor="#555588" dir="RTL">
595<%				Do while not RS1.eof
596				tmpCounter = tmpCounter + 1
597				if tmpCounter mod 2 = 1 then
598					tmpColor="#FFFFFF"
599				Else
600					tmpColor="#DDDDDD"
601				End if 
602%>
603				<TR bgcolor="<%=tmpColor%>">
604					<TD width="40" DIR="LTR"><A HREF="manageOrder.asp?radif=<%=RS1("radif_sefareshat")%>" target="_blank"><%=RS1("radif_sefareshat")%></A></TD>
605					<TD width="60" DIR="LTR"><%=RS1("order_date")%></TD>
606					<TD width="60" DIR="LTR"><%=RS1("return_date") & " ("& RS1("return_time") & ")"%></TD>
607					<TD width="118"><%=RS1("company_name") & "<br>����:("& RS1("telephone")& ")"%>&nbsp;</TD>
608					<TD width="118"><%=RS1("customer_name")%>&nbsp;</TD>
609					<TD width="80"><%=RS1("order_title")%>&nbsp;</TD>
610					<TD width="40"><%=RS1("order_kind")%></TD>
611					<TD width="69"><%=RS1("marhale")%></TD>
612					<TD width="59"><%=RS1("salesperson")%>&nbsp;</TD>
613					<TD width="20"><IMG SRC="<%=RS1("icon")%>" WIDTH="20" HEIGHT="20" BORDER=0 ALT="�������">
614					</TD>
615				</TR>
616				<TR bgcolor="#FFFFFF">
617					<TD colspan="10" style="height:10px"></TD>
618				</TR>
619<%					RS1.moveNext
620				Loop
621%>				<TR bgcolor="#ccccFF">
622					<TD colspan="10">����� ����� �����: <%=tmpCounter%></TD>
623				</TR>
624			</TABLE>
625			</div>
626			<BR>
627<%			else
628%>			<TABLE border="1" cellspacing="0" cellpadding="0" dir="RTL" align="center" width="600">
629				<TR bgcolor="#FFFFDD">
630					<TD align="center" style="height:40px;font-size:12pt;font-weight:bold;color:red">��� ����� ������ �� ��� �����.</TD>
631				</TR>
632			</TABLE>
633			<hr>
634<%			end if
635		END IF
636	end if
637end if
638
639Conn.Close
640%>
641</font>
642<!--#include file="tah.asp" -->