core/api/modules/page_cat/ajax.php

21 lines
485 B
PHP
Raw Permalink Normal View History

2022-12-11 13:55:49 +05:00
<?php
if ($_SESSION['dostup'] !='a' && $_SESSION['dostup'] !='e')die('Кыш');
switch(@$_POST['act']) {
case 'del_cat':
$db->del_id ( 'pages', $_POST['id'] );
break;
case 'del_img':
unset( $a );
$a['id'] = $_POST['id'];
$img = $db -> get_val( 'pages', $a, 'img' );
unlink(MYDIR . '/img/pages_cat/' . $img . '.jpg');
$db->free_sql('UPDATE `pages` SET `img` = NULL WHERE `id` = ' . $_POST['id'] . ';');
echo 1;
break;
default:
}