public function questionDifficulty($id, $level) { $user_id = Session::get('user_id'); $count = DB::fetchcount('difficulty', array('user_id' => $user_id, 'q_id' => $id)); if (!empty($id)) { if (!$count == 0) { DB::updateIf('difficulty', array('level' => $level), array('user_id' => $user_id, 'q_id' => $id)); } else { DB::insert('difficulty', array('user_id' => $user_id, 'q_id' => $id, 'level' => $level, 'time' => time())); } return TRUE; } }
public function getUnreadMsgCount() { $user_id = Session::get('user_id'); return DB::fetchcount('msg_notif', array('to_id' => $user_id, 'status' => 0)); }
public function getLikesCount() { $data = DB::fetchcount('post_likes', array('user_id' => Session::get('user_id'))); return $data; }