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 -4
View File
@@ -1,5 +1,6 @@
<?php
require_once "../../../bootstrap.php";
use \Backend\Models\Group;
/**
@@ -9,18 +10,18 @@ use \Backend\Models\Group;
function VoteCheck(string $voteId): bool
{
$votes = array();
if(isset($_COOKIE["VotingReg"])) {
if (isset($_COOKIE["VotingReg"])) {
$votes = unserialize($_COOKIE["VotingReg"]);
foreach ($votes as $vote){
foreach ($votes as $vote) {
if($voteId === $vote) {
if ($voteId === $vote) {
return false;
}
}
}
array_push($votes,$voteId);
array_push($votes, $voteId);
setcookie("VotingReg", serialize($votes), time() + 86400, "/");
return true;