<?php
	session_start();
	include('database.php');
	DB_connexion(); 
	
	ini_set( 'display_errors', '0');
	error_reporting( 0 );
	
	/*if(!isset($_SESSION['logged']) )
	{		header ('Location: interdiction.php');
	}
	
	if($_SESSION['logged']== "no")
	{
		header ('Location: interdiction.php');
	}*/
	
?>

<!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" xml:lang="fr" lang="fr" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="Site perso,cours,ouvrages" />
<meta name="Keywords" content="WEBSITE perso " />
<meta name="Distribution" content="Global" />
<meta name="Robots" content="" />
<meta http-equiv="Content-Language" content="fr" />
<meta name="rating" content="general" />
<meta name="author" content="Patrice DELPY" />
<meta name="copyright" content="Copyright 2013" />
<meta name="generator" content="Patoche" />
<title>Patoche WEBSITE - 2013 - Template du site - en cours de développemment ...</title>

<!---------------------------------------------------------->	
<?php
		include('include_css_template_commun.php');
		include('include_css.php');
		include('css_tools_skill.php');
		include('include_javascript.php');

?> 

<style type="text/css">
#bloc_listing_joueur { float: left;
					width: 831px; 
					padding: 50px 50px 25px 50px;
					}	
					
#navigation_tournoi{
					float: left;
					width: 850px;
					padding: 10px 0px 0px 10px;
		}
					
p {
  margin-top: 0px;
}
 
fieldset {
  margin-bottom: 15px;
  padding: 10px;
}
 
legend {
  padding: 0px 3px;
  font-weight: bold;
  font-variant: small-caps;
}
 
label {
  width: 110px;
  display: inline-block;
  vertical-align: top;
  margin: 6px;
}					
					
input[type=submit] {
  width: 150px;
  padding: 10px;
}					
					
</style>

<script type="text/javascript">

function call_update()
{
	 ajax_routine(); 
	 setTimeout("call_update()", 1000); //appelle la fonction 1 fois par  seconde
}

function go()
{
	alert('Choix');
}



</script>

<!---------------------------------------------------------->	
</head>

<body>
<!---------------------------------------------------------->	
	<div class="main"> <!-- main -->
<!---------------------------------------------------------->	

          <div class="header">
                <div class="balise_titre">Patoche</div>
                <div class="balise_citation">
                &quot;Etre conscient que l'on est ignorant est un grand pas vers le savoir&quot;
                </div>
          </div> 
 
          <div class="banniere"></div>  

<!---------------------------------------------------------->
<?php
/*	include("include_barre_login.php");
	echo '<div id="box_icon">';
	include("debug_connexion_membre.php");
	echo '</div>';
	include("include_menu.php");*/
	
	echo '<div id="box_infos">';
			include("include_menu.php");
			
			echo '<div id="box_icon2">';
			include("connexion_membre.php");
			echo	'</div>';
			
			echo '<div id="box_icon3">';
			include("include_barre_login.php");
			echo	'</div>';

	echo	'</div>';
	$_SESSION['page_active'] = basename (__FILE__ );
?>
		
<!---------------------------------------------------------->	
            <div class="contenu"> <!-- contenu -->
<!---------------------------------------------------------->	
	
			<div class="barre_vide"></div>
			
			<div id="navigation_tournoi">
				<ul id="menu_horiz">
				<li class="tournoi_joueur_tag"><a href="ajouter_joueur.php" title="aller à la section">Ajouter joueur</a></li>
				<li class="tournoi_partie_tag"><a href="partie.php" title="aller à la section">Partie</a></li>
				<li class="tournoi_classement_tag"><a href="classement.php" title="aller à la section">classement</a></li>
				<li class="tournoi_liste_joueurs_tag"><a href="liste_joueurs.php" title="aller à la section">Joueurs</a></li>
				<li class="tournoi_stats_tag_selected"><a href="stats_joueurs.php" title="aller à la section">Stats</a></li>
				</ul>
			</div>
			
			<div id="bloc_listing_joueur">
	
<?php			

				$sql = "SELECT * FROM partie"; 
				$results = mysql_query($sql);
				$number = mysql_num_rows($results);
				
				

				// affiche le nombre d'entrée dans la base
				echo "<p align=center>$number enregistrements.</p><br>";
				$i=0;

				echo "<table border=1 align=center width='80%'><tr>
	
				<th>Ordre</th>
				<th>Joueur 1</th>
				<th>Joueur 2</th>
				<th>Match</th>
				<th>Date</th>
				<th>Heure</th>
				</tr>";
				
				while($row = mysql_fetch_assoc($results))
				{
	
					$id = $row['id'];
					$J1 = $row['joueur1'];
					$J2 = $row['joueur2'];
					$resultat_partie = $row['resultat_partie'];	
					$date_partie = $row['date_partie'];
					$heure_partie = $row['heure_partie'];
					
					// affichage des enregistrements
					echo "<tr> 
						  <td align=center width='20'> $id </td> 
						  <td align=center width='150'> $J1 </td> 
						  <td align=center width='150'> $J2 </td>
						  <td align=center width='150'> $resultat_partie </td>
						  <td align=center width='150'> $date_partie </td>
						  <td align=center width='150'> $heure_partie </td>
						</tr>";
	            } 	

				echo "</table>";

				// referme la connexion avec la base de donnée
				mysql_close();
?>

				</td>
				</tr>
				</table>
		
			</div>
			
			<label>Joueur 1: </label>
				<select name='J1' id='J1' onchange='go()'>
					<option value="vide">- - - Choisissez le Joueur 1 - - -</option>
					<?php
						mysql_connect("localhost","root","");
						mysql_select_db("website");
						/*$res = mysql_query("SELECT * FROM membres ");*/
						
						$sql = "SELECT * FROM joueurs";
						$res = mysql_query($sql);

						while($val = mysql_fetch_array($res)) 
						{
							echo "<option>".$val["nom"]."</option>\n";
						}
					?>
			</select>
			
			
			
			
		

			<br/>
			<br/>
			<br/>
			<br/>
			<br/>
           

<!---------------------------------------------------------->	
<?php			
    include('include_pied_page.php');
	include('include_publicite.php');
?>
<!---------------------------------------------------------->	
			</div>  <!-- contenu -->
<!---------------------------------------------------------->	
	</div>   <!-- main -->
<!---------------------------------------------------------->	

	<script type="text/javascript">
		call_update()
	</script>

</body>
</html>
