43 lines
1.4 KiB
PHP
Executable File
43 lines
1.4 KiB
PHP
Executable File
<?php
|
|
//проверяем кто мы
|
|
$access=0;
|
|
if ($_SESSION['dostup']=='a')$access=1;
|
|
if ($_SESSION['dostup']=='u')$access=1;
|
|
if ($access==0)die("Нет прав");
|
|
switch(@$_POST['act']) {
|
|
|
|
/* ----------------------------------------------------------------------
|
|
12.12.2022
|
|
Создаем новую категорию
|
|
---------------------------------------------------------------------- */
|
|
|
|
case 'createNewCategory':
|
|
echo \DB::add("INSERT INTO `pages_category` (`title`, `category`, `user_id`) VALUES (?, ?, ?)", array($_POST['title'], $_POST['category'], $_SESSION['user_id']));
|
|
break;
|
|
|
|
/* ----------------------------------------------------------------------
|
|
07.10.2022
|
|
Сохраняем реквизиты категории
|
|
---------------------------------------------------------------------- */
|
|
|
|
case 'changeCategory':
|
|
$status = ($_POST['status'] == 'on' ) ? 1 : 0;
|
|
\DB::set("UPDATE `pages_category` SET `title`=?, `keywords`=?, `description`=?, `status`=?, `category`=? WHERE `id` = ?", array($_POST['title'], $_POST['keywords'], $_POST['description'], $status, $_POST['category'], $_POST['id']));
|
|
break;
|
|
|
|
case 'update_img': // Обновление обложки
|
|
|
|
|
|
break;
|
|
|
|
case 'del_page':
|
|
unset($_POST['act']);
|
|
$db->del_id('pages', $_POST['id']);
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
}
|
|
?>
|