Added function to deactivate post

This commit is contained in:
2017-09-05 10:53:03 +07:00
parent 61060dd393
commit 1381593163
4 changed files with 38 additions and 8 deletions

View File

@@ -74,9 +74,19 @@ class Posts
$table = 'pengumuman';
$id = $args['id'];
unset($args['id']);
if ($this->model->update($table, $args, $id)) {
if ($this->post->update($table, $args, $id)) {
Session::flash('info', 'Data successfuly updated');
return $this->index();
return $this->edit();
}
}
public function delete($args = [])
{
$table = 'pengumuman';
$id = $args['id'];
if ($this->post->delete($table, $id)) {
Session::flash('info', 'Data successfuly removed');
return \Core\Redirect::to('/');
}
}
}