]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bacula-web/index.php
bacula-web: Improved stored bytes graph and modified dashboard design
[bacula/bacula] / gui / bacula-web / index.php
index 31562cab77c37baf609fb28ad8fe599ab401beb6..1c8b01dd57176b0c18058789cbbb3c3b070dfd7d 100644 (file)
@@ -220,23 +220,19 @@ foreach( $pools as $pool ) {
        array_push( $data, $dbSql->GetPoolsStatistics( $pool ) );
 }
 
-echo '<pre>';
-var_dump( $data );
-echo '</pre>';
-
 $graph->SetData( $data, 'pie', 'text-data-single' );
 $graph->SetGraphSize( 400, 230 );
 
 $graph->Render();
 $smarty->assign('graph_pools', $graph->Get_Image_file() );
 
-// Stored Bytes last 7 days
+// Last 7 days stored Bytes graph
 $data  = array();
 $graph = new BGraph( "graph2.png" );
 $days  = array();
 
 // Get the last 7 days interval (start and end)
-for( $c = 0 ; $c < 7 ; $c++ ) {
+for( $c = 6 ; $c >= 0 ; $c-- ) {
        $today = ( mktime() - ($c * 86400) );
        array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) );
 }
@@ -247,14 +243,6 @@ foreach( $days as $day ) {
   array_push( $days_stored_bytes, $dbSql->GetStoredBytesByInterval( $day['start'], $day['end'] ) );
 }
 
-//echo '<pre>';
-//var_dump( $days );
-//echo '</pre>';
-
-echo '<pre>';
-var_dump( $days_stored_bytes );
-echo '</pre>';
-
 $graph->SetData( $days_stored_bytes, 'bars', 'text-data' );
 $graph->SetGraphSize( 400, 230 );