Updated Home and Post

This commit is contained in:
Gregorio Chiko Putra 2017-10-02 09:19:05 +07:00
parent 64fc8a6896
commit 2602ba2911
2 changed files with 17 additions and 1 deletions

View File

@ -175,4 +175,20 @@ class Home
}
return true;
}
// Branch mithril test
public function mithril() {
if (Session::exists('userid')) {
$user['id'] = Session::get('userid');
$user['username'] = Session::get('username');
$user['full_name'] = Session::get('full_name');
$user['privilege'] = Session::get('privilege');
} else {
$user = false;
}
View::render('Data/mithril.html', [
'user' => $user
]);
}
}

View File

@ -122,7 +122,7 @@ class Post extends \Core\Model
try {
$db = static::connectDB();
$sql = "SELECT pengumuman.id, kategori.background, kategori.foreground, pengumuman.valid_at, pengumuman.expired_at, pengumuman.creator, pengumuman.editor, pengumuman.content, pengumuman.status FROM pengumuman INNER JOIN kategori ON pengumuman.category=kategori.id";
$sql = "SELECT pengumuman.id, kategori.category, kategori.background, kategori.foreground, date(pengumuman.valid_at) as valid_at, date(pengumuman.expired_at) as expired_at, pengumuman.creator, pengumuman.editor, pengumuman.content, pengumuman.status FROM pengumuman INNER JOIN kategori ON pengumuman.category=kategori.id";
if ($conditions) {
$sql .= " WHERE";