public function indexAction() { $errorMsg = null; $onlines = new System_Models_OnlineMapper(); if($this->getRequest()->isPost()) { $formData = $this->getRequest()->getPost(); $arrayOnlines = array(); $key = trim($formData['key']); if($key != null) { $condition = $formData['condition']; $arrayOnlines = $onlines->fetchAllJoin($key,$condition); if(count($arrayUsers) == 0) { $errorMsg = General_Models_Text::$text_searchErrorNr; } } else { $errorMsg = General_Models_Text::$text_searchErrorNi; } } else { $arrayOnlines = $onlines->fetchAllJoin(); } $pageNumber = $this->_getParam('page'); $arrayOnlines->setCurrentPageNumber($pageNumber); $arrayOnlines->setItemCountPerPage('20'); $this->view->arrayOnlines = $arrayOnlines; $this->view->errorMsg = $errorMsg; $this->view->modelName = "在线用户"; }
public function logoutAction() { $userId = $this->getUserId(); $onlines = new System_Models_OnlineMapper(); $onlines->deleteUser($userId); $ulogs = new System_Models_UlogMapper(); $ulogs->save($userId,'登出'); Zend_Auth::getInstance()->clearIdentity(); $this->_helper->redirector('index'); // back to login page }
public function find($id,System_Models_Online $online) { $resultSet = $this->getDbTable()->find($id); if (0 == count($resultSet)) { return; } $row = $resultSet->current(); $online->setId($row->id) ->setUserId($row->userId) ->setContactId($row->contactId) ->setTimer($row->timer) ->setLoginTime($row->loginTime); $online = new System_Models_OnlineMapper(); $contactId = $online->getContactId($online->getContactId()); $contacts = new Employee_Models_ContactMapper(); $contactName = $contacts->findContactName($contactId); $online->setContactName($contactName); }