private function getAppMap() { $auth = Zing_Admin_Auth::getInstance(); $adminflg = $auth->getIdentity()->adminflg; //var_dump($adminflg);die(); $appserver = new AppInfo(); $modelUser = new AdminReportHandler(); $appIDs = $modelUser->getAdminApp($this->getUserID()); $appMap = array(); foreach ($appIDs as $appID) { if ($appID['adminAppID'] == 'credits_report') { $this->view->app_credits_report = 1; continue; } $appName = $appserver->getAppName($appID['adminAppID']); $appMap[$appID['adminAppID']] = $appName; } if ($adminflg == '1') { $appserver = new AppInfo(); $allApp = $appserver->getAllAppInfo(); foreach ($allApp as $appInfo) { $appMap['' . $appInfo->appID] = $appInfo->appName; } } if ($adminflg == '2') { $appserver = new AppInfo(); $allApp = $appserver->getAllAppInfo(); foreach ($allApp as $appInfo) { if ($appInfo->appID == 'admin' || $appInfo->appID == 'zing') { continue; } $appMap['' . $appInfo->appID] = $appInfo->appName; } } return $appMap; }
public function edituserAction() { try { $array_of_params = $this->_request->getParams(); if (isset($array_of_params['validate'])) { $this->view->validate = $array_of_params['validate']; } $adminReportHandler = new AdminReportHandler(); $admin = $adminReportHandler->getAdmin($array_of_params['userId']); $adminApps = $adminReportHandler->getAllAdminApp($array_of_params['userId']); $adminAppsMap = array(); foreach ($adminApps as $adminApp) { $adminAppsMap['' . $adminApp['adminAppID']] = '1'; } $userData["txtUserName"] = $admin["adminID"]; $userData["appid"] = $adminAppsMap; $userData["txtName"] = $admin["adminName"]; $userData["adminflg"] = $admin["adminflg"]; $this->view->userData = $userData; $appserver = new AppInfo(); $allApps = $appserver->getAllAppInfo(); $allApps = $this->sortAppByID($allApps); $this->view->allApps = $allApps; $this->view->frmSearch = $this->view->render('index/edituser.phtml'); $this->view->container = $this->view->render('index/index.phtml'); } catch (Exception $e) { var_dump($e); die; } }