21 lines
485 B
PHP
21 lines
485 B
PHP
<?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:
|
|
}
|