<?
echo '<div class="str">Лидер девушек';
echo "</div><div class='menu'>";
echo '<table>'; 

$pol1=mysql_query("SELECT * FROM `user` WHERE `pol`  = '0' ORDER BY `rating` DESC LIMIT 1");
while ($post = mysql_fetch_array($pol1))
{ 
echo '<td valign="syr">';
avatar2($post['id']);
echo '<br />';
echo '<td valign="top" style="padding-left:4px;"> ';   
    echo "".online($post['id'])."\n";
    echo "<span class='small minor'><a href='/info.php?id=$post[id]'>$post[nick]</a></span><br />";
    
 if ($post['ank_d_r']!=NULL && $post['ank_m_r']!=NULL && $post['ank_g_r']!=NULL){
$post['ank_age']=date("Y")-$post['ank_g_r'];
if (date("n")<$post['ank_m_r'])$post['ank_age']=$post['ank_age']-1;
elseif (date("n")==$post['ank_m_r']&& date("j")<$post['ank_d_r'])$post['ank_age']=$post['ank_age']-1;
echo " $post[ank_age]\n";
}
echo "<br/><span class='small minor'>Рейт: $post[rating]</span><br />"; 
 }      
echo '<br />';
echo '</tr>';
echo '</table></div>';  
  
echo '<div class="str">Лидер парней';
echo "</div><div class='menu'>";
echo '<table>'; 
echo '<tr>';
echo '<td valign="top"> ';
    $pol1=mysql_query("SELECT * FROM `user` WHERE `pol` = '1' ORDER BY `rating` DESC LIMIT 1");
while ($post = mysql_fetch_array($pol1))
{ 
avatar2($post['id']);
    

echo '</td>';
echo '<td valign="top" style="padding-left:4px;"> ';   
    echo "".online($post['id'])."\n";
    echo "<span class='small minor'><a href='/info.php?id=$post[id]'>$post[nick]</a></span>";
    
 if ($post['ank_d_r']!=NULL && $post['ank_m_r']!=NULL && $post['ank_g_r']!=NULL){
$post['ank_age']=date("Y")-$post['ank_g_r'];
if (date("n")<$post['ank_m_r'])$post['ank_age']=$post['ank_age']-1;
elseif (date("n")==$post['ank_m_r']&& date("j")<$post['ank_d_r'])$post['ank_age']=$post['ank_age']-1;
echo " $post[ank_age]\n";
}
echo "<br/><span class='small minor'>Рейт: $post[rating]</span>"; 
 }      
    


echo '</tr> ';

echo '</table></div>';    
?>