Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Admin add event
|
||||
$("#indsend").click(function () {
|
||||
let startDate = $("#startDate").val();
|
||||
let endDate = $("#endDate").val();
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
console.log(`startDate ${startDate} \n
|
||||
endDate ${endDate} \n
|
||||
startTime ${startTime} \n
|
||||
endTime ${endTime}`);
|
||||
})
|
||||
|
||||
function addEvent() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,15 @@ $(document).ready(function () {
|
||||
.then(function(res) {
|
||||
let resArr = res.data;
|
||||
|
||||
$.each(resArr, function(i, value) {
|
||||
arr.push({id: value.id, Gamejam: value.name});
|
||||
});
|
||||
//console.log(res.data.data);
|
||||
|
||||
for(let i = 0; i < res.data.data.length; i++)
|
||||
{
|
||||
arr.push({
|
||||
id: res.data.data[i].id,
|
||||
Gamejam: res.data.data[i].name
|
||||
});
|
||||
}
|
||||
|
||||
$.each(arr, function(i, data) {
|
||||
if (i === 0)
|
||||
@@ -34,7 +40,7 @@ $(document).ready(function () {
|
||||
// Remove invalidInput if selected option has been changed
|
||||
$('#GameJamSelect').change(function() {
|
||||
selectedGameJam = $('#GameJamSelect').children("option:selected").val();
|
||||
|
||||
|
||||
if (selectedGameJam >= 1)
|
||||
{
|
||||
$('#GameJamSelect').removeClass('invalidInput');
|
||||
@@ -50,7 +56,7 @@ $(document).ready(function () {
|
||||
})
|
||||
|
||||
GetGroupNames().then(function(res) {
|
||||
let resArr = res;
|
||||
let resArr = res.data;
|
||||
let groupNameTaken = false;
|
||||
|
||||
$('#RegisterBtn').click(function() {
|
||||
@@ -88,28 +94,33 @@ $(document).ready(function () {
|
||||
{
|
||||
$('#pass1').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass2').val().length === 0)
|
||||
{
|
||||
$('#pass2').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#username').val().length === 0)
|
||||
{
|
||||
$('#username').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass1').hasClass('invalidInput'))
|
||||
{
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if($('#pass2').hasClass('invalidInput'))
|
||||
{
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$.isNumeric($('#NUDDisplay').text()))
|
||||
@@ -127,32 +138,28 @@ $(document).ready(function () {
|
||||
{
|
||||
$('#username').addClass('invalidInput');
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
let URL = "/Backend/Controllers/Group/SigningUp.php";
|
||||
let formData = new FormData(this);
|
||||
let name = $('#RegisterBtn').attr('name');
|
||||
|
||||
let form = $('#RegisterForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
let id = $('#RegisterBtn').attr('name');
|
||||
let value = $('#RegisterBtn').val();
|
||||
|
||||
formData.append(name, value);
|
||||
formData.append(id, value);
|
||||
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
mimeType:"multipart/form-data",
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(data, textStatus, jqXHR)
|
||||
{
|
||||
console.log(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
console.log(textStatus);
|
||||
}
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -195,29 +202,28 @@ $(document).ready(function () {
|
||||
// Login start
|
||||
$('#LoginForm').submit(function(e) {
|
||||
let URL = "/Backend/Controllers/Group/Login.php";
|
||||
let formData = new FormData(this);
|
||||
let name = $('#LoginBtn').attr('name');
|
||||
|
||||
let form = $('#LoginForm')[0];
|
||||
let formData = new FormData(form);
|
||||
|
||||
let id = $('#LoginBtn').attr('name');
|
||||
let value = $('#LoginBtn').val();
|
||||
|
||||
formData.append(name, value);
|
||||
formData.append(id, value);
|
||||
|
||||
$.ajax({
|
||||
url: URL,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
mimeType:"multipart/form-data",
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(data, textStatus, jqXHR)
|
||||
|
||||
axios.post(URL, formData, {
|
||||
header: 'multipart/form-data'
|
||||
}).then(res => {
|
||||
if (res.status === 200)
|
||||
{
|
||||
console.log(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
console.log(`XHR: ${jqXHR} \n Status: ${textStatus} \n Error: ${errorThrown}`);
|
||||
}
|
||||
console.log('Logged in');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
})
|
||||
// Login end
|
||||
});
|
||||
@@ -1,19 +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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//console.log(result.name); ?gameJamId=1
|
||||
//console.log(result[0].name); uden ?gameJamId=1
|
||||
Reference in New Issue
Block a user