Example #1
0
 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;
     }
 }
Example #2
0
File: Notif.php Project: ncube/edu
 public function getUnreadMsgCount()
 {
     $user_id = Session::get('user_id');
     return DB::fetchcount('msg_notif', array('to_id' => $user_id, 'status' => 0));
 }
Example #3
0
File: User.php Project: ncube/edu
 public function getLikesCount()
 {
     $data = DB::fetchcount('post_likes', array('user_id' => Session::get('user_id')));
     return $data;
 }