Game-Jaming/Backend/Controllers/Admin/UpdateGameJam.php

29 lines
682 B
PHP

<?php
require_once "../../../bootstrap.php";
require_once "Admin.php";
use Backend\Models\GameJam;
if(isAdmin()){
if(isset($_POST['updateGameJam'])) {
$gameJam = GameJam::find($_POST['gameJamId']);
if($gameJam){
$gameJam->name = $_POST['name'];
$gameJam->start_time = $_POST["startDate"]."T".$_POST["startTime"];
$gameJam->end_time = $_POST["endDate"]."T".$_POST["endTime"];
if (!empty($_POST['key_word'])) {
$gameJam->key_word = $_POST['keyWord'];
}
$gameJam->description = $_POST['description'];
if ($gameJam->save()) {
}
}
}
}