public function getUserSearchResult($searchKeyword) { $query = "select uid, firstname, lastname from users where firstname like '%" . $searchKeyword . "%' or lastname like '%" . $searchKeyword . "%' group by uid limit 0, 200"; $queryResult = parent::query($query); $userSearch = array(); while ($result = parent::fetchArray($queryResult)) { $userSearch[] = array('uid' => $result['uid'], 'name' => $result['firstname'] . ' ' . $result['lastname'], 'firstname' => $result['firstname'], 'eventCount' => application_frontend_event_model::getEventOfThisWeek($result['uid'])); } return $userSearch; }
private function getNotifications() { $this->view->notification['friendRequestCount'] = application_frontend_friend_model::getRequestCount($this->user['myuid']); $this->view->notification['eventInvitationCount'] = application_frontend_event_model::getInvitationCount($this->user['myuid']); $this->view->notification['eventCommentCount'] = application_frontend_event_model::getUnreadEventCommentCount($this->user['myuid']); $this->view->notification['privatemgsAllCount'] = application_frontend_privatemsg_model::getUnreadPrivatemsgCount($this->user['myuid']); $this->view->notification['requestEventInvitation'] = application_frontend_event_model::getRequestEventInvitationCount($this->user['myuid']); if ($this->view->notification['friendRequestCount'] > 0 || $this->view->notification['eventInvitationCount'] > 0 || $this->view->notification['privatemgsAllCount'] > 0 || $this->view->notification['eventCommentCount'] > 0 || $this->view->notification['requestEventInvitation'] > 0) { $this->view->notificationExist = true; } }
public function checkEventEmailInvitation($uid) { if (isset($_SESSION['eventInvite']) && !empty($_SESSION['eventInvite'])) { application_frontend_event_model::saveEventInvitation($_SESSION['eventInvite']['ueid'], $_SESSION['eventInvite']['eid'], $_SESSION['eventInvite']['inviter'], $uid); application_frontend_event_model::deleteEventEmailInvitation($_SESSION['eventInvite']['receiver'], $_SESSION['eventInvite']['ueid'], $_SESSION['eventInvite']['inviter']); unset($_SESSION['eventInvite']); } }
public function getAllRequest($uid) { $query = "select fr.request, u.firstname, u.lastname from friendRequest as fr, users as u where fr.request = u.uid and fr.accept = " . $uid; $queryResult = parent::query($query); $requestList = array(); while ($result = parent::fetchArray($queryResult)) { $requestList[] = array('request' => $result['request'], 'name' => $result['firstname'] . ' ' . $result['lastname'], 'firstname' => $result['firstname'], 'lastname' => $result['lastname'], 'eventCount' => application_frontend_event_model::getEventOfThisWeek($result['request'])); } return $requestList; }