Файл: 4mast/profmas.ru/modules/smile.php
Строк: 19
<?
require_once('../includes/Headers.php');
require_once('../includes/PDO_func.php');
if($us['id'] == false){
header('location: /login/auth');
exit;
}
if (!isset ($_GET['id'])) {
header ('location: /');
exit;
}
$query = DB :: $dbs -> query ("SELECT * FROM `smiles_r` WHERE (`id`=?)", array (intval ($_GET['id'])));
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$r = $query -> fetch ();
H ('Смайлы', '<a href="/modules/smiles_r.php" style="color:white;">Категории</a> | ' . $r['name']);
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `smile` WHERE (`id_r`='" . $r['id'] . "')") != 0) {
$query = DB :: $dbs -> query ("SELECT * FROM `smile` WHERE (`id_r`='" . $r['id'] . "') ORDER BY `id`");
while ($smile = $query -> fetch ()) {
echo '<div class="lst">';
echo $smile['name'] . ' -> <img src="/images/smile/' . $smile['filename'] . '" alt="' . $smile['name'] . '"/>';
echo '</div>';
}
}
else {
echo '<div class="error">Смайлов нет!</div>';
}
require_once('../includes/Footers.php');
?>