<?
echo '<div class="infoblock">Лучшая девушка</a> ';
echo "</div>";

echo '<table cellpadding="0" cellspacing="0">'; 
echo '<tbody>'; 
echo '<tr> ';
echo '<td valign="top"> ';
    $pol1=mysql_query("SELECT * FROM `user` WHERE `pol`  = '0' ORDER BY `rating` DESC LIMIT 1");
while ($post = mysql_fetch_array($pol1))
{ 
avatar($post['id']);
    
    echo '</a> ';
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]</span></a>,";
    
	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 ' </span> ';
echo '</td> ';
echo '</tr> ';
echo '</tbody> ';
echo '</table>';    


echo '<div class="infoblock">Лучший парень</a> ';
echo "</div>";

echo '<table cellpadding="0" cellspacing="0">'; 
echo '<tbody>'; 
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))
{ 
avatar($post['id']);
    
    echo '</a> ';
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]</span></a>,";
    
	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 ' </span> ';
echo '</td> ';
echo '</tr> ';
echo '</tbody> ';
echo '</table>';    
?>