59 lines
2.4 KiB
PHP
Executable File
59 lines
2.4 KiB
PHP
Executable File
<?php
|
||
ini_set( 'display_errors', 0 );
|
||
$_SESSION[ 'id' ] = $_GET[ 'id' ];
|
||
if ( $_SESSION[ 'dostup' ] !== 'a' && $_SESSION[ 'dostup' ] !== 'u' ) header( 'Location: /login/' );
|
||
|
||
class modClass
|
||
{
|
||
public static $catID = 0;
|
||
// int
|
||
/* ----------------------------------------------------------------------
|
||
28.11.2024
|
||
Получаем список категорий
|
||
---------------------------------------------------------------------- */
|
||
static function getListPages( $id = 0 ) {
|
||
if ( $_SESSION[ 'dostup' ] == 'a' )
|
||
return DB::getAll( 'SELECT `id`, `title` FROM `content` WHERE `content_type`=? AND `status`=? AND `content_category`=? ORDER BY `title`', [ 7, 1, $id ] );
|
||
else
|
||
return DB::getAll( 'SELECT `id`, `title` FROM `content` WHERE `content_type`=? AND `status`=? AND `content_category`=? AND `user`=? ORDER BY `title`', [ 7, 1, $id, $_SESSION[ 'user_id' ] ] );
|
||
}
|
||
/* ----------------------------------------------------------------------
|
||
28.11.2024
|
||
Получаем список ВСЕХ категорий
|
||
---------------------------------------------------------------------- */
|
||
static function getAllListPages() {
|
||
if ( $_SESSION[ 'dostup' ] == 'a' )
|
||
return DB::getAll( 'SELECT `id`, `title` FROM `content` WHERE `content_type`=? AND `status`=? ORDER BY `title`', [ 7, 1 ] );
|
||
else
|
||
return DB::getAll( 'SELECT `id`, `title` FROM `content` WHERE `content_type`=? AND `status`=? AND `user`=? ORDER BY `title`', [ 7, 1, $_SESSION[ 'user_id' ] ] );
|
||
}
|
||
/* ----------------------------------------------------------------------
|
||
28.11.2024
|
||
Получаем Информацию о текущей категории
|
||
---------------------------------------------------------------------- */
|
||
static function getCategoryInfo()
|
||
{
|
||
$res = DB::getRow( 'SELECT * FROM `content` WHERE `content_type`=? AND `id`=? LIMIT 1', [ 7, $_GET[ 'id' ] ] );
|
||
$res[ 'json' ] = core::j( $res[ 'json' ] );
|
||
return $res;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
$code = file_get_contents('skin/footer.html');
|
||
$smarty->assign( 'codeFooter', $code );
|
||
|
||
$code = file_get_contents('skin/header.html');
|
||
$smarty->assign( 'codeHeader', $code );
|
||
|
||
$code = file_get_contents('skin/js/js.js');
|
||
$smarty->assign( 'codeJs', $code );
|
||
|
||
$code = file_get_contents('skin/css/css.css');
|
||
$smarty->assign( 'codeCss', $code );
|
||
|
||
|
||
|
||
?>
|