Keyword now gets its data from session, made a error pages display
This commit is contained in:
parent
5d0e60cd9d
commit
913fdae646
|
@ -3,11 +3,12 @@ require "../bootstrap.php";
|
||||||
use Backend\Models\Group;
|
use Backend\Models\Group;
|
||||||
use Backend\Models\KeyWord;
|
use Backend\Models\KeyWord;
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||||
if(isset($_POST['submitKeyWord'])){
|
if(isset($_POST['submitKeyWord'])){
|
||||||
//Find the group id
|
//Find the group id
|
||||||
$group = Group::find($_POST['group_id']);
|
$group = Group::find($_SESSION['groupId']);
|
||||||
|
|
||||||
//if statement to find out if the group have use all their keyWords
|
//if statement to find out if the group have use all their keyWords
|
||||||
if(KeyWord::where('group_id', $group->id)->count()<$group->groupAmount){
|
if(KeyWord::where('group_id', $group->id)->count()<$group->groupAmount){
|
||||||
|
@ -30,7 +31,8 @@ if(isset($_POST['submitKeyWord'])){
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO make toast feedback
|
//TODO make toast feedback
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
header("location: ../Frontend/index.php?login=notLoggein");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
require "../bootstrap.php";
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
@ -15,7 +10,6 @@ require "../bootstrap.php";
|
||||||
|
|
||||||
<form action="../Backend/keyWordsRemaining.php" method="POST">
|
<form action="../Backend/keyWordsRemaining.php" method="POST">
|
||||||
<input type="text" name="key_word" placeholder="key word">
|
<input type="text" name="key_word" placeholder="key word">
|
||||||
<input type="number" name="group_id" placeholder="group id">
|
|
||||||
<input type="submit" name="submitKeyWord" value="Submit">
|
<input type="submit" name="submitKeyWord" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
print_r($_GET);
|
Loading…
Reference in New Issue