core/api/modules/a_bib_edit/ajax.php

25 lines
1.0 KiB
PHP
Raw Normal View History

2023-08-14 09:15:58 +05:00
<?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;
}
?>