if (!$notifications) { $data = "<li><span class='title'>No notifications found</span></li>"; } $this->ajax = true; if ($count > 0) { $count = "<font color='lime'><b>{$count}</b></font>"; } $content = ['count' => $count, 'content' => $data, 'gtitle' => $gTitle, 'gbody' => $gBody]; $this->jsonE('success', $content); } public function clear() { $this->query("UPDATE notifications SET notification_viewed = TRUE where user_id='{$this->user->id}'"); $suc = ['result' => 'Notifications Cleared']; $this->jsonE('success', $suc); } } //notify $mod = new notify(); if (!isset($mod->user)) { die; } if (isset($_GET['getCount'])) { $mod->getCount(); } else { if (isset($_GET['clear'])) { $mod->clear(); } else { $mod->main(); } }