<?
include 'mysql.php';
Error_Reporting(0);

list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
$_title = 'Lineage2';
include 'inclydings/header.php';
include 'inclydings/ini.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("L2dbnam/esql2db/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
include_once("inclydings/sesi.php");
if (isset($user)) {

$dir = opendir ("L2dbnam/esql2db/rating/olimpiads");
echo "<b>Герои</b><br/><br/>";

$dir = opendir ("L2dbnam/esql2db/rating/olimpiads");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

if($total!=="0"){

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/rating/olimpiads/$a[$i]");
$data = explode("||",$tex[0]);


$dat_log[]=$data[0];
$dat_kol[]=$data[1];
}


@arsort($dat_kol);



foreach($dat_kol as $k=>$v)
{

$dat_screen[]='<a href="search.php?nick='.$dat_log[$k].'&'.$sd.'&go=go">'.$dat_log[$k].'</a><br/>Собрал медалей: '.$dat_kol[$k].'<br/>';


}



if($total<"10"){
$list=$total;}else{$list="10";}

for ($i = 0; $i < $list; $i++){
$i2=$i+1;
echo "$i2. $dat_screen[$i]";
}

echo"<br/>Всего героев: $total";

}else{echo"Героев нет.";}

}else{echo"Пароль или ник неверен. Возможно сессия устарела. Попробуйте авторизироваться заново.";}

include_once"inclydings/down.php";
?>

