new database

This commit is contained in:
2021-04-19 09:15:15 +02:00
parent 24663071e6
commit 22a431da07
43 changed files with 423 additions and 302 deletions
+5 -5
View File
@@ -2,17 +2,18 @@
use Backend\Models\Group;
use Backend\Models\Vote;
require_once "../../../bootstrap.php";
if(isset($_POST['321Vote'])){
if (isset($_POST['321Vote'])) {
require "Vote.php";
//give 1 point
$vote = new Vote();
$vote->group()->associate(Group::find($_POST['1pGroupId']));
$vote->points += 1;
if(!empty($_POST['1pComment'])){
if (!empty($_POST['1pComment'])) {
$vote->comment = $_POST['1pComment'];
}
$vote->save();
@@ -20,7 +21,7 @@ if(isset($_POST['321Vote'])){
$vote = new Vote();
$vote->group()->associate(Group::find($_POST['2pGroupId']));
$vote->points += 2;
if(!empty($_POST['2pComment'])){
if (!empty($_POST['2pComment'])) {
$vote->comment = $_POST['2pComment'];
}
$vote->save();
@@ -28,7 +29,7 @@ if(isset($_POST['321Vote'])){
$vote = new Vote();
$vote->group()->associate(Group::find($_POST['3pGroupId']));
$vote->points += 3;
if(!empty($_POST['3pComment'])){
if (!empty($_POST['3pComment'])) {
$vote->comment = $_POST['3pComment'];
}
$vote->save();
@@ -36,5 +37,4 @@ if(isset($_POST['321Vote'])){
exit();
}