<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';

$set['title']='Дни рождения'; // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
aut();



$currD=date("d", time());
$currm=date("m", time());
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm'",$db), 0);
$cases = array('обитателя', 'обитатели', 'обитатель');

if($k_post > 1){
$pr = 'празднуют дни рождения';
$etot = 'В этот день родились:';
}else{
$pr = 'празднует день своего рождения';
$etot = '';
}

?>
<div class='gmenu'>
<center>
<img src='/user/birthdays/img/6.gif' alt='*' class='icon'/><br/>
Сегодня <?= des2num('<font color="green"><b>'.$k_post.'</b></font>', $cases);?>  Lafac.Ru <?= $pr?>  =) <br/>
<img src='/style/smiles/443.gif' alt='Happy'> 
<?= $etot?>
</center>
</div>
<?




$k_page=k_page($k_post,5);
$page=page($k_page);
$start=5*$page-5;
$q_bday=mysql_query("SELECT * FROM `user` WHERE `ank_d_r` = '$currD' and `ank_m_r` = '$currm' LIMIT ".$start.", 5 ");

while ($bday = mysql_fetch_array($q_bday))
{
$bday['ank_age']=date("Y")-$bday['ank_g_r'];
if (date("n")<$bday['ank_m_r'])$bday['ank_age']=$bday['ank_age']-1;
elseif (date("n")==$bday['ank_m_r']&& date("j")<$bday['ank_d_r'])$bday['ank_age']=$bday['ank_age']-1;
echo"<div class='nav1'>";
echo ''.status($bday['id']).' '.group($bday['id']).' '.on_status($bday['id']).' ';

echo '<a href="/info.php?id='.$bday['id'].'">'.$bday['nick'].'</a> '.online($bday['id']).'  ('.$bday['ank_age'].')<br/>';

echo 'Посещение: <font color="green"><small>' . v_vk($bday['date_last']) . '</small></font><br/>';

if ($bday['id'] != $user['id']){
echo "<img src='/style/icons/pod16.gif' alt='' class='icon'/>\n";
echo "<a href='/user/gift/categories.php?id=$bday[id]'>Сделать подарок</a> <br />\n";
}
echo "</div>";
}

if ($k_page>1)str('?all=1&amp;',$k_page,$page);

echo "<div class='main_menu'>\n";
echo "<img src='img/back.gif' alt='*' class='icon'/> \n";
echo "<a href='/'> Назад</a></div>";

include_once '../../sys/inc/tfoot.php';
?>