PageRenderTime 45ms CodeModel.GetById 35ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/beta/Inquiry/include_SelectClosedOrdersByOrder.asp

http://github.com/khaneh/Orders
ASP | 105 lines | 91 code | 4 blank | 10 comment | 8 complexity | 50a0c8f5b90655ea0fafc7e8a55f0039 MD5 | raw file
  1<%
  2'		This Include File Needs Following Variables to have values:
  3'
  4'		SO_Action				(the Action of the submit button onclick)
  5'		SO_Order				(one Order ID )
  6'		SO_StepText				(e.g. '��� ��� : ������ ����� ��� ������')
  7'
  8'
  9%>
 10		<div dir='rtl'><B><%=SO_StepText%></B>
 11		</div><br>
 12<!-- ������ ����� ��� ������ -->
 13<%
 14	
 15	SO_mySQL="SELECT Orders.Customer, Accounts.AccountTitle FROM Orders INNER JOIN Accounts ON Orders.Customer = Accounts.ID WHERE (Orders.ID = '"& SO_Order & "')"
 16	Set SO_RS1 = conn.Execute(SO_mySQL)
 17	if (SO_RS1.eof) then
 18		response.redirect "?errmsg=" & Server.URLEncode("���� ������ ���� �����")
 19	else
 20		SO_Customer=SO_RS1("Customer")
 21		SO_AccountTitle=SO_RS1("AccountTitle")
 22	end if
 23
 24'	SO_mySQL="SELECT * From Orders WHERE (Customer='"& SO_Customer & "') ORDER BY ID"
 25'	SO_mySQL="SELECT Orders.ID, Orders.CreatedDate FROM Orders LEFT OUTER JOIN InvoiceOrderRelations ON Orders.ID = InvoiceOrderRelations.[Order] WHERE (InvoiceOrderRelations.Invoice IS NOT NULL) AND (Orders.Customer = '"& SO_Customer & "') ORDER BY Orders.ID"
 26' Changed By Kid 82/09/16 
 27	SO_mySQL="SELECT * From Orders WHERE (Customer='"& SO_Customer & "') AND (Closed=1) ORDER BY ID"
 28	Set SO_RS1 = conn.Execute(SO_mySQL)
 29%>
 30	<br>
 31	<TABLE class="RcpTable" align="center" border="1" cellspacing="1" cellpadding="5" dir="RTL">
 32		<tr bgcolor='#DDDDEE'>
 33			<td align='center' colspan="3">����� ��� ����� �� <br>'<%=SO_AccountTitle%>'<br>�� ���� ������ ���� ���</td>
 34		</tr>
 35		<tr bgcolor='#C3C3FF'>
 36			<td align='center' width="30"> <input type="checkbox" disabled checked> </td>
 37			<td align='center' width="70"> ����� ������</td>
 38			<td align='center' width="80"> ����� </td>
 39		</tr>
 40<%	SO_tempCounter=0
 41	SO_Orderfound=false
 42	while Not (SO_RS1.EOF)
 43		SO_tempCounter=SO_tempCounter+1
 44		if (SO_tempCounter Mod 2 = 1)then
 45			SO_tempColor="#FFFFFF"
 46		else
 47			SO_tempColor="#DDDDEE"
 48		end if
 49		SO_tmpOrderID=SO_RS1("ID")
 50%>		<tr bgcolor='<%=SO_tempColor%>'>
 51			<td align='center'><input type="checkbox" name="selectedOrders" value="<%=SO_tmpOrderID%>" <%if clng(SO_tmpOrderID)=clng(SO_Order) then SO_Orderfound=true : response.write "checked"%>>&nbsp;</td>
 52			<td dir='ltr' align='center'><%=Link2Trace(SO_tmpOrderID)%>&nbsp;</td>
 53			<td dir='ltr' align='center'><%=SO_RS1("CreatedDate")%>&nbsp;</td>
 54		</tr>
 55<%		SO_RS1.movenext
 56	wend
 57	SO_RS1.close
 58	if (SO_tempCounter=0) then 		' Not Found	ANY order%>
 59		<tr>
 60			<td align='center' colspan="4">
 61				<table class="RcpTable" align='center' cellpadding='5'><tr><td bgcolor='#FFCCCC' dir='rtl' align='center'>��� ������ ���� ���<br></td></tr></table>
 62			</td>
 63		</tr>
 64<%	end if
 65
 66	SO_mySQL="SELECT Invoices.Approved, Invoices.Issued, Invoices.ID FROM InvoiceOrderRelations INNER JOIN Invoices ON InvoiceOrderRelations.Invoice = Invoices.ID WHERE (InvoiceOrderRelations.[Order] = '" & SO_Order & "') AND (Invoices.Voided = 0)"
 67
 68	Set SO_RS1 = conn.Execute(SO_mySQL)
 69	if not(SO_RS1.eof) then 
 70		SO_FoundInvoice=SO_RS1("ID")
 71		if SO_RS1("Issued") then 
 72			SO_tpDesc="<B>���� ���</B>"
 73			SO_tmpColor="#FF6666"
 74		elseif SO_RS1("Approved") then 
 75			SO_tpDesc="<B>����� ���</B>"
 76			SO_tmpColor="Yellow"
 77		else
 78			SO_tpDesc="<B>����� ����</B>"
 79			SO_tmpColor="#FFFFBB"
 80		end if
 81%>
 82		<tr>
 83			<td align='center' colspan="4">
 84				<table class="RcpTable" align='center' cellpadding='5' style="border:2 solid #333366">
 85				<tr><td bgcolor='<%=SO_tmpColor%>' dir='rtl' align='center'>
 86					����!<br>������ �� ��� ����� ����� ���� �� �� ������ <%=SO_tpDesc%> ���� ����<br>
 87					<A HREF="AccountReport.asp?act=showInvoice&invoice=<%=SO_FoundInvoice%>">����� ������ ������ (<%=SO_FoundInvoice%>)</A>
 88					</td>
 89				</tr>
 90				</table>
 91			</td>
 92		</tr>
 93<%	end if
 94%>
 95		<tr bgcolor='#C3C3FF'>
 96			<td align='center' colspan="4"><input name="SO_SelectButton" class="GenButton" type="submit" value="������" onclick="<%=SO_Action%>" >&nbsp;<input name="selectedCustomer" type="hidden" value="<%=SO_Customer%>"></td>
 97		</tr>
 98	</TABLE>
 99	<SCRIPT LANGUAGE="JavaScript">
100	<!--
101	if (! window.dialogArguments){// if this is NOT a modal window
102		document.all.SO_SelectButton.focus();
103	}
104	//-->
105	</SCRIPT>