Файл: public_html/modules/magaz/tovar.php
Строк: 29
<?
if(isset($user)) {
$locate = 'in_magaz';
if($db->query("SELECT * FROM `users` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->rowCount() == 0) {
go('/magaz/');
}
$us = $db->query("SELECT * FROM `users` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->fetch();
$magaz_t = $db->query("SELECT * FROM `magaz_tovar` WHERE `user` = '". abs(intval($_GET['id'])) ."' ")->rowCount();
$title = 'Товары - '.$us['nick'];
require_once(SYS.'/view/header.php');
$tpl->div('title', 'Товары - '.$us['nick']);
$pages = new Paginator($magaz_t, $ames);
if($magaz_t == 0) {
echo $tpl->div('menu', 'Нет товаров');
}
else {
$magaz_tt = $db->query("SELECT * FROM `magaz_tovar` WHERE `user` = '". abs(intval($_GET['id'])) ."' ORDER BY `id` LIMIT $start, $ames");
while($magaz_t = $magaz_tt->fetch()) {
echo '<div class="menu">';
if (!empty($magaz_t['src_1'])) { echo '<img src="/files/magaz/'. $magaz_t['path'] .'/'.$magaz_t['src_1'].'" height="45" width="45" style="float:left;margin: 2px 8px 2px 2px;">';}
else if (empty($magaz_t['src_2'])) { echo '<img src="/files/magaz/'. $magaz_t['path'] .'/'.$magaz_t['src_2'].'" height="45" width="45" style="float:left;margin: 2px 8px 2px 2px;">';}
else if (empty($magaz_t['src_3'])) { echo '<img src="/files/magaz/'. $magaz_t['path'] .'/'.$magaz_t['src_3'].'" height="45" width="45" style="float:left;margin: 2px 8px 2px 2px;">';}
else { echo '<img src="/template/icons/no.png" height="45" width="45" style="float:left;margin: 2px 8px 2px 2px;">';}
echo '<a href="/magaz/file/'. $magaz_t['id'] .'/">'. $magaz_t['name'] .'</a><br/>'. rez_text($magaz_t['text']) .'<br/><font color="green">'. $magaz_t['wmr'] .'руб.</font><br/>'.($magaz_t['pod'] == 0 ? 'На модерации':NULL).'</div>';
}
$pages->view('/magaz/tovar/'. abs(intval($_GET['id'])) .'/?');
}
$tpl->div('block', NAV .'<a href="/magaz/">В магазин</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
?>