36 lines
1.7 KiB
PHP
Executable File
36 lines
1.7 KiB
PHP
Executable File
<?php
|
|
ini_set('display_errors', 0 );
|
|
//if ( $_SESSION['dostup'] != 'a' && $_SESSION['dostup'] != 'e' && $_SESSION['dostup'] != 'c' ) header( 'Location: /login/' );// && $dostup!='m'
|
|
/* ----------------------------------------------------------------------
|
|
26.07.2023
|
|
Получаем список категорий
|
|
---------------------------------------------------------------------- */
|
|
$parent=($_GET['id'])?$_GET['id']:0;
|
|
|
|
|
|
|
|
$list_cat=\DB::getAll("SELECT `id`, `title` FROM `content_category` WHERE `category`=? AND `status`=? AND `content_type`=? AND `site`=?", array($parent, 1, 'bib', $_SERVER['SERVER_NAME']));
|
|
for ($i=0; $i<count($list_cat);$i++)$list_cat[$i]['img']=\DB::getValue("SELECT `filename` FROM `img` WHERE `content_id`=? AND `content_type`=? LIMIT 1", array($list_cat[$i]['id'], 'bib'));
|
|
$smarty -> assign( 'list_cat', $list_cat);
|
|
|
|
|
|
|
|
|
|
|
|
$bib_category=\DB::getRow("SELECT * FROM `content_category` WHERE `id`=? AND `site`=?", array($_GET['id'], $_SERVER['SERVER_NAME'] ) );
|
|
$bib_category['filename']=\DB::getValue("SELECT `filename` FROM `img` WHERE `content_id`=? AND `content_type`=? AND `site`=?", array(
|
|
$_GET['id'], $_GET['mod'], $_SERVER['SERVER_NAME']
|
|
));
|
|
//print_r($bib_category);
|
|
$smarty -> assign( 'info', $bib_category );
|
|
|
|
|
|
|
|
|
|
|
|
$list_books=\DB::getAll("SELECT * FROM `content` WHERE `category`=? AND `status`=? AND `site`=? AND `content_type`=?", array($parent, 1, $_SERVER['SERVER_NAME'], 'bib'));
|
|
|
|
for ($i=0; $i<count($list_books); $i++){$list_books[$i]['json']=\core::j($list_books[$i]['json']);}
|
|
$smarty -> assign( 'list_books', $list_books );
|
|
$smarty -> assign( 'list', 'api/modules/' . MOD . '/list.html' );
|
|
?>
|