]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bacula-web/jobs.php
bacula-web: Renamed php class Utils to CUtils
[bacula/bacula] / gui / bacula-web / jobs.php
index 196cc30049498fd9cb7f0ce62f97a9d9917e834f..665d8be8c334eb9b86dcfbedb1443a75dfe4ee94 100644 (file)
@@ -1,4 +1,19 @@
 <?php
+/* 
++-------------------------------------------------------------------------+
+| 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             |
+| as published by the Free Software Foundation; either version 2          |
+| of the License, or (at your option) any later version.                  |
+|                                                                         |
+| This program is distributed in the hope that it will be useful,         |
+| but WITHOUT ANY WARRANTY; without even the implied warranty of          |
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
+| GNU General Public License for more details.                            |
++-------------------------------------------------------------------------+ 
+*/
   session_start();
   include_once( 'config.inc.php' );
 
                        $job['Job_classe'] = 'odd';
                
                // Elapsed time for the job
-               if( $job['StartTime'] == '0000-00-00 00:00:00' )
-                       $job['elapsed_time'] = 'N/A';
-               elseif( $job['EndTime'] == '0000-00-00 00:00:00' )
-                       $job['elapsed_time'] = $dbSql->Get_ElapsedTime( strtotime($job['StartTime']), mktime() );
-               else
-                       $job['elapsed_time'] = $dbSql->Get_ElapsedTime( strtotime($job['StartTime']), strtotime($job['EndTime']) );
-
+               $start = $job['StartTime'];
+               $end   = $job['EndTime'];
+               
+               // Job execution execution time
+               $job['elapsed_time'] = TimeUtils::Get_Elapsed_Time( $start, $end);
                // Job Level
         $job['Level'] = $job_level[ $job['Level'] ];
-               
                // Job Size
-               $job['JobBytes'] = $dbSql->human_file_size( $job['JobBytes'] );
+               $job['JobBytes'] = CUtils::Get_Human_Size( $job['JobBytes'] );
 
                array_push( $last_jobs, $job);
          }