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

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