2025-06-16 18:28:08 +05:00

27 lines
1.5 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
Получаем список категорий
---------------------------------------------------------------------- */
$smarty -> assign( 'list', 'api/modules/' . MOD . '/list.html' );
$massiv=\core::getContentCategory('bib', 0, 30, $_GET['id']);
$smarty -> assign( 'list_cat', $massiv );
$smarty -> assign( 'all_cats', \DB::getAll( "SELECT `id`, `title` FROM `content_category` WHERE `content_type`=? AND `status`=?", array('bib', 1)) );
$_GET['id']=($_GET['id'])?$_GET['id']:0;
$smarty -> assign( 'info', \DB::getRow( "SELECT `title`, `category` FROM `content_category` WHERE `id`=? AND `site`=?", array($_GET['id'], $_SERVER['SERVER_NAME'])) );
/* ----------------------------------------------------------------------
18.11.2023
Получаем список книг
---------------------------------------------------------------------- */
$books = \DB::getAll( 'SELECT `id`, `title`, `json`, `status` FROM `content` WHERE `category`=? AND `site`=?', array($_GET['id'], $_SERVER['SERVER_NAME']));
for ($i=0; $i<count($books); $i++)$books[$i]['json']=\json::from_j($books[$i]['json']);
$smarty -> assign( 'books', $books);
//print_r($massiv);
$_SESSION['id']=($_GET['id']>0)?$_GET['id']:'';
?>