<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/events.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "2002/05/05"
if (date() <> ""

then Recordset1__MMColParam = date()
%>
<!--#include file="../Connections/events.asp" -->
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"

Recordset1.ActiveConnection = MM_events_STRING
Recordset1.Source = "SELECT agegroup, eventname, ID, maxgamers, startdate FROM eventdetails WHERE startdate >= #" + Replace(Recordset1__MMColParam, "'", "''"

+ "# ORDER BY startdate ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "2"
if (Recordset1("id"

<> ""

then Recordset2__MMColParam = Recordset1("id"
%>
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset"

Recordset2.ActiveConnection = MM_events_STRING
Recordset2.Source = "SELECT * FROM participants WHERE event_id = " + Replace(Recordset2__MMColParam, "'", "''"

+ ""
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
Recordset2_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 10
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
Recordset2_total = Recordset2.RecordCount
' set the number of rows displayed on this page
If (Recordset2_numRows < 0) Then
Recordset2_numRows = Recordset2_total
Elseif (Recordset2_numRows = 0) Then
Recordset2_numRows = 1
End If
' set the first and last displayed record
Recordset2_first = 1
Recordset2_last = Recordset2_first + Recordset2_numRows - 1
' if we have the correct record count, check the other stats
If (Recordset2_total <> -1) Then
If (Recordset2_first > Recordset2_total) Then Recordset2_first = Recordset2_total
If (Recordset2_last > Recordset2_total) Then Recordset2_last = Recordset2_total
If (Recordset2_numRows > Recordset2_total) Then Recordset2_numRows = Recordset2_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (Recordset2_total = -1) Then
' count the total records by iterating through the recordset
Recordset2_total=0
While (Not Recordset2.EOF)
Recordset2_total = Recordset2_total + 1
Recordset2.MoveNext
Wend
' reset the cursor to the beginning
If (Recordset2.CursorType > 0) Then
Recordset2.MoveFirst
Else
Recordset2.Requery
End If
' set the number of rows displayed on this page
If (Recordset2_numRows < 0 Or Recordset2_numRows > Recordset2_total) Then
Recordset2_numRows = Recordset2_total
End If
' set the first and last displayed record
Recordset2_first = 1
Recordset2_last = Recordset2_first + Recordset2_numRows - 1
If (Recordset2_first > Recordset2_total) Then Recordset2_first = Recordset2_total
If (Recordset2_last > Recordset2_total) Then Recordset2_last = Recordset2_total
End If
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> ""

Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> ""

Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> ""

Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> ""

Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> ""

Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a
)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"
)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById
; return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#"
!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
//-->
</script>
<body bgcolor="#4B4B4B" onLoad="MM_preloadImages('../Images/btg.jpg')">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<table width="98%" cellspacing="0" cellpadding="0">
<tr>
<td width="20" height="36" background="../Images/sidetl.jpg"> </td>
<td background="../Images/sidet.jpg" height="36"> </td>
<td width="20" height="36" background="../Images/sidetr.jpg"> </td>
</tr>
<tr>
<td background="../Images/sidel.jpg" width="20"> </td>
<td bgcolor="#000000">
<table width="100%" border="0" cellspacing="1" align="center" cellpadding="1">
<tr>
<td bgcolor="#202020"><b><font color="#FF7F00" size="2" face="Times New Roman, Times, serif">Event
name</font></b></td>
<td bgcolor="#202020"><b><font color="#FF7F00" size="2" face="Times New Roman, Times, serif">Start
time</font></b></td>
<td bgcolor="#202020"><b><font color="#FF7F00" size="2" face="Times New Roman, Times, serif">Max
participants </font></b></td>
<td bgcolor="#202020"><b><font color="#FF7F00" size="2" face="Times New Roman, Times, serif">Age
group</font></b></td>
<td width="30" bgcolor="#202020"><font color="#FF7F00" face="Times New Roman, Times, serif" size="2"><b>Vie</b></font><font face="Times New Roman, Times, serif" size="2"><b><font color="#FF7F00">w</font></b></font></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td bgcolor="#464646" height="25">
<font color="#FFFFFF" face="Times New Roman, Times, serif" size="1"><b><%=(Recordset1.Fields.Item("eventname"
.Value)%> </b></font></td>
<td bgcolor="#464646" height="25"><font color="#FFFFFF" face="Times New Roman, Times, serif" size="2"><b><font size="1"><%=(Recordset1.Fields.Item("startdate"
.Value)%></font></b></font></td>
<td bgcolor="#464646" height="25"><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="1"><%=(Recordset2_total)%>/ <%=(Recordset1.Fields.Item("maxgamers"
.Value)%> </font></b></td>
<td bgcolor="#464646" height="25"><b><font color="#FFFFFF" face="Times New Roman, Times, serif" size="1"><%=(Recordset1.Fields.Item("agegroup"
.Value)%></font></b></td>
<td width="30" height="25"><a href="event_view.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID"
.Value %>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../Images/btg.jpg',1)"><img src="../Images/btb.jpg" name="Image2" width="25" height="25" border="0" usemap="#button"></a></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</td>
<td background="../Images/sider.jpg" width="20"> </td>
</tr>
<tr>
<td width="20" height="36" background="../Images/sidebl.jpg"> </td>
<td background="../Images/sideb.jpg" height="36"> </td>
<td width="20" height="36" background="../Images/sidebr.jpg"> </td>
</tr>
</table>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
<% If Recordset1.EOF And Recordset1.BOF Then %>
<table width="250" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#CC0000" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FF7F00">
<div align="center"><font color="#CC0000"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#CCCCCC">There
Are Currently No Events Listed Please Try Again Later </font></b></font></div>
</td>
</tr>
</table>
<% End If ' end Recordset1.EOF And Recordset1.BOF %>
<p align="center"> </p>
<%
Recordset1.Close()
%>
<%
Recordset2.Close()
%>