]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Improved code for last n days timestamp intervals generation
authorDavide Franco <bacula-dev@dflc.ch>
Sat, 9 Jul 2011 15:01:07 +0000 (17:01 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:22 +0000 (14:49 +0200)
gui/bacula-web/backupjob-report.php
gui/bacula-web/index.php

index fc58c915af121f50b4b0fc83dbf31bda701a8e9d..9b7d5fc6daf7ec1a0372ed123b9c9410a81348f6 100644 (file)
   $backupjob_files = $dbSql->getStoredFiles( LAST_WEEK, NOW, $backupjob_name );
   
   // Get the last 7 days interval (start and end)\r
-  for( $c = 6 ; $c >= 0 ; $c-- ) {\r
-         $today  = NOW - ($c * DAY);
-         $days[] = CTimeUtils::get_Day_Intervals($today);
-  }\r
+  $days = CTimeUtils::getLastDaysIntervals( 7 );
   
   // ===============================================================
   // Last 7 days stored Bytes graph\r
index 9b3ab978ff522dcf41bec26017d939cbaba879f1..63e464d1d900c877c350b2749e221579f938cc5e 100644 (file)
@@ -81,13 +81,7 @@ $graph->Render();
 $dbSql->tpl->assign('graph_pools', $graph->Get_Image_file() );
 
 // Last 7 days stored Bytes graph
-$days  = array();
-
-for( $c = 6 ; $c >= 0 ; $c-- ) {
-       $today  = NOW - ($c * DAY);
-       $days[] = CTimeUtils::get_Day_Intervals($today);
-}
-
+$days = CTimeUtils::getLastDaysIntervals( 7 );
 foreach( $days as $day ) {
        $stored_bytes            = $dbSql->getStoredBytes( $day['start'], $day['end']);
        $stored_bytes            = CUtils::Get_Human_Size( $stored_bytes, 1, 'GB', false );