2022-12-11 13:55:49 +05:00
|
|
|
|
<?php
|
|
|
|
|
//проверяем кто мы
|
|
|
|
|
$access=0;
|
|
|
|
|
if ($_SESSION['dostup']=='a')$access=1;
|
|
|
|
|
if ($_SESSION['dostup']=='u')$access=1;
|
|
|
|
|
if ($access==0)die("Нет прав");
|
|
|
|
|
switch(@$_POST['act']) {
|
2022-12-17 18:15:09 +05:00
|
|
|
|
|
2023-04-09 19:52:26 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
02.04.2023
|
|
|
|
|
Удаляем страницу
|
|
|
|
|
+++ сделать удаление изображений
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
case 'deletePage':
|
|
|
|
|
\DB::set( "DELETE FROM `pages_comments` WHERE `page_id`=? LIMIT 1", $_POST['id'] );
|
|
|
|
|
\DB::set( "DELETE FROM `pages_img` WHERE `pages_id`=? LIMIT 1", $_POST['id'] );
|
|
|
|
|
\DB::set( "DELETE FROM `pages` WHERE `id`=? LIMIT 1", $_POST['id'] );
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
02.04.2023
|
|
|
|
|
Удаляем категорию
|
|
|
|
|
и убираем с публикации содержимое
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
case 'deleteCategory':
|
|
|
|
|
\DB::set( "DELETE FROM `pages_category` WHERE `id`=? LIMIT 1", $_POST['id'] );
|
|
|
|
|
\DB::set( "UPDATE `pages` SET `status`=0 WHERE `category`=? LIMIT 1", $_POST['id'] );
|
|
|
|
|
break;
|
|
|
|
|
|
2022-12-11 13:55:49 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
2022-12-17 18:15:09 +05:00
|
|
|
|
12.12.2022
|
|
|
|
|
Создаем новую категорию
|
2022-12-11 13:55:49 +05:00
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
|
2022-12-17 18:15:09 +05:00
|
|
|
|
case 'createNewCategory':
|
|
|
|
|
echo \DB::add("INSERT INTO `pages_category` (`title`, `category`, `user_id`) VALUES (?, ?, ?)", array($_POST['title'], $_POST['category'], $_SESSION['user_id']));
|
2022-12-11 13:55:49 +05:00
|
|
|
|
break;
|
|
|
|
|
|
2022-12-17 18:15:09 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
07.10.2022
|
|
|
|
|
Сохраняем реквизиты категории
|
|
|
|
|
---------------------------------------------------------------------- */
|
2022-12-11 13:55:49 +05:00
|
|
|
|
|
2022-12-17 18:15:09 +05:00
|
|
|
|
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']));
|
2022-12-11 13:55:49 +05:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'update_img': // Обновление обложки
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'del_page':
|
|
|
|
|
unset($_POST['act']);
|
|
|
|
|
$db->del_id('pages', $_POST['id']);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
?>
|