diff --git a/Backend/Controllers/Polls/1vote.php b/Backend/Controllers/Polls/1vote.php index 04ff428..f9b3fc7 100644 --- a/Backend/Controllers/Polls/1vote.php +++ b/Backend/Controllers/Polls/1vote.php @@ -22,7 +22,7 @@ if(isset($_POST['1Vote'])){ } } }else{ - http_response_code(400); + echo http_response_code(400); } diff --git a/Backend/Controllers/Polls/GetVote.php b/Backend/Controllers/Polls/GetVote.php index e421407..162b1f5 100644 --- a/Backend/Controllers/Polls/GetVote.php +++ b/Backend/Controllers/Polls/GetVote.php @@ -8,5 +8,5 @@ if(isLogin()){ echo Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->toJson(JSON_PRETTY_PRINT); }else{ - http_response_code(401); + echo http_response_code(401); } diff --git a/Backend/Controllers/Polls/GetWinner.php b/Backend/Controllers/Polls/GetWinner.php index 3613331..5fbf44d 100644 --- a/Backend/Controllers/Polls/GetWinner.php +++ b/Backend/Controllers/Polls/GetWinner.php @@ -29,6 +29,6 @@ if(isAdmin() && isset($_GET['gameJamId'])){ }else{ - http_response_code(401); + echo http_response_code(401); } diff --git a/Backend/Controllers/keyWord/GetKeyWinner.php b/Backend/Controllers/keyWord/GetKeyWinner.php index 0045d10..ed3e80a 100644 --- a/Backend/Controllers/keyWord/GetKeyWinner.php +++ b/Backend/Controllers/keyWord/GetKeyWinner.php @@ -25,8 +25,8 @@ if (!isAdmin()){ header('Content-Type: application/json;charset=UTF-8'); echo $find_all_keywords->pluck("key_word")->toJson(JSON_PRETTY_PRINT); }else{ - http_response_code(400); + echo http_response_code(400); } }else{ - http_response_code(401); + echo http_response_code(401); } \ No newline at end of file diff --git a/Backend/Controllers/keyWord/NewKeyWord.php b/Backend/Controllers/keyWord/NewKeyWord.php index 5049f3b..6bcb3ae 100644 --- a/Backend/Controllers/keyWord/NewKeyWord.php +++ b/Backend/Controllers/keyWord/NewKeyWord.php @@ -25,19 +25,19 @@ if (isLogin()) { //Try to save it if(!$keyword->save()){ - http_response_code(500); + echo http_response_code(500); }else{ - http_response_code(201); + echo http_response_code(201); } }else{ echo "limited upload reached"; - http_response_code(400); + echo http_response_code(400); } }else{ - http_response_code(400); + echo http_response_code(400); } }else{ - http_response_code(401); + echo http_response_code(401); } diff --git a/Frontend/Index.html b/Frontend/Index.html index 71d30ad..bdd9eeb 100644 --- a/Frontend/Index.html +++ b/Frontend/Index.html @@ -121,9 +121,9 @@

Team Login

- - - + + +
diff --git a/Frontend/Javascript/qweData.js b/Frontend/Javascript/qweData.js index 2770f4c..1f7e414 100644 --- a/Frontend/Javascript/qweData.js +++ b/Frontend/Javascript/qweData.js @@ -1,8 +1,10 @@ +/* $(window).on("load", function(){ dataFetch(); }); + function dataFetch(){ $.ajax({ type: "GET", @@ -12,6 +14,25 @@ function dataFetch(){ } }); } + */ + + +$("#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); + }); +}); + +