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

28 lines
628 B
PHP

<?php
require "../../../bootstrap.php";
use Backend\Models\GameJam;
if(isset($_SESSION['Admin'])){
if(isset($_POST['UpdateGameJam'])) {
$gameJam = GameJam::find($_POST['game_jam_id']);
if($gameJam){
$gameJam->name = $_POST['name'];
$gameJam->start_time = $_POST['start_time'];
$gameJam->end_time = $_POST['start_time'];
if (!empty($_POST['key_word'])) {
$gameJam->key_word = $_POST['key_word'];
}
$gameJam->description = $_POST['description'];
if ($gameJam->save()) {
}
}
}
}