}
// Media used bytes in a human format
$media['volbytes'] = $this->human_file_size( $media['volbytes'] );
- //echo "volume " . $media['volumename'] . 'vol bytes' .$media['volbytes'] . '<br />';
} else {
$media['lastwritten'] = "N/A";
$media['expire'] = "N/A";
$media['volbytes'] = "0 KB";
}
+
+ // Odd or even row
+ if( count( $volumes[ $pool['name'] ] ) % 2)
+ $media['class'] = 'odd';
+
// Add the media in pool array
array_push( $volumes[ $pool['name']], $media);
}
$where_status = "JobStatus = 'T' ";
break;
case 'failed':
- $where_status = "JobStatus = 'f' ";
+ $where_status = "JobStatus IN ('f','E') ";
break;
case 'canceled':
$where_status = "JobStatus = 'A' ";
break;
+ case 'waiting':
+ $where_status = "JobStatus IN ('F','S','M','m','s','j','c','d','t') ";
+ break;
} // end switch
}
return array( $day, $stored_bytes );
}
}
+
+ public function GetStoredBytesByJob( $jobname, $start_date, $end_date )
+ {
+ $query = "SELECT SUM(JobBytes) as stored_bytes, EndTime FROM Job ";
+ $query .= "WHERE ( EndTime BETWEEN '$start_date' AND '$end_date' ) AND ";
+ $query .= "Name = '$jobname'";
+
+ echo 'query ' . $query . '<br />';
+
+ $result = $this->db_link->query( $query );
+
+ if( PEAR::isError( $result ) ) {
+ die( "Unable to get Job Bytes from catalog" );
+ }else{
+ $stored_bytes = 0;
+ $tmp = $result->fetchRow( DB_FETCHMODE_ASSOC );
+
+ $day = date( "D d", strtotime($end_date) );
+
+ if( isset( $tmp['stored_bytes'] ) ) {
+ $hbytes = $this->human_file_size( $tmp['stored_bytes'], 3, 'GB');
+ $hbytes = explode( " ", $hbytes );
+ $stored_bytes = $hbytes[0];
+ }
+
+ return array( $day, $stored_bytes );
+ }
+ }
} // end class Bweb
?>