Файл: list_bday.php
Строк: 52
<?
include_once 'connect.php';
$title = $title.' : Именниники';
include_once 'head.php';
echo"<div class='div'><center><img src='/ico/happy_user.gif' alt='' class='icon'/><br/><b>Сегодня можно поздравить с днем рождения:</b></center></div>n";
$currD=date("d", time());
$currm=date("m", time());
$all2222 = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `anketa_bday` = '$currD' and `anketa_bmonth` = '$currm'",$db), 0);
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `anketa_bday` = '$currD' and `anketa_bmonth` = '$currm'",$db), 0);
#if($all > 0){
$total = num(($all - 1) / 10) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * 10 - 10;
$q_bday=mysql_query("SELECT * FROM `users` WHERE `anketa_bday` = '$currD' and `anketa_bmonth` = '$currm' LIMIT ".$start.", 5 ");
while ($bday = mysql_fetch_array($q_bday))
{
$bday['ank_age']=date("Y")-$bday['anketa_byear'];
if (date("n")<$bday['anketa_bmonth'])$bday['ank_age']=$bday['ank_age']-1;
elseif (date("n")==$bday['anketa_bmonth']&& date("j")<$bday['anketa_bday'])$bday['ank_age']=$bday['ank_age']-1;
echo"<div class='div'>";
echo"<img src='/style/icons/pod16.gif' alt='' class='icon'/>n";
echo' <a href="/page.php?id='.$bday['id'].'"><span style="color:$bday[ncolor]">'.$bday['login'].'</span></a> ('.$bday['ank_age'].')<br/>';
echo "<img src='/style/icons/14.png' alt='' class='icon'/>n";
echo'<a href="gifts.php?iduser='.$bday['id'].'">Сделать подарок</a> <br />';
echo"</div>";
}
if ($k_page>1)str('list_bday.php?all=1&',$k_page,$page);
# }else{
# error('День рождение не у кого не наступил! :(');
# }
include_once 'foot.php';
?>