function system_statistics() { $content_template = $this->load_template($this->_template_root . 'system_statistics.xml'); $sm = vivvo_lite_site::get_instance(); $user_mng = $sm->get_user_manager(); $user_list = $user_mng->get_user_list(); $content_template->assign('system_staff', strval($user_list->get_count(array('search_user_type' => 'staff')))); $fm = $sm->get_file_manager(); $tpl_dir = new dir_list(null, VIVVO_TEMPLATE_DIR, '', VIVVO_FS_TEMPLATE_ROOT); $tpl_dir->allowed_ext = array('tpl'); $content_template->assign('system_templates', strval($tpl_dir->get_total_number())); $content_template->assign('system_templates_size', number_format($tpl_dir->get_total_file_size() / (1024 * 1024), 2, '.', ' ')); $tpl_dir->set__root_dir(VIVVO_FS_ROOT); $tpl_dir->set_dir(VIVVO_FS_FILES_DIR); $tpl_dir->allowed_ext = array(); $content_template->assign('system_files', strval($tpl_dir->get_total_number())); $content_template->assign('system_files_size', number_format($tpl_dir->get_total_file_size() / (1024 * 1024), 2, '.', ' ')); $tpl_dir->set__root_dir(VIVVO_FS_ROOT); $tpl_dir->set_dir('backup/'); $tpl_dir->allowed_ext = array('sql', 'gz'); $content_template->assign('system_backup', strval($tpl_dir->get_total_number())); $content_template->assign('system_backup_size', number_format($tpl_dir->get_total_file_size() / (1024 * 1024), 2, '.', ' ')); $tpl_dir->set__root_dir(VIVVO_FS_ROOT); $tpl_dir->set_dir('cache/'); $tpl_dir->allowed_ext = array(); $content_template->assign('system_cache_size', number_format($tpl_dir->get_total_file_size() / (1024 * 1024), 2, '.', ' ')); $db = $sm->get_db(); $res = $db->query("SHOW TABLE STATUS"); $db_size = 0; if (!PEAR::isError($res)) { while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { $db_size += $row['data_length'] + $row['index_length']; } } $content_template->assign('system_database', number_format($db_size / (1024 * 1024), 2, '.', ' ')); return $content_template->get_output(); }