core/api/modules/page_all/ajax.php

43 lines
1.4 KiB
PHP
Raw Normal View History

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
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:
}
?>