voting
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Backend\Models\Group;
|
||||
use Backend\Models\Vote;
|
||||
require "../../bootstrap.php";
|
||||
|
||||
|
||||
if(isset($_POST['1vote_for'])){
|
||||
require "VoteChecking.php";
|
||||
|
||||
$vote = new Vote();
|
||||
$vote->group()->associate(Group::find($_POST['groupId']));
|
||||
$vote->points += 1;
|
||||
if(!empty($_POST['comment'])){
|
||||
$vote->comment = $_POST['comment'];
|
||||
}
|
||||
$vote->save();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user