]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Internal PHP code fix
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 10 Jan 2011 10:22:42 +0000 (11:22 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:35 +0000 (14:43 +0200)
 - Replaced 86400 values by LAST_DAY constant in bweb.inc.php, bgraph.inc.php and index.php

gui/bacula-web/bgraph.inc.php
gui/bacula-web/bweb.inc.php
gui/bacula-web/index.php

index 6b61bc21ea121c8445b83c1972a786bd03ba217b..6c8d98039c6515d478dc8db44b5d9cc7603ead2f 100644 (file)
@@ -241,7 +241,7 @@ class BCreateGraph extends BGraph {
         
                 $this->StartDate = "1900-01-01";
                 $this->EndDate = "4000-01-01";
-                $this->elapsed = "86400";                   // 24 hours in seconds.
+                $this->elapsed = LAST_DAY;                   // 24 hours in seconds.
                 
          }              
          
index 8087e35983d1a18289959b0c599871a9782f454b..528d1e1420ea6b2a12306c9e39a473069e60c33e 100644 (file)
@@ -457,7 +457,7 @@ class Bweb extends DB {
                                        $total_elapsed += $time['elapsed'];
                                }
                                // Verify if elapsed time is more than 1 day
-                               if ( $total_elapsed > 86400 ) {
+                               if ( $total_elapsed > LAST_DAY ) {
                                        return date("%d days H:i:s", $total_elapsed );
                                }else {
                                        return date("H:i:s", $total_elapsed );
index c4736bacd2effa564bf6610d57f489741e25ffd5..6bb00269845d555c2686ba7458223a89c0f4b72e 100644 (file)
@@ -147,7 +147,7 @@ $days  = array();
 
 // Get the last 7 days interval (start and end)
 for( $c = 6 ; $c >= 0 ; $c-- ) {
-       $today = ( mktime() - ($c * 86400) );
+       $today = ( mktime() - ($c * LAST_DAY) );
        array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) );
 }