switch ($action) { case 'doedit': case 'edit': $success = false; if ($action == 'doedit') { $success = $releases->updateMulti($_POST["id"], $_POST["category"], $_POST["grabs"], $_POST["videosid"], $_POST["episodesid"], $_POST["anidbid"], $_POST['imdbid']); } $page->smarty->assign('release', $rel); $page->smarty->assign('success', $success); $page->smarty->assign('from', isset($_POST['from']) ? $_POST['from'] : ''); $page->smarty->assign('catlist', $category->getForSelect(false)); $page->content = $page->smarty->fetch('ajax_release-edit.tpl'); echo $page->content; break; case 'dodelete': $is_guid = true; if (is_array($_GET['id'])) { if (is_numeric($_GET['id'][0])) { $is_guid = false; } } else { if (is_numeric($_GET['id'])) { $is_guid = false; } } $releases->deleteMultiple($_GET['id'], $is_guid); break; default: $page->show404(); break; }
$success = false; if ($action == 'doedit') { $upd = $releases->updatemulti($_REQUEST["id"], $_REQUEST["category"], $_REQUEST["grabs"], $_REQUEST["rageid"], $_REQUEST["season"], $_REQUEST['imdbid']); if ($upd !== false) { $success = true; } else { } } $page->smarty->assign('success', $success); $page->smarty->assign('from', isset($_REQUEST['from']) ? $_REQUEST['from'] : ''); $page->smarty->assign('catlist', $category->getForSelect()); $page->content = $page->smarty->fetch('ajax_release-edit.tpl'); echo $page->content; break; case 'dodelete': $is_guid = true; if (is_array($_GET['id'])) { if (is_numeric($_GET['id'][0])) { $is_guid = false; } } else { if (is_numeric($_GET['id'])) { $is_guid = false; } } $releases->deleteMultiple($_REQUEST['id'], $is_guid); break; default: $page->show404(); break; }
<?php require_once './config.php'; use nzedb\Releases; $page = new AdminPage(true); if (isset($_GET['id'])) { $releases = new Releases(['Settings' => $page->settings]); $releases->deleteMultiple($_GET['id']); } if (isset($_GET['from'])) { $referrer = $_GET['from']; } else { $referrer = $_SERVER['HTTP_REFERER']; } header("Location: " . $referrer);