<?php 
include '../lib/configuration.inc';

if(!isset($_SESSION['SessionWeb_joueur_id'])){
	header('Location: ./compte_deconnexion.php');
	exit;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?=$_SESSION['SessionWeb_langue']?>" xml:lang="<?=strtolower($_SESSION['SessionWeb_langue'])?>">
<head>
	<title><?=$txt_espace_equipe_titre?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=8">
	<meta name="language" content="<?=strtolower($_SESSION['SessionWeb_langue'])?>">
	<meta name="robots" content="index, follow">
	<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
	<link rel="shortcut icon" href="/favicon.png">
	<link rel="stylesheet" type="text/css" href="<?=$web_commun?>commun.css">
</head>

<body scroll="auto">

<div id="page" align="center">

	<div id="contenu">

		<?php $espace='equipe'; include './commun/entete.inc'; ?>

		<div id="contenu_bis">

			<div id="menu">

				<?php include './commun/menu.inc'; ?>

			</div>

			<div id="formulaire_bis">

				<h1><?=$txt_espace_equipe_planning_titre?></h1>

				<div class="separateur"></div>

				<?php 
				if($parametre_site_affichage_planning==1){

					// Sélection du planning de l'équipe du joueur
					$requete_planning = mysqli_query($connexion_mysql, 'SELECT planning_groupe, DATE_FORMAT(planning_depart_date, "'.$txt_espace_equipe_planning_format_date.'"), DATE_FORMAT(planning_depart_heure, "'.$txt_espace_equipe_planning_format_heure.'"), golf_nom FROM planning A INNER JOIN golfs B ON A.golf_id=B.golf_id WHERE equipe_id="'.$_SESSION['SessionWeb_equipe_id'].'" ORDER BY planning_depart_date');
					$nb_departs = mysqli_num_rows($requete_planning);
					if($nb_departs!=0){

						for($depart_boucle=0; $depart_boucle<$nb_departs; $depart_boucle++){
							$resultat_depart = mysqli_fetch_array($requete_planning);
							$planning_groupe = $resultat_depart[0];
							$planning_depart_date = $resultat_depart[1];
							$planning_depart_heure = $resultat_depart[2];
							$golf_nom = decodage_apostrophe(html_entity_decode(stripslashes($resultat_depart[3])));

							if($depart_boucle==0){
								echo '<span class="texte_vert" style="font-size: 18px;">'.$txt_espace_equipe_planning_groupe.' '.$planning_groupe.'</span><br><br><br>';
							}

							echo '<b><u>'.$txt_espace_equipe_planning_depart.' N&deg; '.($depart_boucle+1).'</u></b><br><br>';

							echo $txt_espace_equipe_planning_date_heure.' :&nbsp; '.$txt_espace_equipe_planning_le.'&nbsp; '.$planning_depart_date.'&nbsp;&nbsp; '.$txt_espace_equipe_planning_a.'&nbsp; '.$planning_depart_heure.'<br><br>';
							echo $txt_espace_equipe_planning_lieu.' :&nbsp; Golf&nbsp; « '.$golf_nom.' »<br><br>';

							if($depart_boucle!=($nb_departs-1)){
								echo '<div class="separateur"></div>';
							}

						}
					}

				}
				?>

			</div>
			<br clear="all">

		</div>

	</div>

</div>

</body>
</html>
