"; echo "
"; function traitement_on_chess_master() { $sql = "SELECT * FROM " .$_SESSION['classement']; //$results = mysql_query("SELECT * FROM classement"); $results = mysql_query($sql); $nb_joueurs = mysql_num_rows($results); //echo $nb_joueurs; //$results2 = mysql_query("SELECT gagnant FROM chessmaster_new"); $sql = "SELECT gagnant FROM " .$_SESSION['chessmaster']; $results2 = mysql_query($sql); while($row = mysql_fetch_assoc($results2)) { $tab_gagnant[] = $row['gagnant']; } //print_r($tab_gagnant); $sans_doublon = array_unique($tab_gagnant); $reindex = array_values($sans_doublon); //print_r($reindex); for ($i=0; $i < count($reindex); $i++) { $cpt = 0; $up = 0; $tab_temp = array(); //echo $reindex[$i]; for ($j=0; $j < count($tab_gagnant); $j++) { $test = strcmp($reindex[$i], $tab_gagnant[$j]); //echo $test; if($test == 0) { $cpt = $cpt + 1; $flag = "master"; $up = $up + 1; } if($test != 0 && $flag == "master") { $tab_temp[] = $up; $up = 0; } if($j == count($tab_gagnant) - 1) { if( $test == 0) { $tab_temp[] = $up; } } } //$tab_temp = array_unique($tab_temp); // supprime les 0 foreach($tab_temp as $array_key=>$array_item) { if($tab_temp[$array_key] == 0) { unset($tab_temp[$array_key]); } } $tab_temp[] = $cpt; $tab_temp[] = $reindex[$i]; $tab_glob[] = array_values($tab_temp); //echo "+++++ " .$cpt ."
"; } return($tab_glob); } ?> Patoche WEBSITE - 2013 - Template du site - en cours de développemment ...
Patoche
"Etre conscient que l'on est ignorant est un grand pas vers le savoir"
'; include("debug_connexion_membre.php"); echo '
'; include("include_menu.php");*/ echo '
'; include("include_menu.php"); echo '
'; include("connexion_membre.php"); echo '
'; echo '
'; include("include_barre_login.php"); echo '
'; echo '
'; $_SESSION['page_active'] = basename (__FILE__ ); ?>




'; echo $master; echo ""; echo "
"; echo "
ON Chess master depuis le $date
"; } echo "

"; echo ""; for ($i=1; $i <= count($resultats); $i++) { $tab = $resultats[$i-1]; $n = count($tab); $joueur = $tab[$n-1]; $efficacite = $tab[$n-2]; $tmp = $tab; array_pop($tmp); array_pop($tmp); $str = implode(" ",$tmp); echo " "; } echo "
ID Joueur Score Longévité
$i $joueur $efficacite $str
"; echo "

"; //$sql = "select * from chessmaster_new ORDER by date desc "; $sql = "SELECT * FROM " .$_SESSION['chessmaster'] ." ORDER by date desc "; $sql = "SELECT * FROM " .$_SESSION['chessmaster'] ." ORDER by date"; $results = mysql_query($sql); $number = mysql_num_rows($results); echo "

Confrontations


"; echo ""; $indice = 1; while($row = mysql_fetch_assoc($results)) { $blanc = $row['blanc']; $noir = $row['noir']; $gagnant = $row['gagnant']; $date = date('d/m/Y', $row['date']); echo " "; $indice = $indice + 1; } echo "
ID Blanc Noir Vainqueur Date
$indice $blanc $noir $gagnant $date
"; mysql_close(); ?>