<?php
include("../config.php3");
include($BIB."bib_generic.php3");
include($BIB."bib_constants.php3");
include($BIB."bib_niveau.php3");

##################################
# Administration script defaults #
##################################

# pas de timeout possible quelle que soit l'action effectuée
set_time_limit($TIME_LIMIT);

# le script continue une fois qu'il est lancé,
# quel que soit l'état de la connection après
ignore_user_abort(true); 


$players = main_db_query("SELECT Id, NickName FROM Players WHERE Score>100 ORDER By KF DESC");
$date = date("Y-m-d H:i:s", my_local_time());
$i = 1;
while ($player = db_fetch_array($players))
{
	$niveau = get_niveau($player['Id']);
	echo $i.$player['NickName']." : ".$niveau."<br>";
	main_db_query("UPDATE Players Set Niveau='".$niveau."' WHERE Id='".$player['Id']."'");
	flush();
	$i++;
}
echo "<br>Fin<br>";