static function getActivity($creatorid, $type, $receiverid, $schoolid) { if (!($objects = Obj_Cache::read('activity_' . $creatorid . "_" . $type . "_" . $receiverid . "_" . $schoolid))) { $tActivity = new Table_Activities(); $activity = $tActivity->getActivity($creatorid, $type, $receiverid, $schoolid); Obj_Cache::save('activity_' . $creatorid . "_" . $type . "_" . $receiverid . "_" . $schoolid, $activity); return $activity; } return $objects; }
public function indexAction() { $this->view->schools = SchoolList::load(); $tActivity = new Table_Activities(); $result = $tActivity->getActivity(NULL, NULL, NULL, NULL); $tUser = new Table_UsersInfo(); $output = $result->toArray(); if (!isset($_GET["uid"])) { $currentuser = $tUser->getUserName($this->user->user_id); } else { $currentuser = $tUser->getUserName($_GET["uid"]); } //echo $_GET["uid"].$currentuser; die; $uinfo = $tUser->getUser($this->user->user_id); $this->view->assign("uinfo", $uinfo); $this->view->assign("user", $this->user); $this->view->assign("currentuser", $currentuser); $this->view->assign("activity", $output); }
public function indexAction() { $this->_helper->viewRenderer->setNoRender(true); $userinfo['first_name'] = $this->getRequest()->getParam('first_name'); $userinfo['last_name'] = $this->getRequest()->getParam('last_name'); $userinfo['school_id'] = $this->getRequest()->getParam('school_id'); $userinfo['school_year'] = $this->getRequest()->getParam('school_year'); $userinfo['class_year'] = $this->getRequest()->getParam('class_year'); $userinfo['status'] = 1; $userCredentails['email'] = $this->getRequest()->getParam('email'); $userCredentails['password'] = $this->getRequest()->getParam('password'); $tUsersInfo = new Table_UsersInfo(); if ($userid = $tUsersInfo->createUser($userinfo)) { $userCredentails['userID'] = $userid; $tUsers = new Table_Users(); $tUsers->createUserCredentials($userCredentails); $tActivity = new Table_Activities(); $tActivity->createActivity($userid, 1, $userinfo['school_id'], $userinfo['school_id']); User::login($userCredentails['email'], $userCredentails['password']); $this->_redirect(HTTP_HOST . "/chatroom/chat"); } }
public function addcommentAction() { $this->_helper->viewRenderer->setNoRender(true); $arResult = array('error' => ''); if ($comment = $this->getRequest()->getParam('comments', '')) { if ($comment == '') { return false; } else { $tComment = new Table_Comments(); $comment_id = $tComment->createComment($this->user->school_id, $comment); if ($comment_id > 0) { $tActivity = new Table_Activities(); $tActivity->createActivity($this->user->user_id, 29, $this->user->school_id, $this->user->school_id, $comment_id); } } $tUser = new Table_UsersInfo(); $creatorid = $this->user->user_id; $creator = '<a href="../profile/profile?uid=' . $creatorid . '" >' . $tUser->getUserName($creatorid) . '</a>'; $arResult['creator'] = $creator; } else { $arResult['error'] = "Please enter comment"; } $this->_helper->json($arResult, true, false); }