Файл: birthday.php
Строк: 38
<?php
require 'sid.php';
require 'config.php';
$link = connect_db();
list($user, $id, $ps) = check_login($link);
whorm(0, 'birthday');
include 'head.php';
include 'navigator.php';
echo $div_title . 'Именинники' . $div_end . $div_left;
$num = mysql_query("SELECT DISTINCT friends.who FROM friends WHERE user = '$user[id]' AND zajavka = '1' AND who IN(SELECT id FROM users WHERE birth LIKE '" . date('j.n.') . "%')");
if (mysql_num_rows($num) != FALSE) {
$n = new navigator(mysql_num_rows($num), 10, '?');
$select = mysql_query("SELECT DISTINCT friends.who FROM friends WHERE user = '$user[id]' AND zajavka = '1' AND who IN(SELECT id FROM users WHERE birth LIKE '" . date('j.n.') . "%') ORDER BY `id` ASC {$n->limit}");
$i = 0;
while($a = mysql_fetch_assoc($select)) {
$m = ' <a href="mail.php?do=send&nick='.user_inf($a['who'], 'user').'"><img src="ico/msg.gif" alt=""/></a>';
$p = ' <a href="present.php?nk='.$a['who'].'"><img src="ico/present.gif" alt=""/></a>';
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo nik($a['who']) . $m . $p . $div_end;
}
echo $n->navi();
} else {
echo 'Именинников сегодня нет.<br/>';
}
echo $div_end;
include 'foot.php';
?>