]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bacula-web/index.php
bacula-web: Replaced Get_human_file_size() function by Utils::Get_Human_Size
[bacula/bacula] / gui / bacula-web / index.php
index 806bc17183a0d56dc3e0680771dc1a76cc889748..b459a08a4c768ebf195b3999b6a2e7001b0eb452 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 /* 
 +-------------------------------------------------------------------------+
-| Copyright (C) 2004 Juan Luis Francés Jiménez                            |
+| Copyright (C) 2004 Juan Luis Francés Jiménez                                                   |
+| Copyright 2010-2011, Davide Franco                                             |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
@@ -19,10 +20,8 @@ include_once( 'config.inc.php' );
 
 $dbSql = new Bweb();
 
-$mode = "";                            
-
 // Assign to template catalogs number
-// $dbSql->tpl->assign( "dbs", $dbSql->Get_Nb_Catalogs() );
+//$dbSql->tpl->assign( "dbs", $dbSql->bwcfg->Count_Catalogs() );
 // Assign dbs
 /*
 if ( count($dbSql->dbs) >1 ) {
@@ -30,6 +29,9 @@ if ( count($dbSql->dbs) >1 ) {
   $smarty->assign("dbs_now", $_SESSION['DATABASE']);
 }
 */
+// Catalog count
+$catalog_nb = $dbSql->catalog_nb;
+$dbSql->tpl->assign( 'catalog_nb', $catalog_nb );
 
 // Stored files number 
 $totalfiles = $dbSql->GetStoredFiles( ALL );
@@ -40,11 +42,11 @@ $dbSql->tpl->assign('database_size', $dbSql->GetDbSize());
 
 // Overall stored bytes
 $result = $dbSql->GetStoredBytes( ALL );
-$dbSql->tpl->assign('stored_bytes', $dbSql->human_file_size($result['stored_bytes']) );
+$dbSql->tpl->assign('stored_bytes', Utils::Get_Human_Size( $result['stored_bytes'] ) );
 
 // Total stored bytes since last 24 hours
 $result = $dbSql->GetStoredBytes( LAST_DAY );
-$dbSql->tpl->assign('bytes_last', $dbSql->human_file_size($result['stored_bytes']) );
+$dbSql->tpl->assign('bytes_last', Utils::Get_Human_Size( $result['stored_bytes'] ) );
 
 // Total stored files since last 24 hours
 $files_last = $dbSql->GetStoredFiles( LAST_DAY );
@@ -101,7 +103,7 @@ $graph = new BGraph( "graph1.png" );
 $pools = $dbSql->Get_Pools_List();
 
 foreach( $pools as $pool ) {
-       array_push( $data, $dbSql->GetPoolsStatistics( $pool ) );
+       array_push( $data, $dbSql->CountVolumesByPool( $pool ) );
 }
 
 $graph->SetData( $data, 'pie', 'text-data-single' );