public function getPendingFriends() { $user_id = $this->user_id; $query = "select * from user_info t1 where user_id in (select friend_id as user_id from friend_info where user_id=" . $user_id . " and friend_status='pending' and friend_id<>" . $user_id . ")"; $records = $this->db->query($query); return User_info::instantiate($records); }
public function setSession($user_email) { $user1 = new User_info(); $user1->user_email = $user_email; $user = $user1->getUserInfo(); $s_data = array('user_email' => $user->user_email, 'user_id' => $user->user_id, 'user_name' => $user->user_name, 'first_name' => $user->first_name, 'session' => 'login#key23$%F'); $this->session->set_userdata($s_data); /* to check the session values */ //echo $this->session->userdata('user_email'); die; }
public function friends() { // confirmed friends $user = new User_info(); $user->user_id = $this->session->userdata('user_id'); $data['object'] = $user->getFriends(); // new friend request $user1 = new User_info(); $user1->user_id = $this->session->userdata('user_id'); $data['object1'] = $user1->getNewFriends(); // pending friend requests $user2 = new User_info(); $user2->user_id = $this->session->userdata('user_id'); $data['object2'] = $user2->getPendingFriends(); $this->load->view('user/header'); $this->load->view('user/ajax'); $this->load->view('user/sidebar_left'); $this->load->view('user/navbar_top'); $this->load->view('user/friends', $data); $this->load->view('user/footer'); }