| 1 | <?PHP |
| 2 | include_once('../slack.php'); |
| 3 | include_once('security.php'); |
| 4 | if ($_COOKIE['level'] == 'user'){ |
| 5 | slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition'); |
| 6 | header('Location: user_home.php'); |
| 7 | } |
| 8 | if ($_COOKIE['level'] == 'manager'){ |
| 9 | slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition'); |
| 10 | header('Location: manager_home.php'); |
| 11 | } |
| 12 | include_once('header.php'); |
| 13 | if(isset($_POST['name'])){ |
| 14 | $name = $petition->real_escape_string($_POST['name']); |
| 15 | $petition->query("insert into groups (name) values ('$name') "); |
| 16 | } |
| 17 | slack_general('ADMIN: Group Manager Loaded ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition'); |
| 18 | ?> |
| 19 | |
| 20 | <h1>Current Groups</h1> |
| 21 | <?PHP |
| 22 | $q="SELECT * FROM groups"; |
| 23 | $r = $petition->query($q); |
| 24 | while($d = mysqli_fetch_array($r)){ |
| 25 | echo "<li>$d[name]</li>"; |
| 26 | } |
| 27 | ?> |
| 28 | |
| 29 | |
| 30 | <h1>New Group</h1> |
| 31 | <form method='post'> |
| 32 | New Group Name <input name='name' required> |
| 33 | <input type='submit'> |
| 34 | </form> |
| 35 | <br><br> |
| 36 | <?PHP |
| 37 | include_once('footer.php'); |
| 38 | ?> |