assign( 'all_cat', $all_cat ); if ($_POST){ $massiv['fileBook']=\core::genpassword(30); $massiv['format']=$_POST['format']; $massiv['lang']=$_POST['lang']; $massiv['link']=$_POST['link']; $massiv['isbn']=$_POST['isbn']; $massiv['comments']=($_POST['comments']=='on')?1:0; $massiv['god']=$_POST['god']; $massiv['keywords']=$_POST['keywords']; $massiv['description']=$_POST['description']; $massiv['avtor']=$_POST['avtor']; $status = ($_POST['status']=='on')?1:0; \core::run("php " . $_SERVER['DOCUMENT_ROOT'] . "/api/modules/a_bib_edit/c.php " . $massiv['fileBook'] . " " . $_POST['link'] . " " . $_SERVER['DOCUMENT_ROOT']. '/files/' . $_SERVER['SERVER_NAME'] ); $json=\json::to_j($massiv); if ($_GET['id']){ \DB::set("UPDATE `content` SET `title`=?, `txt`=?, `status`=?, `category`=?, `site`=?, `json`=?, `content_type`=?, `time`=?, `user_id`=?, `description`=?, `keywords`=? WHERE `id`=?", array( $_POST['title'], $_POST['txt'], $status, $_POST['category'], $_SERVER['SERVER_NAME'], $json, 'bib', time(), $_SESSION['user_id'], $_POST['description'], $_POST['keywords'], $_GET['id'] )); }else{ $id=\DB::add("INSERT INTO `content` (`title`, `txt`, `status`, `category`, `site`, `json`, `content_type`, `time`, `user_id`, `description`, `keywords`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )", array( $_POST['title'], $_POST['txt'], $status, $_POST['category'], $_SERVER['SERVER_NAME'], $json, 'bib', time(), $_SESSION['user_id'], $_POST['description'], $_POST['keywords'] )); header( 'Location: /a_bib_edit/' . $id ); } } $content=\core::getContent($_GET['id'], 'bib'); $smarty->assign('book', $content['row']); $smarty->assign('json', $content['json']); ?>