diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index f54ec05..70133a3 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -312,18 +312,4 @@ class Posts } die(); } - - public function remove($args = []) - { - $id = $args['id']; - if ($this->model->remove($id) == true) { - $info = 'Data berhasil dihapus'; - } else { - $info = 'Terjadi kesalahan. Silahkan coba lagi dalam beberapa saat.'; - } - - Session::flash('info', $info); - Redirect::to('/'); - die(); - } } diff --git a/App/Models/Post.php b/App/Models/Post.php index 716cceb..7870c2d 100644 --- a/App/Models/Post.php +++ b/App/Models/Post.php @@ -241,20 +241,4 @@ class Post extends \Core\Model throw new \Exception($e->getMessage(), 444); } } - - public function remove($id) { - try { - $db = static::connectDB(); - - $sql = "DELETE FROM pengumuman WHERE id = ?"; - - $query = $db->prepare($sql); - $query->bindValue(1, $id); - $query->execute(); - return true; - } catch (PDOException $e) { - throw new \Exception($e->getMessage(), 444); - } - - } } diff --git a/App/Views/Data/edit_pengumuman.html b/App/Views/Data/edit_pengumuman.html index 06724f9..366769b 100644 --- a/App/Views/Data/edit_pengumuman.html +++ b/App/Views/Data/edit_pengumuman.html @@ -122,18 +122,4 @@ {% endif %} - - {% if editor_now.privilage == 1 %} -
- {% endif %} {% endblock %}