survey_seahorse

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

createsurvey.php (1670B)


      1 <?php 
      2 include_once 'res/session.php';
      3 include 'res/navbar.php';
      4 
      5 $block = $_SESSION['blocked'];
      6 
      7 if(!isset($_SESSION['uid'])){
      8     header("location: login.php?user=notloggedin");
      9     exit;
     10 } elseif ($block == 49 || $block == 50 || $block == 51) {
     11     header("location: res/nope.php");
     12     exit;
     13 }
     14 ?>
     15 
     16 <html>
     17  <link rel="stylesheet" href="res/style.css">
     18  <!-- <link rel="stylesheet" href="res/style.css"> -->
     19 
     20  <form class="create-survey-form" action="res/new-survey.php" method="POST">
     21    <h2> Create A New Survey </h2>
     22   
     23   <p class="create"> Title & Description </p> 
     24   <input type="text" name="title" placeholder="My Amazing Survey"> <br>
     25   <input type="text" name="description" placeholder="This is a great survey"> <br>
     26   
     27   <p class="create"> Answer Type: </p>
     28   Numeric (1 - 10)<input type="radio" class="radio" checked="checked"  name="type" value="00">
     29   Yes / No<input type="radio" class="radio" name="type" value="01"><br>
     30   <!-- <input type="radio" name="type" value="10"> Text <br> -->
     31   <!-- <input type="radio" name="type" value="11"> Custom <br> -->
     32   
     33   <p class="create"> Number of Questions (1-10)</p>
     34   <input type="number" name="number" placeholder="5" min="1" max="10"> <br>
     35   
     36   <p class="create"> Expiration Date </p>
     37   <?php
     38    $next_week = date("Y-m-d", strtotime("+1 week"));
     39    echo "<input type='date' value = '$next_week' name='expire'> <br>";
     40   ?>
     41   <p class="create"> Can a user take this survey more than once? </p>
     42   Yes<input type="radio" class="radio" name="once" value="0" checked>
     43   No<input type="radio" class="radio" name="once" value="1"><br>
     44   
     45   <button type="submit" name="submit">Create Survey</button>
     46   
     47  </form>
     48 </html>