<% Option Explicit %>
<!--#include file="config.asp"-->
<!--#include file="common.asp"-->
<%
	Session.TimeOut = 5	' minutes
	Server.ScriptTimeout = 120	' seconds

	Dim rs

	If IsEmpty(Application(Prefix & "TotalMembers")) Then
		OpenConnection

		Set rs = DBC.Execute("SELECT COUNT(*) FROM Members")

		Application.Lock
		Application(Prefix & "TotalMembers") = rs(0)

		Set rs = DBC.Execute("SELECT COUNT(*) FROM Members WHERE IsGold = True")

		Application(Prefix & "TotalGoldMembers") = rs(0)

		Set rs = DBC.Execute("SELECT SUM(Cash) FROM Payouts")

		Application(Prefix & "Payouts") = rs(0)
		Application.Unlock
	End If


	PageBegin
	PageContent
	PageEnd


	Sub PageContent()
%>
	<center><%= MessageOnTop %></center>

	<table border=0 cellpadding=0 cellspacing=0 width=100%>
	<tr class=Title>
		<td align=center width=50% >
			<br>FREE Members<br><br class=HalfBreak>
		</td>
		<td align=center>
			<br>GOLD Members<br><br class=HalfBreak>
		</td>
	</tr>
	<tr class=PageText valign=top>
		<td>
			<ul type=square>
			<li>Get paid $<%= PageCost4FreeMembers %> for every visited website</li>
			<li>Get paid $<%= ReferralCommission %> for every website visited by your direct referrals</li>
			<li>Get paid $<%= FormatNumber(GoldMembershipCommission4FreeMembers, 2) %> when downline upgrade</li>
			<li>Get paid <%= AdvCommission %>% commission on advertising sales</li>
			<li>Add messages to Message Board for $<%= FormatNumber(MsgCostFreeMembers, 2) %></li>
			<li>Payout at $<%= MinimumPayout %> via e-gold</li>
			<li>International members are welcome</li>
			<li>Free to join</li>

			<br><br><a href=<%= CurrentPath %>addmember.asp>Join now</a>
			</ul>
		</td>
		<td>
			<ul type=square>
			<li>Get paid $<%= PageCost4GoldMembers %> for every visited website</li>
			<li>Get paid $<%= ReferralCommission %> for every website visited by your direct referrals</li>
			<li>Get paid $<%= FormatNumber(GoldMembershipCommission4GoldMembers, 2) %> when downline upgrade</li>
			<li>Get paid <%= AdvCommission %>% commission on advertising sales</li>
			<li>Add messages to Message Board for $<%= FormatNumber(MsgCostGoldMembers, 2) %></li>
			<li>Payout at $<%= GoldMinimumPayout %> via e-gold</li>
			<li>Free referrals</li>
			<li>Unlimited banner impressions for <%= GoldBannerDays %> days <%= IIf(GoldBannerDays > 31, "(" & GoldBannerDays \ 30 & " months)", "") %></li>
			<li><%= GoldFreeVisitors %> unique visitors to your website/affiliate program</li>
			<li>International members are welcome</li>
			<li>$<%= FormatNumber(GoldFee, 2) %> life-time membership</li>

			<br><br><a href=<%= CurrentPath %>addmember.asp>Join now</a>
			</ul>
		</td>
	</tr>
	<tr class=Title>
		<td align=center colspan=2>
			Advertisers<br><br class=HalfBreak>
		</td>
	</tr>
	<tr class=PageText>
		<td colspan=2>
			<blockquote>
			<ul type=square>
			<li>The best advertising rates available</li>
			<li>Packages from only $<%= FormatNumber(Split(VisitorPackages)(1) * (PageCost4GoldMembers + ReferralCommission + MyCommission)) %></li>
			<li>1000 guaranteed unique visitors just for $<%= FormatNumber(1000 * (PageCost4GoldMembers + ReferralCommission + MyCommission)) %></li>
			<li>Members are eager to visit your website</li>
			<li>Members must stay on your site for a full <%= MemberDelay %> seconds</li>
			<li>Real time statistics</li>
			<li>Absolutely no spam!</li>

			<br><br><a href=<%= CurrentPath %>advertise.asp>more info ...</a>
			</ul>
			</blockquote>
		</td>
	</tr>
	<tr class=Title>
		<td align=center colspan=2>
			<% LastMessages(LastMessagesOnHomePage) %>
		</td>
	</tr>
	<tr>
		<td align=center colspan=2>
			<br><br>
			<table cellpadding=0 cellspacing=0 width=260>
			<tr class=Odd>
				<td><b>TOTAL MEMBERS:</b></td>
				<td align=right>
					<%= Application(Prefix & "TotalMembers") %>
				</td>
			</tr>
			<tr class=Odd>
				<td><b>TOTAL GOLD MEMBERS:</b></td>
				<td align=right>
					<%= Application(Prefix & "TotalGoldMembers") %>
				</td>
			</tr>
			<tr class=Odd>
				<td><b>TOTAL PAYOUTS:</b></td>
				<td align=right>
					$<%= Application(Prefix & "Payouts") %>
				</td>
			</tr>
			<tr class=Odd>
				<td><b>TOTAL MEMBERS ONLINE:</b></td>
				<td align=right>
					<%= Application("Visitors") %>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
<%
	End Sub


	Sub LastMessages(N)
		Dim rs, m
%>
		<img src="images/1pixel.gif" width=100% height=1>

		<center class=Title>
		Last <%= N %> messages<br><br class=HalfBreak>
		</center>

		<table align=center cellspacing=0 cellpadding=1>
		<tr>
			<td colspan=4 align=center class=PageText>
				Your ad could be seen by <%= IIf(Application(Prefix & "TotalMembers") < 1000, "hundreds", "thousands") %> here -> UNLIMITED website hits!<br>
				<a href=msgaddselect.asp>Add your message</a><br><br>
			</td>
		</tr>
		</table>

		<table border=0 width=90% align=center cellspacing=1 cellpadding=3 bgcolor=8C8ECE>
<%
		OpenConnection

		Set rs = DBC.Execute("SELECT TOP " & N & " * FROM MsgBoard ORDER BY MID DESC")

		Do While Not rs.EOF
%>
		<tr>
			<td class=PageText bgcolor=<%= IIf(rs("IsHighlight"), MsgBoardHighlightedColor, "white") %>>
				<a href='<%= rs("URL") %>' target=_blank>
<%
				If rs("IsBold") Then
					Response.Write "<b>" & rs("Title") & "</b>"
				Else
					Response.Write rs("Title")
				End If

				Response.Write "</a><br>" & rs("Msg")
%>
			</td>
		</tr>
<%
			rs.MoveNext
		Loop

		rs.Close
%>
		</table>
<%
	End Sub
%>