//иначе на эту же страницу возвращаемся } break; case 'del_link': //удаление страницы информера $link_id = (int) $_GET['link_id']; del_link($link_id); redirect(); break; case 'edit_page': //редактирование страницы $page_id = (int) $_GET['page_id']; $get_page = get_page($page_id); if ($_POST) { //проверяем были ли переданы данные из формы if (edit_page($page_id)) { redirect('?view=pages'); } else { redirect(); } //иначе редирект на эту же стр, откуда пришли } break; case 'add_page': if ($_POST) { //проверяем были ли переданы данные из формы if (add_page()) { redirect('?view=pages'); } else { redirect(); }
session_start(); include_once "sqlfuncs.php"; include_once "header.php"; if (!isset($_SESSION['email'])) { header('Location: index.php'); exit; } $myemail = $_SESSION["email"]; if (sql_is_verified($myemail, $_SESSION['type'])) { } else { echo "<h3>Please verify your email</h3>"; return; } if (isset($_POST["edit"])) { $postid = $_POST["edit"]; edit_page($postid); } else { if (isset($_POST["mode"])) { $mode = $_POST["mode"]; if ($mode == "submit") { $post_id = $_POST["postid"]; if (update_post($_POST["postid"], $myemail, $_POST["email"], $_POST["company_name"], $_POST["position"], $_POST["description"], $_POST["job_content"], $_POST['job_type'], $_POST['major'], $_POST['date'], $_POST['url'], $_POST['visa'], $_POST["visit"]) == 1) { if ($_FILES["file"]["error"] > 0) { if ($_FILES["file"]["error"] != 4) { echo "<h2 align=center>Something went wrong... Please try again</h2>"; echo "<h2>Error:" . $_FILES["file"]["error"] . "</h2>"; echo "<h3 align=center><a href='homepage.php' class='btn'>My homepage</a></h3>"; } } if ($_FILES["file"]["name"] != NULL) { $filename = (string) $post_id . "-" . $_FILES["file"]["name"];
} $title = from($_REQUEST, 'title'); $url = from($_REQUEST, 'url'); $content = from($_REQUEST, 'content'); $oldfile = from($_REQUEST, 'oldfile'); $destination = from($_GET, 'destination'); $description = from($_REQUEST, 'description'); if ($destination === null) { $destination = $static . "/" . $sub; } if ($proper && !empty($title) && !empty($content)) { if (!empty($url)) { edit_page($title, $url, $content, $oldfile, $destination, $description, $static); } else { $url = $title; edit_page($title, $url, $content, $oldfile, $destination, $description, $static); } } else { $message['error'] = ''; if (empty($title)) { $message['error'] .= '<li>Title field is required.</li>'; } if (empty($content)) { $message['error'] .= '<li>Content field is required.</li>'; } if (!$proper) { $message['error'] .= '<li>CSRF Token not correct.</li>'; } config('views.root', 'system/admin/views'); render('edit-page', array('title' => 'Edit page - ' . blog_title(), 'description' => blog_description(), 'canonical' => site_url(), 'error' => '<ul>' . $message['error'] . '</ul>', 'oldfile' => $oldfile, 'postTitle' => $title, 'postUrl' => $url, 'postContent' => $content, 'static' => $static, 'sub' => $sub, 'bodyclass' => 'editpage', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> » Edit page')); }
manage_admin_login(); break; case 'edit_user': edit_user(); break; case 'delete_user': delete_user(); break; case 'edit_group': edit_group(); break; case 'delete_group': delete_group(); break; case 'edit_page': edit_page(); break; case 'delete_page': delete_page(); break; } ?> </div> <div class="float-clear"></div> <?php } ?> </div> </div> <div class="footer-wrapper"> <div class="footer-content" align="center">