<?

require_once("include/bittorrent.php");
hit_start();

dbconn(false);

hit_count();

loggedinorreturn();


stdhead("ArcadE - ".$_GET["gamename"]);

if (get_user_class() < UC_USER)
{
stdmsg("Sorry...", "you do not have access.");
stdfoot();
exit;
}

?>
<table width=60% border=0 cellspacing=1 class=tableoutborder cellpadding=0><tr><td class=tablea>
<div align=center>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width=100% height="400">
<param name=movie value="flash/<?=$_GET["gameURI"]?>">
<param name=quality value=high>
<embed src="flash/<?=$_GET["gameURI"]?>" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width=100% height="500">
</embed>
</object>
<?
if(isset($_GET["gameid"]))
{
$gameID=$_GET["gameid"];
if($gameID==11)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Raiden</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==1)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Asteroids</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==2)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Breakout</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==3)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Hexxagon</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==4)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><B>Invaders</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==5)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><B>Moonlander</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==6)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Pacman</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==7)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Solitaire</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==8)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Simon</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==32)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Snake</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==33)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=4><center><B>Tetris</B></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tableb WIDTH=75%>Name</TD><td class=tableb><b>Level</b></td><TD align=center class=tableb>Score</TD></TR>");
}
if($gameID==12)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Donkey Kong</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==13)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Algar</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==14)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Curveball</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==15)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Doom</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==16)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Tischkicker</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==17)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Frogger</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==18)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>GTA</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==19)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Homers Beer Run</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==20)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Jungleescape</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==21)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Marblemayhem</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==22)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Pathfinder</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==23)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Super Flash Mario Bros</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==24)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>3D Net Blazer</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==25)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Star Wars</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==26)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Bomberman</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==27)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Turtles</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==28)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>FingerFooty</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==29)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Bubble Shooter</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==30)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>MicroMachinesAsteroids</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==31)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Action Driving</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==9)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Breakfast Brawl</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
if($gameID==10)
{
print("<table border=0 class=tableoutborder cellspacing=1 cellpadding=5 align=center width=100%><TR><TD class=tabletitle COLSPAN=3><center><B>Xevious</b></center></TD></TR>");
print("<TR><TD align=center class=tableb>Rang</TD><TD align=center class=tablea WIDTH=75%>Name</TD><TD align=center class=tablea>Score</TD></TR>");
}
$result = MySQL_QUERY("SELECT * FROM flashscores WHERE game = ".$gameID." ORDER BY score DESC LIMIT 10;");
while($scores = MySQL_FETCH_ARRAY($result))
{
$userresult = MySQL_QUERY("SELECT * FROM users WHERE id = ".$scores["user"].";");
$user = MySQL_FETCH_ARRAY($userresult);
$username = $user["username"];
$ranking = MySQL_QUERY("SELECT COUNT(*) FROM flashscores WHERE game = ".$gameID." AND score > ".$scores["score"].";") OR DIE(MySQL_ERROR());
if($rankrow = mysql_fetch_row($ranking))
{
$rank = $rankrow[0]+1;
}else{
$rank = 1;
}
if($gameID < 32)
{
if($scores["user"]==$CURUSER["id"])
{
print("<TR style=\"background-color: #BBBBBB\"><TD class=tableb>".$rank."</TD><TD class=tableb align=center>".$username."</TD><TD class=tableb><div style=\"text-align:right;width:100%;\">".$scores["score"]."</div></TD></TR>");
}else{
print("<TR><TD class=tableb>".$rank."</TD><TD class=tableb align=center>".$username."</TD><TD class=tableb><div style=\"text-align:right;width:100%;\">".$scores["score"]."</div></TD></TR>");
}
}else{
if($scores["user"]==$CURUSER["id"])
{
print("<TR style=\"background-color: #BBBBBB\"><TD class=tableb>".$rank."</TD><TD class=tableb align=center>".$username."</TD><TD class=tableb>".$scores["level"]."</TD><TD class=tableb><div style=\"text-align:right;width:100%;\">".$scores["score"]."</div></TD></TR>");
}else{
print("<TR><TD class=tableb>".$rank."</TD><TD class=tableb align=center>".$username."</TD><TD class=tableb>".$scores["level"]."</TD><TD class=tableb><div style=\"text-align:right;width:100%;\">".$scores["score"]."</div></TD></TR>");
}
}
}
$yourresult = MySQL_QUERY("SELECT * FROM flashscores WHERE game = ".$gameID." AND user = ".$CURUSER["id"]." ORDER BY score DESC LIMIT 1;") OR DIE(MySQL_ERROR());
if($yourscore = MySQL_FETCH_ARRAY($yourresult))
{
$yourhighscore = $yourscore["score"];
$yourlevel = $yourscore["level"];
$yourranking = MySQL_QUERY("SELECT COUNT(*) FROM flashscores WHERE game = ".$gameID." AND score > ".$yourhighscore.";") OR DIE(MySQL_ERROR());
if($ranking = mysql_fetch_row($yourranking))
{
$yourrank = $ranking[0]+1;
}else{
$yourrank = 1;
}
if($yourrank>10)
{
if($gameID < 32)
{
print("<TR style=\"background-color: #BBBBBB\"><TD>".$yourrank."</TD><TD WIDTH=75%>".$CURUSER["username"]."</TD><TD><div style=\"text-align:right;width:100%;\">".$yourhighscore."</div></TD></TR>");
}else{
print("<TR style=\"background-color: #BBBBBB\"><TD>".$yourrank."</TD><TD WIDTH=75%>".$CURUSER["username"]."</TD><TD>".$yourlevel."</TD><TD><div style=\"text-align:right;width:100%;\">".$yourhighscore."</div></TD></TR>");
}
}
}
print("</TABLE><P>");
}else{
print("<TABLE WIDTH=100%><TR><TD><center><B>".$_GET["gamename"]."</B></center></TD></TR>");
print("<TR><TD>Sorry, we cannot save scores of this game!</TD></TR>");
print("</TABLE>");
}
?>

</td></tr>
</table>
</form>
<?

stdfoot();
hit_end();

?>
