Loop problem

S

Speedy

Hi,

I have this page
http://www.monow.se/borg/mystat/klubb_filt.asp

but I wan't it to look like this:
http://www.monow.se/borg/mystat/wanted.asp

this is my code:

Code:
<html>
<head>
<title></title>

<style type="text/css">

td {
font-size: 11px;
font-family: verdana;
color: black;
}

a  {
text-decoration: none;
}

</style>

<link rel="stylesheet" type="text/css" href="css/table.css">
</head>

<body>

<table border="0">
<tr>
<td valign="top">

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/db.mdb")
Set objrs = Conn.Execute("SELECT tbl_player.Namn,
tbl_player.Efternamn, tbl_res.AMT1, tbl_res.AMT2, tbl_res.AMT3,
tbl_res.AMT4, tbl_res.AMT5, tbl_res.AMT6, tbl_res.AMT7, tbl_res.AMT8,
tbl_res.AMT9, tbl_res.AMT10, tbl_res.AMT11, tbl_res.AMT12,
tbl_res.AMT13, tbl_res.AMT14, tbl_res.AMT15, tbl_res.AMT16,
tbl_res.AMT17, tbl_res.AMT18, tbl_res.TOTAL FROM tbl_player INNER JOIN
tbl_res ON tbl_player.PlayerId=tbl_res.PlayerId WHERE tbl_res.Surface =
'Filt' ORDER BY Date, Varv")
%>

<table border="1" style="border-collapse: collapse"
bordercolor="1px solid #000000">
<tr bgcolor="#CDD5E4" style="font-weight: bold">
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=1" target="top10">1</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=2" target="top10">2</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=3" target="top10">3</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=4" target="top10">4</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=5" target="top10">5</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=6" target="top10">6</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=7" target="top10">7</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=8" target="top10">8</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=9" target="top10">9</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=10" target="top10">10</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=11" target="top10">11</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=12" target="top10">12</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=13" target="top10">13</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=14" target="top10">14</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=15" target="top10">15</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=16" target="top10">16</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=17" target="top10">17</a></td>
<td width="30" align="center"><a
href="top10.asp?Show=Top10&Lane=18" target="top10">18</a></td>
<td width="30" align="center">Tot</td>
</tr>

<%
If objrs.eof then
response.write "<tr><td colspan=""19"">Det finns inga
resultat!</td></tr>"
Else
do while not objrs.eof
i = i + 1
If i Mod 2 = 0 Then
%>

<tr bgcolor="#EEEEEE">
<% Else %>
<tr bgcolor="#FFFFFF">
<% End If %>

<td align="center"><%=objrs("AMT1")%></td>
<td align="center"><%=objrs("AMT2")%></td>
<td align="center"><%=objrs("AMT3")%></td>
<td align="center"><%=objrs("AMT4")%></td>
<td align="center"><%=objrs("AMT5")%></td>
<td align="center"><%=objrs("AMT6")%></td>
<td align="center"><%=objrs("AMT7")%></td>
<td align="center"><%=objrs("AMT8")%></td>
<td align="center"><%=objrs("AMT9")%></td>
<td align="center"><%=objrs("AMT10")%></td>
<td align="center"><%=objrs("AMT11")%></td>
<td align="center"><%=objrs("AMT12")%></td>
<td align="center"><%=objrs("AMT13")%></td>
<td align="center"><%=objrs("AMT14")%></td>
<td align="center"><%=objrs("AMT15")%></td>
<td align="center"><%=objrs("AMT16")%></td>
<td align="center"><%=objrs("AMT17")%></td>
<td align="center"><%=objrs("AMT18")%></td>
<td align="center" style="font-weight: bold">

<%
strTot = objrs("TOTAL")

if strTot < 30 then
response.write "<font color=""blue"">"&objrs("TOTAL")&"</font>"

elseif strTot < 36 then
response.write "<font color=""green"">"&objrs("TOTAL")&"</font>"

elseif strTot < 40 then
response.write "<font color=""red"">"&objrs("TOTAL")&"</font>"

elseif strTot > 39 then
response.write "<font color=""black"">"&objrs("TOTAL")&"</font>"

End if
%>

</td>
</tr>
<%
objrs.movenext
loop
end if
%>
</table>
</td>
<td valign="top">
<iframe src="top10.asp" name="top10" frameborder="0"
scrolling="no" valign="top" height="480">
<table>

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db/xlr13x3sm.mdb")

Dim strLane
strLane = Request.Querystring("Lane")

Set objrs = Conn.Execute("SELECT TOP 10 tbl_res.PlayerId,
Round(Avg(AMT"&strLane&"+0),3) AS medel, tbl_player.Namn,
tbl_player.Efternamn FROM tbl_res INNER JOIN tbl_player ON
tbl_res.PlayerId = tbl_player.PlayerId GROUP BY tbl_res.PlayerId,
tbl_player.Namn, tbl_player.Efternamn ORDER BY Avg(AMT"&strLane&"+0)")
%>


<%
if objrs.eof then
response.write ""

else
%>

<tr>
<td colspan="2"><span class="rub2">Top 10 - Bana <%=StrLane%></td>
</tr>
<tr>
<td colspan="2" height="10"></td>
</tr>
<tr>
<td width="150"><b>Namn</b></td>
<td><b>Snitt</b></td>
</tr>

<%
do until objrs.eof
%>

<tr onMouseOver="this.style.backgroundColor='#F4F4F4';"
onMouseOut="this.style.backgroundColor='';">
<td><input type="hidden" value="<%=objrs("PlayerId")%>"><a
href="viewstat.asp?PlayerId=<%=objrs("PlayerId")%>"><%=objrs("Namn")%>&nbsp;
<%=objrs("Efternamn")%></a></td>
<td>
<%
Varde = objrs("medel")
Response.Write FormatNumber(Varde, 2)
%>
</td>
</tr>
<tr>
<td bgcolor="#f4f4f4" colspan="2" height="1"></td>
</tr>

<%
objrs.movenext
loop
end if
%>

</table>
</iframe>
</td>
</tr>
</table>
</body>
</html>

Any ideas on how to accomplish this??

/S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top