<?
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();

$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);
$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='foot'>";
echo '<br />';
echo '<a href="info.php?id='.$bday['id'].'">'.$bday['nick'].'</a> <b>Поздравляем!</b><br />
Сегодня стукнуло - <font color="red">'.$bday['ank_age'].'</font><br /> ';
echo '<br />';
echo "</div>\n";

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

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