<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>Les Parieurs</title>
</head>
<link rel="stylesheet" href="admin.css">
<body>
<?
echo "<p class='univers' align=center>Pour le Match ".$match.", voici les joueurs ayant parié sur le score ".$bet."</p>";
?>
<table align=center border=0 cellpadding=2 cellspacing=5 style="FONT-FAMILY: Arial; font-size : xx-small;">
<tr>
	<td align=center class='trTitle'>
	Joueur
	</td>
	<td align=center class='trTitle'>
	Mise
	</td>
</tr>
<?
include("../config.php3");
include($BIB."bib_generic.php3");
$left = "LEFT(Paris.Bet,LOCATE('-',Paris.Bet)-1)";
$right = "RIGHT(Paris.Bet,LENGTH(Paris.Bet)-LOCATE('-',Paris.Bet))";
if ($bet=="")
{
	$Req = main_db_query
		(
			"SELECT Players.NickName AS Surnom,Paris.Amount AS Mise 
			FROM Players LEFT JOIN Paris ON Players.Id=Paris.PlayerId 
			WHERE Paris.MatchId='$match' 
			ORDER BY Paris.Amount DESC"
		);
}
else if ($bet=="sup1")
{
	$Req = main_db_query
			(
				"SELECT Players.NickName AS Surnom,Paris.Amount AS Mise 
				FROM Players LEFT JOIN Paris ON Players.Id=Paris.PlayerId 
				WHERE Paris.MatchId='$match' 
				AND ".$left.">6 
				AND ".$left.">".$right
			);

}
elseif ($bet=="supN")
{
	$Req = main_db_query
			(
				"SELECT Players.NickName AS Surnom,Paris.Amount AS Mise 
				FROM Players LEFT JOIN Paris ON Players.Id=Paris.PlayerId 
				WHERE Paris.MatchId='$match' 
				AND ".$right.">6 
				AND ".$left."=".$right
			);

}
elseif ($bet=="sup2")
{
	$Req = main_db_query
			(
				"SELECT Players.NickName AS Surnom,Paris.Amount AS Mise 
				FROM Players LEFT JOIN Paris ON Players.Id=Paris.PlayerId 
				WHERE Paris.MatchId='$match' 
				AND ".$right.">6 
				AND ".$left."<".$right
			);
}
else
{
	$Req = main_db_query
		(
			"SELECT Players.NickName AS Surnom,Paris.Amount AS Mise 
			FROM Players LEFT JOIN Paris ON Players.Id=Paris.PlayerId 
			WHERE Paris.MatchId='$match' 
			AND Paris.Bet='$bet' ORDER BY Paris.Amount DESC"
		);
}

while($pseudo = db_fetch_array($Req))
{
	echo "<tr><td class='univers'>$pseudo[Surnom]</td>
		<td class='univers'>$pseudo[Mise]</td></tr>\n";
}


?>
</table>
</body>
</html>
