public function executeMain() { $user = ""; $group = ""; $path = ""; $menuManager = new MenuManager(); $sections = $menuManager->getSections(); $this->page->addVar('menu', $sections); if ($this->getApplication()->getRequest()->hasPostValues()) { if ($this->getApplication()->getRequest()->getPostData("user")) { $user = $this->getApplication()->getRequest()->getPostData("user"); } if ($this->getApplication()->getRequest()->getPostData("group")) { $group = $this->getApplication()->getRequest()->getPostData("group"); } if ($this->getApplication()->getRequest()->getPostData("path")) { $path = $this->getApplication()->getRequest()->getPostData("path"); } $searchManager = new SearchManager(); $result = $searchManager->getStatistics($user, $group, $path); $rowNumber = $searchManager->getRowNumber(); $this->page->addVar('result', $result); $this->page->addVar('rowNumber', $rowNumber); $this->page->addVar('page', 'result'); } else { $this->page->addVar('page', 'form'); } $this->page->addVar('fsname', $menuManager->getfsname()); }
public function executeMain() { $others_count = 0; $others_size = 0; $top_count = array(); $top_size = array(); $menu = array(); $menuManager = new MenuManager(); $sections = $menuManager->getSections(); $manager_name = ucfirst($this->module) . 'Manager'; $manager = new $manager_name(); $result = $manager->getStat(); $count = $result->getCount(); $size = $result->getSize(); array_multisort($count, SORT_NUMERIC, SORT_DESC); array_multisort($size, SORT_NUMERIC, SORT_DESC); //Create final arrays $i = 0; foreach ($count as $key => $value) { if ($i < LIMIT) { $result_count[$key] = $value; } else { $others_count += $value; } $i++; } $result_count['Others'] = $others_count; $i = 0; foreach ($size as $key => $value) { if ($i < LIMIT) { $result_size[$key] = $value; } else { $others_size += $value; } $i++; } $result_size['Others'] = $others_size; $this->page->addVar('menu', $menu); $this->page->addVar('count', $result_count); $this->page->addVar('size', $result_size); $this->page->addVar('statistics', $result); $this->page->addVar('index', $this->module); }
public function executeMain() { $others_count = 0; $others_size = 0; $top_count = array(); $top_size = array(); $menuManager = new MenuManager(); $sections = $menuManager->getSections(); $userManager = new UserManager(); $result = $userManager->getStat(); $count = $result->getCount(); $blks = $result->getBlocks(); array_multisort($count, SORT_NUMERIC, SORT_DESC); array_multisort($blks, SORT_NUMERIC, SORT_DESC); //Create array for the count section (top10) $i = 0; foreach ($count as $key => $value) { if ($i < LIMIT) { $top_count[$key] = $value; } else { $others_count += $value; } $i++; } $top_count['Others'] = $others_count; //Create array for the volume section (top10) $i = 0; foreach ($blks as $key => $value) { if ($i < LIMIT) { $top_size[$key] = $value * DEV_BSIZE; } else { $others_size += $value * DEV_BSIZE; } $i++; } $top_size['Others'] = $others_size; $this->page->addVar('menu', $sections); $this->page->addVar('top_count', $top_count); $this->page->addVar('top_size', $top_size); $this->page->addVar('statistics', $result); $this->page->addVar('fsname', $userManager->getfsname()); }
public function executeMain() { // $others_count = 0; // $others_size = 0; // $top_count = array(); // $top_size = array(); $menuManager = new MenuManager(); $sections = $menuManager->getSections(); $sizeManager = new SizeManager(); $result = $sizeManager->getSizeProfile(); $sz_ranges = array(); global $sz_range_name; $i = 0; foreach ($result as $k => $val) { $sz_ranges[$sz_range_name[$i]] = $val; $i++; } $users = $sizeManager->getSizeProfileUsers(); $this->page->addVar('menu', $sections); $this->page->addVar('sz_ranges', $sz_ranges); $this->page->addVar('users', $users); $this->page->addVar('fsname', $sizeManager->getfsname()); }