public static function getAllMemberRecords()
 {
     $userModel = new FM_Models_FM_User();
     $records = $userModel->getAll();
     $users = array();
     foreach ($records as $key => $values) {
         $users[] = FM_Components_Member::getMemberRecord($values['id']);
     }
     return $users;
 }
 public function manageusersAction()
 {
     $orgType = $this->_getParam('type');
     $this->view->userform = new FM_Forms_Root_Users(array(), FM_Components_Member::getAllForDropdown());
     $this->view->sidenav = $this->view->partial('root/parts/sidenavs/users.phtml', array('selected' => $orgType));
     if ($_POST['search'] && $_POST['search'] != '') {
         $users = FM_Components_Member::getMemberRecordsLike($_POST['search']);
     } else {
         if ($_POST['orgsearch']) {
             $users = array();
             $orgs = FM_Components_Organization::searchOrgs($_POST['orgsearch']);
             //print_r($orgs);exit;
             foreach ($orgs as $org) {
                 $members = FM_Components_Organization::getOrgMembers($org['id']);
                 foreach ($members as $member) {
                     $user = FM_Components_Member::getMemberRecord($member['uid']);
                     if ($user['id']) {
                         $users[$user['uname']] = $user;
                     }
                 }
             }
             asort($users);
         } else {
             if ($this->_request->getParam('search')) {
                 $users = array(FM_Components_Member::getMemberRecord($this->_request->getParam('search')));
             } else {
                 if ($orgType !== 0) {
                     $users = FM_Components_Member::getMemberRecordsByOrgType($orgType);
                 } else {
                     $users = FM_Components_Member::getAllMemberRecords();
                 }
             }
         }
     }
     //print count($users);exit;
     $this->view->users = $users;
 }