<?php
	
	$now = date( "Y-m-d H:i:s" );
	$rows = main_db_query( "SELECT * FROM Tours WHERE ShowTime <= '".$now."' AND EndTime >= '".$now."'" );
	$sessionJeu = db_fetch_assoc( $rows );

	if( $player )
	{
?>				<div id="onceMId">
					<table border=0 cellspacing=0 cellpadding=0>
						<tr>
							<td colspan=2>
								Parieur : <b><?php echo $player[NickName]; ?></b><br>
								<br style="font-size:3px">
							</td>
							<td width=15 rowspan=4>
							</td>
							<td style='padding-right:10px;'>
								<b><a onMouseover="showtip(this,event,'Session du <?php echo ($sessionJeu[ShowTime])?date( "d/m/Y",strtotime($sessionJeu[ShowTime])):""; ?> au <?php echo ($sessionJeu[EndTime])?date( "d/m/Y",strtotime($sessionJeu[EndTime])):""; ?>')" onMouseout="hidetip()"><?php echo ($sessionJeu[Name])?stripslashes($sessionJeu[Name]):""; ?></b><br>
								<br style="font-size:3px">
							</td>
							<td style='padding-right:10px;'>
<?php
				$row = db_fetch_assoc( main_db_query("SELECT * FROM Teams WHERE Id='".$player[Fruit]."'") ); 
				if($row[Image])
				{
?>
								<a href="<?php echo $sess->link3($CHOOSE_FAVTEAM_PAGE,''); ?>"><img class="img-barre" src="<?php echo $IMAGES_DIR.$row[Image]; ?>" title="<?php echo $row[Name]; ?>"></a>
								Supporter de : <b><?php echo $row[Name]; ?></b><br>
<?php
				}
?>								<br style="font-size:3px">
							</td>
						</tr>
						<tr>
							<td id=score>
<?php

	if ($player[Score]<$NB_PTS_INSCRIPTION)
	{
		echo "<span style='color:#F00;'>";
		echo "<a style='text-decoration:none;color:#F00;' href='".$sess->link3($REPLAY_PAGE, "")."' onMouseover=\"showtip(this,event,'Votre score est inférieur à ". $NB_PTS_INSCRIPTION ." points !<br>Cliquez ici si vous souhaitez revenir à ". $NB_PTS_INSCRIPTION ." points !!<br>')\" onMouseout=\"hidetip()\">".str_replace( " ", "&nbsp;", number_format( $player[Score], 0 , "", " " ))."</a>"; 
		echo "</span>";
	}
	else
	{
		echo str_replace( " ", "&nbsp;", number_format( $player[Score], 0 , "", " " )); 
	}
?>
							</td>
							<td id=score2>
<?php

	if ($player[Score]<$NB_PTS_INSCRIPTION)
	{
		echo "<span style='color:#F00;'>";
		echo "<a style='text-decoration:none;color:#F00;' href='".$sess->link3($REPLAY_PAGE, "")."' onMouseover=\"showtip(this,event,'Votre score est inférieur à ". $NB_PTS_INSCRIPTION ." points !<br>Cliquez ici si vous souhaitez revenir à ". $NB_PTS_INSCRIPTION ." points !!<br>')\" onMouseout=\"hidetip()\">Pts <img src='".$IMAGES_DIR."plusRouge.gif'></a>"; 
		echo "</span>";
	}
	else
	{
		echo "Pts"; 
	}
?>								
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($MEMBER_PAGE,""); ?>">Accueil</a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($HIGH_PAGE,""); ?>">Mes classements</a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($KFGRATUITS_PAGE,""); ?>"><font color=#FC9243>Gagnez des KF gratuitement</font></a>
							</td>
						</tr>
						<tr>
							<td id=score>
								<?php echo str_replace( " ", "&nbsp;", number_format( $player[KF], 0 , "", " " )); ?>
							</td>
							<td id=score2>
								<a onMouseover="showtip(this,event,'date limite d’utilisation le <?php echo date("d/m/Y",strtotime($DATE_FIN));?>')" onMouseout="hidetip()">KF</a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($CHOOSE_BET_PAGE,""); ?>">Mes pronostics</a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($ADD_FRIENDS_PAGE,""); ?>">Mes amis</a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a target=_blank href="<?php echo $BET_IN_EURO_LINK; ?>">Pariez des €uros</a>
							</td>	
						</tr>
						<tr>
							<td id=score>
								<?php
									echo str_replace( " ", "&nbsp;", number_format( $player[Niveau], 0 , "", " " ));
								?>
							</td>
							<td id=score2>
								<a onMouseover="showtip(this,event,'Le nombre de perfects réalisés depuis le début de la saison')" onMouseout="hidetip()">Perfect<?php echo ($player[Niveau]>1)?"s":""; ?></a>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($MY_BETS_PAGE,""); ?>">Mes résultats</a>
							</td>
							<td id=lien>
								<?php				
	
								$nonlus = db_fetch_assoc(main_db_query("SELECT count(*) AS total FROM Messagerie WHERE ToPId=".$player[Id]." AND Etat=".$TYPE_CARTON["Non_lu"]));
								$Nb_Cartons =  $nonlus["total"];
								
								if($Nb_Cartons > 0)
								{
									$add = "(".$Nb_Cartons." <img src='".$IMAGES_DIR."carton_jaune.gif' border=0 style='vertical-align:text-bottom;'>)";
								}
								?>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a href="<?php echo $sess->link3($CARTONS_JAUNES_PAGE,""); ?>">Mes cartons</a> <?php echo $add;?>
							</td>
							<td id=lien>
								<img src="<?php echo $IMAGES_DIR; ?>arrow_fff.gif"> <a target=_blank href="<?php echo $KTF_IG_PAGE."trck_clck.php3?code=RECRUTEMENT_5&email=".$member["Email"]."&url=".$KTF_IG_PAGE; ?>">Gagnez + de cadeaux</a>
							</td>						
						</tr>
					</table>
				</div>
<?php 
		}
?>
				