25 lines
1.0 KiB
PHP
25 lines
1.0 KiB
PHP
<?php
|
|
ini_set( 'display_errors', 0 );
|
|
if ( $_SESSION['dostup']!='a' ) header( 'Location: /login/' );// && $dostup!='m'
|
|
print_r($_POST);
|
|
print_r($_FILES);
|
|
switch( @$_POST['act'] ) {
|
|
/* ----------------------------------------------------------------------
|
|
26.07.2023
|
|
Создаем категорию
|
|
---------------------------------------------------------------------- */
|
|
case 'createNewCategory':
|
|
$_POST['category']=($_POST['category'])?$_POST['category']:0;
|
|
\DB::set("INSERT INTO `bib_category` (`txt`, `category`, `status`) VALUES (?,?, 1)", array($_POST['txt'], $_POST['category']));
|
|
break;
|
|
case 'createNewBook':
|
|
$_POST['category']=($_POST['category'])?$_POST['category']:0;
|
|
\DB::set("INSERT INTO `bib` (`txt`, `category`, `status`) VALUES (?,?, 1)", array($_POST['txt'], $_POST['category']));
|
|
break;
|
|
case 'editBook':
|
|
$_POST['category']=($_POST['category'])?$_POST['category']:0;
|
|
\DB::set("UPDATE `bib` (`txt`, `category`, `status`) VALUES (?,?, 1)", array($_POST['txt'], $_POST['category']));
|
|
break;
|
|
}
|
|
|
|
?>
|