Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Include the required files
- include('dbConfig.php');
- if (isset($_POST['edit']))
- {
- $id = $_POST['edit'];
- $image1 = $_POST['image'];
- $url1 = $_POST['url'];
- mysql_query("UPDATE advertisements SET image = '" . $image1 . "' AND url = '" . $url1 . "' WHERE id = '" . $id . "' LIMIT 1");
- //echo("Updated! Your advertisement has been put in the queue for processing. Please allow 12-48 hours!");
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="">
- <meta name="author" content="">
- <link rel="shortcut icon" href="./docs-assets/ico/favicon.png">
- <title>Advertisement management panel</title>
- <!-- Bootstrap core CSS -->
- <link href="./dist/css/bootstrap.css" rel="stylesheet">
- <!-- Custom styles for this template -->
- <link href="./dist/sticky-footer-navbar.css" rel="stylesheet">
- <!-- Just for debugging purposes. Don't actually copy this line! -->
- <!--[if lt IE 9]><script src="./docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <!-- Wrap all page content here -->
- <div id="wrap">
- <!-- Fixed navbar -->
- <div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#"><?php echo('Username'); ?></a>
- </div>
- <div class="collapse navbar-collapse">
- <ul class="nav navbar-nav">
- <li class="active"><a href="main.php">Home</a></li>
- <li><a href="contact.php">Contact</a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Management <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="edit.php">Edit slots</a></li>
- <li><a href="buy.php">Purchase slots</a></li>
- <li><a href="rules.html">Rules</a></li>
- <li class="divider"></li>
- <li class="dropdown-header">Account</li>
- <li><a href="acc-d.php">Details</a></li>
- <li><a href="acc-s.php">Settings</a></li>
- </ul>
- </li>
- </ul>
- </div><!--/.nav-collapse -->
- </div>
- </div>
- <!-- Begin page content -->
- <div class="container">
- <div class="page-header">
- <h1>Manage advertisements</h1>
- </div>
- <p class="lead">
- You have <b>2</b> advertisement slots.<br /><br />
- <!-- Edit advertisement(s) -->
- <table class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th>ID</th>
- <th>Advertisement image URL</th>
- <th>Advertisement URL</th>
- <th>Section</th>
- <th>Enabled</th>
- <th>Save</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <?php
- $getItems = mysql_query("SELECT * FROM ads WHERE owner = 'Usern' ORDER BY id ASC");
- while ($item = mysql_fetch_assoc($getItems))
- {
- echo'
- <form method="post">
- <input type="hidden" name="edit" value="' . $item['id'] . '">
- <td>' . $item['id'] . '</td>
- <td><input type="text" name="image" class="form-control" value="' . $item['image'] . '" placeholder="http://" required autofocus></td>
- <td><input type="text" name="url" class="form-control" value="' . $item['url'] . '" placeholder="http://website.com" required autofocus></td>
- <td>' . $item['section'] . '</td>
- <td><font color="green"><b>YES</b></font></td>
- <td><button class="btn btn-lg btn-primary btn-block" type="submit">Save</button></td>
- </form></tr>';
- }
- ?>
- </tbody>
- </table>
- </p>
- </div>
- </div>
- <div id="footer">
- <div class="container">
- <p class="text-muted credit">Script coded by <a href="http://static.obbo.in/advert_manager">Obbo.IN</a> | Version 1.0</p>
- </div>
- </div>
- <!-- Bootstrap core JavaScript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
- <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
- <script src="./dist/js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment