]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bacula-web/bweb.inc.php
bacula-web: New Stored bytes graph in main layout
[bacula/bacula] / gui / bacula-web / bweb.inc.php
index 9e425595b5ccfca0d93d243e1ff13cc133136e3f..d943d955527d9c651c180455104125e57551579a 100644 (file)
@@ -584,5 +584,18 @@ class Bweb extends DB {
                        }
                }
                
+               public function GetStoredBytesByInterval( $start_date, $end_date )
+               {
+                       $query = "SELECT SUM(JobBytes) as stored_bytes, EndTime FROM Job WHERE EndTime BETWEEN '$start_date' AND '$end_date'";
+                       
+                       $result = $this->db_link->query( $query );
+                       
+                       if( PEAR::isError( $result ) ) {
+                               die( "Unable to get Job Bytes from catalog" );
+                       }else{
+                               $tmp = $result->fetchRow( DB_FETCHMODE_ASSOC );
+                               return array( $tmp['EndTime'], $tmp['stored_bytes'] );
+                       }
+               }
 } // end class Bweb
 ?>