From 796148a5323ba77b2c2127b8befd55db0f8f3fb3 Mon Sep 17 00:00:00 2001 From: Gregorio Chiko Putra Date: Thu, 7 Sep 2017 13:45:05 +0700 Subject: [PATCH] Nonactivate a post manually causes its status changed to 3 which cannot be edited and its status cannot be changed. --- App/Controllers/Posts.php | 9 ++++++--- App/Views/Data/edit_pengumuman.html | 2 +- Core/Model.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index e52ee20..57e8993 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -27,7 +27,8 @@ class Posts $table = 'pengumuman'; $valid = $this->post->showAll([ - ['valid_at', '<=', $now] + ['valid_at', '<=', $now], + ['status', '!=', 3] ]); if ($valid !== false) { foreach ($valid as $fields) { @@ -38,7 +39,8 @@ class Posts } $not_valid = $this->post->showAll([ - ['valid_at', '>', $now] + ['valid_at', '>', $now], + ['status', '!=', 3] ]); if ($not_valid !== false) { foreach ($not_valid as $fields) { @@ -49,7 +51,8 @@ class Posts } $expired = $this->post->showAll([ - ['expired_at', '<', $now] + ['expired_at', '<', $now], + ['status', '!=', 3] ]); if ($expired !== false) { foreach ($expired as $fields) { diff --git a/App/Views/Data/edit_pengumuman.html b/App/Views/Data/edit_pengumuman.html index 3b5063c..4983b7e 100644 --- a/App/Views/Data/edit_pengumuman.html +++ b/App/Views/Data/edit_pengumuman.html @@ -101,7 +101,7 @@