Game-Jaming/Backend/Controllers/Polls/GetVote.php

14 lines
396 B
PHP
Raw Normal View History

2021-03-11 12:21:16 +00:00
<?php
use Backend\Models\Vote;
2021-03-16 11:46:44 +00:00
require_once "../../../bootstrap.php";
2021-03-11 12:21:16 +00:00
require_once "../Group/Group.php";
if(isLogin()){
header('Content-Type: application/json;charset=UTF-8');
2021-03-22 14:29:18 +00:00
echo json_encode(array('data' => Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->jsonSerialize()));
2021-03-11 12:21:16 +00:00
2021-03-19 12:25:27 +00:00
}else{
2021-03-23 12:39:44 +00:00
http_response_code(401);
echo json_encode(["message" => "not login"]);
2021-03-11 12:21:16 +00:00
}