<?php
 //Alibi89 6.03.2018
define('_IN_JOHNCMS', 1);
$textl = 'Reyting';
$rootpath = '../../';
require_once ('../../incfiles/core.php');
require_once ('../../incfiles/head.php');
?>
<div class="phdr" align="center">O'yinchilar reytingi</div>
<table class="table"  width="100%" border="0" cellspacing="1" cellpadding="4">
    
    <tr height="200%" class="un_title">
        
            <td width="2%"  align="center">№</td>
            
            <td width="20%" align="center">Ishtirokchilar</td>
            <td width="5%" align="center">O`</td>
            <td width="5%" align="center">Y</td>
            <td width="5%" align="center">D</td>
            <td width="5%" align="center">M</td>
           
    </tr>  

<?php
$i = 1;
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `knb_users`"), 0);
$sql = mysql_query("select * from `knb_users` order by `win` DESC LIMIT $start, $kmess");
while ($res = mysql_fetch_assoc($sql))
{
    echo $i % 2 ? '<tr class="list2">' : '<tr class="list1">';
    echo '<td align="center">'.$i.'</td>';
    echo '<td width="20%" align="center"><a href="history.php?id='.$res['user_id'].'">'.$res['name'].'</a></td>';
    echo '<td width="5%" align="center">'.$res['games'].'</td>';
    echo '<td width="5%" align="center">'.$res['win'].'</td>';
    echo '<td width="5%" align="center">'.$res['draw'].'</td>';
    echo '<td width="5%" align="center">'.$res['loss'].'</td>';
    echo '</tr>';
    $i++;
}
echo '</table>';

if ($total > $kmess) {
            echo '<div class="topmenu">' . functions::display_pagination('rating.php?', $start, $total, $kmess) . '</div>';
        }
        
require_once ('../../incfiles/end.php');