<% Option Explicit %>
<!--#include file="config.asp"-->
<!--#include file="common.asp"-->
<%
	PageHeader
%>
	<table border=0 width=100% cellspacing=0 cellpadding=8>
	<tr valign=top class=PageText>
		<td>
<%
			Welcome
			Response.Write "<br>"
			Menu
			Response.Write "<br>"
			PaidList
%>
		</td>
	</tr>
	<tr>
		<td colspan=2 align=center class=PageText>
		<hr noshade color="black" size="1">
		Copyright 2003 © <%= SiteName %>  All Rights Reserved
		</td>
	</tr>
	</table>

	</body>
	</html>
<%
	Sub Welcome()
%>
		<font color=green size=7><b><%= SiteName %></b></font><br><br>
<%
	End Sub


	Sub PaidList()

		OpenConnection

		Dim rs, i

		Set rs = DBC.Execute("SELECT * FROM PayOuts")
%>
		<table border=0 width=350 align=center cellspacing=0 cellpadding=3>
		<tr bgcolor=80A0F0 class=PageText>
			<td width=20>
				<b>N</b>
			</td>
			<td align=center>
				<b>Account number</b>
			</td>
			<td align=center width=70>
				<b>Payout</b>
			</td>
			<td align=center width=120>
				<b>Status</b>
			</td>
		</tr>
<%
		i = 0

		Dim SomeQueuedExists
		SomeQueuedExists = False

		Do While Not rs.EOF

		If rs("BatchNumber") = 0 And rs("To") = MyEGold And rs("IsReferral") Then
		Else
%>
		<tr bgcolor=<%= IIf(i Mod 2 = 1, "EEEEEE", "white") %> class=PageText>
			<td><%= i + 1 %>.</td>
			<td><%= rs("To") %></td>
			<td align=right>$<%= FormatNumber(rs("Cash"), 2) %></td>
			<td align=center>
<%
				If rs("BatchNumber") = 0 Then
					If rs("To") = MyEGold Then
						If rs("IsReferral") Then
						Else
							If SomeQueuedExists Then
								Response.Write "Queued"
							Else
								Response.Write "<font color=green>Paid</font>"
							End if
						End If
					Else
						Response.Write "Queued"
						SomeQueuedExists = True
					End If
				Else
					Response.Write "<font color=green>Paid</font>"
				End If
%>
			</td>
		</tr>
<%
			i = i + 1
		End If
			rs.MoveNext
		Loop
%>
		</table>
<%
	End Sub
%>