diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index 80c2894..246c97a 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -3,6 +3,7 @@ namespace App\Controllers; use \Core\View; use App\Models\Post; +use \Core\Token; class Posts { @@ -26,9 +27,13 @@ class Posts public function entry() { $categories = $this->model->showCategories(); + $date = new \DateTime(); + $timestamp = $date->format('Y/m/d H:i:s'); // echo "You can entry new data here."; // Nanti di replace sama twig view ke App\Views\Data\entry_pengumuman.html View::render('Data/entry_pengumuman.html', [ - 'categories' => $categories + 'categories' => $categories, + 'timestamp' => $timestamp, + 'token' => Token::generate() ]); return true; } @@ -37,6 +42,8 @@ class Posts { if ($id) { $posts = $this->model->showSingle($id); + $date = new \DateTime(); + $timestamp = $date->format('Y/m/d H:i:s'); // echo "You can edit exists data with id $id here"; // Nanti di replace sama twig view ke App\Views\Data\edit_pengumuman.html View::render( 'Data/edit_pengumuman.html', @@ -46,7 +53,9 @@ class Posts 'created_at' => $posts['created_at'], 'creator' => $posts['creator'], 'edited_at' => $posts['edited_at'], - 'editor' => $posts['editor'] + 'editor' => $posts['editor'], + 'timestamp' => $timestamp, + 'token' => Token::generate() ] ); return true; diff --git a/App/Views/Data/edit_pengumuman.html b/App/Views/Data/edit_pengumuman.html index 9a6d89f..e5a6c83 100644 --- a/App/Views/Data/edit_pengumuman.html +++ b/App/Views/Data/edit_pengumuman.html @@ -40,13 +40,13 @@ - + - +
diff --git a/App/Views/Data/entry_pengumuman.html b/App/Views/Data/entry_pengumuman.html index f43c72b..7c7e7b2 100644 --- a/App/Views/Data/entry_pengumuman.html +++ b/App/Views/Data/entry_pengumuman.html @@ -19,13 +19,15 @@ - + - + + +