diff --git a/Backend/Controllers/Admin/ResetPassword.php b/Backend/Controllers/Admin/ResetPassword.php new file mode 100644 index 0000000..d931420 --- /dev/null +++ b/Backend/Controllers/Admin/ResetPassword.php @@ -0,0 +1,15 @@ +password->password = password_hash("Aa123456&", PASSWORD_DEFAULT); + } + } +} \ No newline at end of file diff --git a/Backend/Polls/1vote.php b/Backend/Controllers/Polls/1vote.php similarity index 91% rename from Backend/Polls/1vote.php rename to Backend/Controllers/Polls/1vote.php index 41d274d..63f7295 100644 --- a/Backend/Polls/1vote.php +++ b/Backend/Controllers/Polls/1vote.php @@ -2,7 +2,7 @@ use Backend\Models\Group; use Backend\Models\Vote; -require "../../bootstrap.php"; +require "../../../bootstrap.php"; if(isset($_POST['1vote_for'])){ diff --git a/Backend/Polls/321vote.php b/Backend/Controllers/Polls/321vote.php similarity index 96% rename from Backend/Polls/321vote.php rename to Backend/Controllers/Polls/321vote.php index 018a550..455213d 100644 --- a/Backend/Polls/321vote.php +++ b/Backend/Controllers/Polls/321vote.php @@ -2,7 +2,7 @@ use Backend\Models\Group; use Backend\Models\Vote; -require "../../bootstrap.php"; +require "../../../bootstrap.php"; if(isset($_POST['321vote_for'])){ diff --git a/Backend/Polls/VoteChecking.php b/Backend/Controllers/Polls/VoteChecking.php similarity index 100% rename from Backend/Polls/VoteChecking.php rename to Backend/Controllers/Polls/VoteChecking.php diff --git a/Backend/Login.php b/Backend/Controllers/User/Login.php similarity index 96% rename from Backend/Login.php rename to Backend/Controllers/User/Login.php index f419eba..451b241 100644 --- a/Backend/Login.php +++ b/Backend/Controllers/User/Login.php @@ -1,6 +1,6 @@ create("admin_users", function (Blueprint $table){ + $table->id(); + $table->string("user_name"); + $table->string("password"); + $table->timestamps(); +}); \ No newline at end of file diff --git a/Backend/Database/GameData.php b/Backend/Database/GameData.php index 62062e3..503c93e 100644 --- a/Backend/Database/GameData.php +++ b/Backend/Database/GameData.php @@ -8,9 +8,11 @@ use Illuminate\Support\Facades\Schema; //Create game_data table with the rows as id, gameLink, isWebBased and timestamp Capsule::schema()->create("game_data", function (Blueprint $table){ $table->id(); - $table->string("gameLink"); - $table->boolean("isWebBased"); - $table->string("img"); + $table->string('game_name'); + $table->string("game_link"); + $table->boolean("is_web_based"); + $table->text("description")->nullable(); + $table->string("img")->nullable(); $table->timestamps(); }); diff --git a/Backend/Database/GameJam.php b/Backend/Database/GameJam.php index fa6138b..198be78 100644 --- a/Backend/Database/GameJam.php +++ b/Backend/Database/GameJam.php @@ -9,9 +9,9 @@ use Illuminate\Support\Facades\Schema; Capsule::schema()->create("game_jams", function (Blueprint $table){ $table->id(); $table->string("name"); - $table->dateTime("startTime"); - $table->dateTime("endTime"); - $table->string("keyWord")->nullable(); + $table->dateTime("start_time"); + $table->dateTime("end_time"); + $table->string("key_word")->nullable(); $table->text("description")->nullable(); $table->timestamps(); }); diff --git a/Backend/Database/Group.php b/Backend/Database/Group.php index 95d10b9..c243cf5 100644 --- a/Backend/Database/Group.php +++ b/Backend/Database/Group.php @@ -8,8 +8,8 @@ use Illuminate\Support\Facades\Schema; //Create groups table with the rows as id, groupName, groupAmount, fkGameJam, votes, fkPassword, fkGameData and timestamp Capsule::schema()->create("groups", function (Blueprint $table){ $table->id(); - $table->string("groupName"); - $table->integer("groupAmount"); + $table->string("group_name"); + $table->integer("group_amount"); $table->foreignId("game_jam_id")->constrained("game_jams"); $table->foreignId("game_data_id")->nullable()->constrained("game_data"); $table->timestamps(); diff --git a/Backend/Database/KeyWord.php b/Backend/Database/KeyWord.php index c71dba9..101ac81 100644 --- a/Backend/Database/KeyWord.php +++ b/Backend/Database/KeyWord.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\Schema; //Create key_words table with the rows as id, keyWord, fkGroup and timestamp Capsule::schema()->create("key_words", function (Blueprint $table){ $table->id(); - $table->string('keyWord'); + $table->string('key_word'); $table->foreignId("group_id")->constrained("groups"); $table->timestamps(); }); diff --git a/Backend/Database/databaseMigration.php b/Backend/Database/databaseMigration.php index 2009635..e39a836 100644 --- a/Backend/Database/databaseMigration.php +++ b/Backend/Database/databaseMigration.php @@ -19,3 +19,4 @@ require "Group.php"; //Group has foreign keys to the GameJam, GameData and Passw require "Password.php"; //Password has no foreign key require "KeyWord.php"; //Group has foreign keys to the Group require "Vote.php"; +require "AdminUser.php"; \ No newline at end of file diff --git a/Backend/Models/AdminUser.php b/Backend/Models/AdminUser.php new file mode 100644 index 0000000..6e1ba56 --- /dev/null +++ b/Backend/Models/AdminUser.php @@ -0,0 +1,15 @@ +