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); }