<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("inclydings/sesi.php");
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
$_title = 'Самые богатые';
include 'inclydings/zag.php';
include 'inclydings/ini.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("MySql/base123/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////

if (isset($user)) {
include("inclydings/who.php");
$dir = opendir ("L2dbnam/esql2db/reg");
echo "<b>Самые богатые по Всходам Зерна</b><br/><br/>";

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

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


$dat_log[]=$data[0];
$dat_gold[]=$data[89];
}


arsort($dat_gold);


foreach($dat_gold as $k=>$v)
{$uz=$dat_log[$k];

$usersum="0";
$lines=file("L2dbnam/esql2db/bankiss.dat.dat");
$county=count($lines);
for ($b=0; $b<$county; $b++) {
$dty=explode("|",$lines[$b]); if ($dty[1]==$uz) {$usersum=$dty[2];}}

$ob_summa=$v+$usersum;

$dat_log3[]=$dat_log[$k];
$dat_bank3[]=$usersum;
$dat_gold3[]=$v+$usersum;
}
arsort($dat_gold3);

foreach($dat_gold3 as $k2=>$v2)
{
$ruki=$v2-$dat_bank3[$k2];

$dat_ball2[]='<a href="search.php?nick='.$dat_log3[$k2].'&'.$sd.'&go=go">'.$dat_log3[$k2].'</a><br/>Всходов: '.$ruki.' <br/>';


}



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



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

include_once"inclydings/down.php";
?>