diff --git a/.gitignore b/.gitignore index fb8544c..ad254d2 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ fabric.properties composer.phar /vendor/ /Backend/Database/test.db +/Backend/Games/ diff --git a/Backend/Controllers/upload.php b/Backend/Controllers/upload.php new file mode 100644 index 0000000..fa035dc --- /dev/null +++ b/Backend/Controllers/upload.php @@ -0,0 +1,49 @@ +game_name = $title; + $gameData->game_link = $gameFileNewName; + $gameData->is_web_Based = $isWebBased; + $gameData->save(); + + rename($gameFileTmp,"../Games/".$gameFileNewName); + } + }else{ + echo "Der var en fejl med at uploade din file"; + } + }else{ + echo "Wrong file type"; + } + +} \ No newline at end of file diff --git a/Backend/Main.php b/Backend/Main.php index 1d42459..1781e2e 100644 --- a/Backend/Main.php +++ b/Backend/Main.php @@ -6,7 +6,7 @@ require "../bootstrap.php"; $gameJam = GameJam::firstOrCreate([ - 'name' => "First game jam ever!", 'startTime' => "2021-03-03T12:40", 'endTime' => "2021-04-03T12:40", 'description' => "Det her et en beskrivelse" + 'name' => "First game jam ever!", 'start_time' => "2021-03-03T12:40", 'end_time' => "2021-04-03T12:40", 'description' => "Det her et en beskrivelse" ]); @@ -17,7 +17,7 @@ $gameJam = GameJam::firstOrCreate([ HTML Tutorial -
+ @@ -26,7 +26,7 @@ $gameJam = GameJam::firstOrCreate([
-
+ diff --git a/Backend/Models/GameData.php b/Backend/Models/GameData.php index 582dd9b..4f8f95b 100644 --- a/Backend/Models/GameData.php +++ b/Backend/Models/GameData.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model as Eloquent; class GameData extends Eloquent { protected $fillable = [ - 'game_link', 'is_web_Based', "img" + 'game_name', 'game_link', 'is_web_Based', "img" ]; public function group(){ diff --git a/Frontend/group.php b/Frontend/group.php index c0a75a2..bf52822 100644 --- a/Frontend/group.php +++ b/Frontend/group.php @@ -17,7 +17,7 @@ - +

@@ -26,9 +26,6 @@

- -

-

diff --git a/upload.php b/upload.php deleted file mode 100644 index 6364659..0000000 --- a/upload.php +++ /dev/null @@ -1,31 +0,0 @@ -