<?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' );
// Determine icon for job status
switch( $job['JobStatus'] ) {
- case 'R':
+ case J_RUNNING:
$job['Job_icon'] = "running.png";
break;
- case 'T':
+ case J_COMPLETED:
$job['Job_icon'] = "ok.png";
break;
- case 'A':
+ case J_CANCELED:
$job['Job_icon'] = "canceled.png";
break;
- case 'E':
+ case J_COMPLETED_ERROR:
$job['Job_icon'] = "warning.png";
break;
- case 'f':
+ case J_FATAL:
$job['Job_icon'] = "error.png";
break;
- case 'F':
- case 'S':
- case 'M':
- case 'm':
- case 's':
- case 'j':
- case 'c':
- case 'd':
- case 't':
- case 'C':
+ case J_WAITING_CLIENT:
+ case J_WAITING_SD:
+ case J_WAITING_MOUNT_MEDIA:
+ case J_WAITING_NEW_MEDIA:
+ case J_WAITING_STORAGE_RES:
+ case J_WAITING_JOB_RES:
+ case J_WAITING_CLIENT_RES:
+ case J_WAITING_MAX_JOBS:
+ case J_WAITING_START_TIME:
+ case J_NOT_RUNNING:
$job['Job_icon'] = "waiting.png";
break;
} // end switch
$job['Job_classe'] = 'odd';
// Elapsed time for the job
- if( $job['StartTime'] == '0000-00-00 00:00:00' )
+ $start = $job['StartTime'];
+ $end = $job['EndTime'];
+
+ if( $start == '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() );
+ elseif( $end == '0000-00-00 00:00:00' )
+ $job['elapsed_time'] = TimeUtils::Get_Elapsed_Time( strtotime($start), mktime() );
else
- $job['elapsed_time'] = $dbSql->Get_ElapsedTime( strtotime($job['StartTime']), strtotime($job['EndTime']) );
+ $job['elapsed_time'] = TimeUtils::Get_Elapsed_Time( strtotime($start), strtotime($end) );
// Job Level
- $job['Level'] = $job_level[ $job['Level'] ];
+ $job['Level'] = $job_level[ $job['Level'] ];
// Job Size
- $job['JobBytes'] = $dbSql->human_file_size( $job['JobBytes'] );
+ $job['JobBytes'] = Utils::Get_Human_Size( $job['JobBytes'] );
array_push( $last_jobs, $job);
}