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([