survey_seahorse

Software Engineering Project - Fall 2018
Log | Files | Refs | README

controlpanel.php (1786B)


      1 <?php
      2 include_once 'res/session.php';
      3 include_once 'config.php';
      4 
      5 if (!isset($_SESSION['admin'])) {
      6     header("Location: res/nope.php");
      7     exit();
      8 } else {
      9     $user = $_SESSION['username'];
     10     include 'res/navbar.php';
     11 
     12     echo "<p> Hello, ", $user, " what would you like to do? <br>";
     13 }
     14 ?>
     15 
     16 <link rel="stylesheet" href="res/style.css">
     17 
     18 <div class="cpanel">
     19     <form class="block-form" action="res/block.php" method="POST">
     20         <input type='text' name='username' placeholder='User Name'> <br>
     21         <button type='submit' name='revoke-creation' > Revoke Survey Creation </button>
     22         <button type='submit' name='revoke-access' > Revoke All Survey Access </button>
     23         <button type='submit' name='ban' > Ban User </button>
     24         <button type='submit' name='unban' > Unban User </button>
     25     </form>
     26 
     27     <form class="delete-survey-form" action="res/delete-survey.php" method="POST">
     28         <input type='text' name='survey-code' placeholder='Survey Code'> <br>
     29         <button type='submit' name='delete-survey' > Delete Survey</button>
     30     </form>
     31 
     32     <form class="create-admin" action="res/register-admin.php" method="POST">
     33         <input type='text' name='email' placeholder='Email'> <br>
     34         <input type='text' name='username' placeholder='User Name'> <br>
     35         <input type='text' name='password' placeholder='Password'> <br>
     36         <button type='submit' name='admin' > Create New Admin Account</button>
     37     </form>
     38 
     39     <form class="banner-message" action="res/admin-message.php" method="POST">
     40         <input type='text' name='message' placeholder='New Message'> <br>
     41         <button type='submit' name='admin' > New Banner Message </button>
     42         <button type='submit' name='remove' > Remove Current Banner Message </button>
     43     </form>
     44 </div>
     45