当前位置: 首页>>代码示例>>PHP>>正文


PHP CUtils::format_Number方法代码示例

本文整理汇总了PHP中CUtils::format_Number方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtils::format_Number方法的具体用法?PHP CUtils::format_Number怎么用?PHP CUtils::format_Number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CUtils的用法示例。


在下文中一共展示了CUtils::format_Number方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: catch

        } else {
            $job['compression'] = 'N/A';
        }
        // Job speed
        $start = $job['starttime'];
        $end = $job['endtime'];
        $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
        if ($seconds !== false && $seconds > 0) {
            $speed = $job['jobbytes'] / $seconds;
            $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
        } else {
            $job['speed'] = 'N/A';
        }
        // Job bytes more easy to read
        $job['jobbytes'] = CUtils::Get_Human_Size($job['jobbytes']);
        $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
        $jobs[] = $job;
    }
    // end while
} catch (Exception $e) {
    CErrorHandler::displayError($e);
}
$view->assign('jobs', $jobs);
$view->assign('backupjob_name', $backupjob_name);
$view->assign('backupjob_period', $backupjob_period);
$view->assign('backupjob_bytes', $backupjob_bytes);
$view->assign('backupjob_files', $backupjob_files);
// Set page name
$current_page = 'Backup job report';
$view->assign('page_name', $current_page);
// Process and display the template
开发者ID:ektich,项目名称:bacula-web,代码行数:31,代码来源:backupjob-report.php

示例2: strftime

 $view->assign('literal_period', strftime("%a %e %b %Y", $custom_period[0]) . ' to ' . strftime("%a %e %b %Y", $custom_period[1]));
 // Running, completed, failed, waiting and canceled jobs status over last 24 hours
 $view->assign('running_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'running'));
 $view->assign('completed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'completed'));
 $view->assign('failed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'failed'));
 $view->assign('waiting_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'waiting'));
 $view->assign('canceled_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'canceled'));
 // Stored files number
 $view->assign('stored_files', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $no_period)));
 // Overall stored bytes
 $view->assign('stored_bytes', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $no_period)));
 // Database size
 $view->assign('database_size', Database_Model::get_Size($dbSql->db_link, $dbSql->catalog_current_id));
 // Total bytes and files stored over the last 24 hours
 $view->assign('bytes_last', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $custom_period)));
 $view->assign('files_last', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $custom_period)));
 // Number of clients
 $view->assign('clients', Clients_Model::count($dbSql->db_link));
 // Defined Jobs and Filesets
 $view->assign('defined_filesets', FileSets_Model::count($dbSql->db_link));
 $view->assign('defined_jobs', Jobs_Model::count_Job_Names($dbSql->db_link));
 // Incremental, Differential and Full jobs over the last 24 hours
 $view->assign('incr_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_INCR));
 $view->assign('diff_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_DIFF));
 $view->assign('full_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_FULL));
 // Volumes disk usage
 $volumes_size = Volumes_Model::getDiskUsage($dbSql->db_link);
 $view->assign('volumes_size', CUtils::Get_Human_Size($volumes_size));
 // Pools count
 $view->assign('pools_nb', Pools_Model::count($dbSql->db_link));
 // Backup Job list
开发者ID:ExaMuff,项目名称:bacula-web,代码行数:31,代码来源:index.php


注:本文中的CUtils::format_Number方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。