]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Improved stored files graph code in backupjob report page
authorDavide Franco <bacula-dev@dflc.ch>
Sat, 9 Jul 2011 14:08:39 +0000 (16:08 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:22 +0000 (14:49 +0200)
gui/bacula-web/backupjob-report.php

index 1fe0974ebca58bb0ca1fdbabc11f5a4b2f87836b..fc58c915af121f50b4b0fc83dbf31bda701a8e9d 100644 (file)
@@ -43,7 +43,9 @@
   // Calculate total bytes for this period
   $backupjob_bytes = $dbSql->getStoredBytes( LAST_WEEK, NOW, $backupjob_name );
   $backupjob_bytes = CUtils::Get_Human_Size( $backupjob_bytes );
-       
+  
+  $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);
   // ===============================================================
   $graph = new CGraph("graph3.png" );
   \r
-  foreach( $days as $day )\r
-    array_push( $days_stored_files, $dbSql->GetStoredFilesByJob( $backupjob_name, $day['start'], $day['end'] ) );\r
+  foreach( $days as $day ) {
+       $stored_files            = $dbSql->getStoredFiles( $day['start'], $day['end'], $backupjob_name);
+       $days_stored_files[] = array( date("m-d", $day['start']), $stored_files );
+  }
 \r
-  // Calculate total files for this period     \r
-  foreach( $days_stored_files as $day )\r
-       $backupjob_files += $day[1];\r
-  \r
   $graph->SetData( $days_stored_files, 'bars', 'text-data' );\r
   $graph->SetGraphSize( 400, 230 );\r
   $graph->SetYTitle( "Files" );