<?php
require_once('classes/body.class.php');
require_once('classes/db.class.php');
require_once('classes/system.class.php');
$title= new Body;
$title->SetTitle(homeurl.' - Именинники');
$title->GetHeader();

//echo'<div class="row"><div class="col-sm-6">';
echo'<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: Именинники</div></div>';
echo'<div class="t-body"><div class="list-group lg-alt">';


$look = DB::$dbs->querySingle("SELECT COUNT(id) FROM blogger WHERE birthday LIKE '". date('d.m.') ."%'");
if ($look == 0) { err('Именинников сегодня нет!'); }
$num = 10;
$k_page = k_page($look, $num);
$page = page($k_page);
$start = $num*$page-$num;
$sql = DB::$dbs->query("SELECT * FROM blogger WHERE birthday LIKE '". date('d.m.') ."%' ORDER BY id DESC LIMIT $start,$num");
$i = 0;
 echo'<div class="tile-body">
                                <div class="count-box bg-blue">
                                    <div class="row text-center">

<a href="/peoples"style="text-decoration:none; color:white;"><div class="col-sm-3 col-xs-6"><div class="cb-item"><small>Пользователи</small></div></div></a>
<a href="/last"style="text-decoration:none; color:white;"><div class="col-sm-3 col-xs-6"><div class="cb-item"><small>Посетили</small></div></div></a>
<a href="/search"style="text-decoration:none; color:white;"><div class="col-sm-3 col-xs-6"><div class="cb-item"><small>Поиск</small></div></div></a>
<a href="/birth"style="text-decoration:none; color:white;"><div class="col-sm-3 col-xs-6"><div class="cb-item"><small>Именинники</small></div></div></a>

                       </div></div><div class="rounded-thumbs"><div class="row">';
while($a = $sql->fetch()) {
$i++;
echo'<a class="col-xs-3 col-sm-2" href="/users/'.$a['id'].'">';
if (!empty($a['ava'])) {echo'<img class="img-avatar" src="/' . $a['ava'] . '" width="45" height="45">';} else {echo'<img class="img-avatar" src="/assets/img/4.jpg"  width="45" height="45">';}
                 echo'</br><small>'.$a[ 'nick' ].' ('.calc_age($a['birthday']).')</small></br></br></a>';
}
echo'</div></div></div></div>';
if ($k_page > 1) {
str('?',$k_page,$page);
}
$title->GetMenu();
$title->GetFooter();
?>
