<?php

	$title = 'История';

	include_once './protected/sys.php';




$queryLiders  = $db->rows("SELECT SUM( uron ) , `user_id`  FROM  `aluko_log`
                             GROUP BY  `user_id`
                             ORDER BY  SUM( uron ) DESC LIMIT 100");


$alPos = 0;
while ($liders = $db->fetchAll($queryLiders))
{
   $alPos++;
    $row = $db->fetch("SELECT * FROM `users` 
                                        WHERE `id`='".$liders['user_id']."'");
    $damageUs = $db->rows("SELECT SUM( uron ) , `user_id`  
                            FROM  `aluko_log`
                            WHERE `user_id`='".$liders['user_id']."'");
    
    ?>  
    

<div class ='menu'/>
    
    <a class="mbtn mb2" href='/view_profile/<?=$row['id']?>/'><?=$alPos;?>.
    <?=$row['login'];?> Урон: 
    <?=$damageUs;?> 
    </a>
    </div>
    <div class ='dl'/></div>
</div></div></div></div></div></div></div></div></div></div></div></div>
    <?
}

	
	require_once $config['root'] .'/protected/footermain.php';

?>