Login Functionality Update
This commit is contained in:
parent
b524cd45fe
commit
029bc3c67d
|
@ -0,0 +1,2 @@
|
||||||
|
Header add Access-Control-Allow-Origin "*"
|
||||||
|
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
|
|
@ -17,4 +17,4 @@ if(isset($_GET['gameDataId'])){
|
||||||
header("Access-Control-Allow-Methods: GET");
|
header("Access-Control-Allow-Methods: GET");
|
||||||
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo $openGameDataStream->toJson(JSON_PRETTY_PRINT);
|
echo json_encode(array('data' => $openGameDataStream->jsonSerialize()));
|
|
@ -12,6 +12,7 @@ if(isset($_GET['gameJamId'])){
|
||||||
header("Access-Control-Allow-Methods: GET");
|
header("Access-Control-Allow-Methods: GET");
|
||||||
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo $dbValue->toJson(JSON_PRETTY_PRINT);
|
|
||||||
|
echo json_encode(array('data' => $dbValue->jsonSerialize()));
|
||||||
|
|
||||||
//var_dump(headers_list());
|
//var_dump(headers_list());
|
|
@ -15,4 +15,4 @@ else{
|
||||||
header("Access-Control-Allow-Methods: GET");
|
header("Access-Control-Allow-Methods: GET");
|
||||||
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo $groups->toJson(JSON_PRETTY_PRINT);
|
echo json_encode(array('data' => $groups->jsonSerialize()));
|
|
@ -5,7 +5,7 @@ require_once "../Group/Group.php";
|
||||||
|
|
||||||
if(isLogin()){
|
if(isLogin()){
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->toJson(JSON_PRETTY_PRINT);
|
echo json_encode(array('data' => Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->jsonSerialize()));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
echo http_response_code(401);
|
echo http_response_code(401);
|
||||||
|
|
|
@ -25,7 +25,7 @@ if(isAdmin() && isset($_GET['gameJamId'])){
|
||||||
header("Access-Control-Allow-Methods: GET");
|
header("Access-Control-Allow-Methods: GET");
|
||||||
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo $winningGroups->toJson(JSON_PRETTY_PRINT);
|
echo json_encode(array('data' => $winningGroups->jsonSerialize()));
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -23,7 +23,7 @@ if (!isAdmin()){
|
||||||
header("Access-Control-Allow-Methods: GET");
|
header("Access-Control-Allow-Methods: GET");
|
||||||
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
|
||||||
header('Content-Type: application/json;charset=UTF-8');
|
header('Content-Type: application/json;charset=UTF-8');
|
||||||
echo $find_all_keywords->pluck("key_word")->toJson(JSON_PRETTY_PRINT);
|
echo json_encode(array('data' => $find_all_keywords->jsonSerialize()));
|
||||||
}else{
|
}else{
|
||||||
echo http_response_code(400);
|
echo http_response_code(400);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<!-- CSS end -->
|
<!-- CSS end -->
|
||||||
|
|
||||||
<!-- Header scripts -->
|
<!-- Header scripts -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||||
<script src="https://kit.fontawesome.com/57b6c8b971.js" crossorigin="anonymous"></script>
|
<script src="https://kit.fontawesome.com/57b6c8b971.js" crossorigin="anonymous"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
||||||
<script src="Javascript/swipe.js"></script>
|
<script src="Javascript/swipe.js"></script>
|
||||||
|
@ -134,11 +135,12 @@
|
||||||
<input id="username" type="text" name="" placeholder="Gruppe navn">
|
<input id="username" type="text" name="" placeholder="Gruppe navn">
|
||||||
<input id="pass1" type="password" class="" name="" placeholder="Password">
|
<input id="pass1" type="password" class="" name="" placeholder="Password">
|
||||||
<input id="pass2" type="password" name="" placeholder="Gentag Password">
|
<input id="pass2" type="password" name="" placeholder="Gentag Password">
|
||||||
<div class="form-check" style="display: table; margin: auto;">
|
<select id="AvailableGameJams" class="form-select" aria-label="Default select example"></select>
|
||||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
|
||||||
<label class="form-check-label" for="flexCheckDefault">
|
<div class="btn-group" role="group" aria-label="Basic example">
|
||||||
Jeg accepterer Vilkår og betingelser
|
<button type="button" class="btn btn-primary"><i class=fas fa-></i></button>
|
||||||
</label>
|
<button type="button" class="btn btn-primary">Middle</button>
|
||||||
|
<button type="button" class="btn btn-primary">Right</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="pass_info">
|
<div id="pass_info">
|
||||||
|
@ -632,7 +634,7 @@
|
||||||
<script src="Javascript/Kalender.js"></script>
|
<script src="Javascript/Kalender.js"></script>
|
||||||
<script src="Javascript/minibar.min.js"></script>
|
<script src="Javascript/minibar.min.js"></script>
|
||||||
<script src="Javascript/HeaderFunctionality.js"></script>
|
<script src="Javascript/HeaderFunctionality.js"></script>
|
||||||
<script src="Javascript/qweData.js"></script>
|
<script src="Javascript/LoginFunctionality.js"></script>
|
||||||
<!-- Body scripts end -->
|
<!-- Body scripts end -->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Populate select with GameJams
|
||||||
|
let JamArr = [];
|
||||||
|
|
||||||
|
axios.get('/Backend/Controllers/GameJam/GetGameJam.php').then(res => {
|
||||||
|
let resArr = res.data;
|
||||||
|
|
||||||
|
for(let i = 0; i < resArr.data.length; i++)
|
||||||
|
{
|
||||||
|
let Jam = resArr.data[i];
|
||||||
|
JamArr.push({
|
||||||
|
id: Jam.id,
|
||||||
|
Name: Jam.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(JamArr, function(i, Jam) {
|
||||||
|
console.log(`Id: ${Jam.id} \n Name: ${Jam.Name}`);
|
||||||
|
if(i === 1)
|
||||||
|
{
|
||||||
|
$('#AvailableGameJams').append('<option disabled selected value="'+ "0" + '">' + "Vælg et gamejam her" + '</option>');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#AvailableGameJams').append('<option value="'+ Jam.id + '">' + Jam.Name + '</option>');
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(`Error: ${error}`)
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,40 +0,0 @@
|
||||||
/*
|
|
||||||
$(window).on("load", function(){
|
|
||||||
dataFetch();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dataFetch(){
|
|
||||||
$.ajax({
|
|
||||||
type: "GET",
|
|
||||||
url: "/Game-Jaming/Backend/controllers/GameJam/GetGameJam.php",
|
|
||||||
success: function(result){
|
|
||||||
console.log(result[0].name);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
$("#qweLog").click(function(){
|
|
||||||
var vgroupName = $("#groupName").val();
|
|
||||||
var vpassword = $("#groupPassword").val();
|
|
||||||
|
|
||||||
$.post("/Game-Jaming/Backend/Controllers/Group/Login.php",
|
|
||||||
{
|
|
||||||
login: "data",
|
|
||||||
groupName: vgroupName,
|
|
||||||
password: vpassword
|
|
||||||
},
|
|
||||||
function(data){
|
|
||||||
alert("Data: " + data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//console.log(result.name); ?gameJamId=1
|
|
||||||
//console.log(result[0].name); uden ?gameJamId=1
|
|
|
@ -4,10 +4,10 @@ use Illuminate\Database\Capsule\Manager as Capsule;
|
||||||
$capsule = new Capsule;
|
$capsule = new Capsule;
|
||||||
$capsule->addConnection([
|
$capsule->addConnection([
|
||||||
"driver" => "mysql",
|
"driver" => "mysql",
|
||||||
"host" =>"127.0.0.1",
|
"host" =>"localhost",
|
||||||
"database" => "gamejamdb",
|
"database" => "TestDB",
|
||||||
"username" => "root",
|
"username" => "root",
|
||||||
"password" => ""
|
"password" => "V#_xWL6_"
|
||||||
]);
|
]);
|
||||||
$capsule->setAsGlobal();
|
$capsule->setAsGlobal();
|
||||||
$capsule->bootEloquent();
|
$capsule->bootEloquent();
|
Loading…
Reference in New Issue