Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Make sure we track state
- session_start();
- // Get the db
- include("../db.php");
- if (isset($_POST['title'])) {
- if (isset($_GET['update'])) {
- $sql = 'update content ' .
- 'set content_title="' . $_POST['title'] . '", ' .
- 'content_subtitle="' . $_POST['subtitle'] . '", ' .
- 'content_icon="' . $_POST['icon'] . '", ' .
- 'content_image="' . $_POST['image'] . '", ' .
- 'content_teaser="' . $_POST['teaser'] . '", ' .
- 'category_id="' . $_POST['category'] . '", ' .
- 'content_body = "' . preg_replace('/"/', '\"', $_POST['body']) . '" ' .
- 'where content_id = ' . $_GET['update'];
- }
- else {
- $sql = 'insert into content ' .
- 'set content_title="' . $_POST['title'] . '", ' .
- 'content_subtitle="' . $_POST['subtitle'] . '", ' .
- 'content_icon="' . $_POST['icon'] . '", ' .
- 'content_image="' . $_POST['image'] . '", ' .
- 'content_teaser="' . $_POST['teaser'] . '", ' .
- 'category_id="' . $_POST['category'] . '", ' .
- 'content_body = "' . preg_replace('/"/', '\"', $_POST['body']) . '"';
- }
- mysql_query($sql);
- }
- if (isset($_GET['delete'])){
- $sql = 'delete from content where content_id = "' . $_GET['id'] . '"';
- mysql_query($sql);
- }
- #syslog(LOG_INFO, 'Admin index page called.');
- // Ensure auth
- include("auth.php");
- ?><!DOCTYPE html>
- <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
- <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
- <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
- <head>
- <!-- BASICS -->
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>LAMPSecLabs</title>
- <meta name="description" content="Amoeba free one page responsive bootstrap site template">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="../css/isotope.css" media="screen" />
- <link rel="stylesheet" href="../js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../css/bootstrap.css">
- <link rel="stylesheet" href="../css/bootstrap-theme.css">
- <link rel="stylesheet" href="../css/style.css">
- <!-- skin -->
- <link rel="stylesheet" href="skin/default.css">
- </head>
- <body>
- <section id="header" class="appear"></section>
- <?php include_once("inc/navbar.php");?>
- <!-- services -->
- <section id="section-services" class="section pad-bot30 bg-white">
- <div class="container">
- <div class="row mar-bot40">
- <div class="col-lg-4" >
- <div class="align-center">
- <i class="fa fa-code fa-5x mar-bot20"></i>
- <h4 class="text-bold">Content</h4>
- <p><!-- Content area -->
- <div id="content" style="text-align: left">
- <a href="add_edit.php">Add new content</a>
- <ol>
- <?php
- $result = mysql_query('select * from content');
- while($row = mysql_fetch_assoc($result)) {
- print '<li><a href="add_edit.php?id=' . $row['content_id'] . '">' . $row['content_title'] . '</a>';
- print ' [<a href="index.php?id=' . $row['content_id'] . '&delete=yes">del</a>]';
- print '</li>';
- }
- ?>
- </ol>
- </div>
- </p>
- </div>
- </div>
- <div class="col-lg-4" >
- <div class="align-center">
- <i class="fa fa-gears fa-5x mar-bot20"></i>
- <h4 class="text-bold">Configuration</h4>
- <p>
- <a href="logs.php">Review access logs</a>
- </p>
- </div>
- </div>
- <div class="col-lg-4" >
- <div class="align-center">
- <i class="fa fa-user fa-5x mar-bot20"></i>
- <h4 class="text-bold">Users</h4>
- <p>
- <a href="users.php">Users</a>
- </p>
- </div>
- </div>
- </div>
- </div>
- </section>
- <?php include('inc/footer.php');?>
- <?php mysql_close($conn);?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement