- Timestamp:
- 06/07/05 11:02:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/overview.php
r127 r128 51 51 $seconds = $time_fields[2]; 52 52 53 $myepoch = intval( $seconds + (intval( $minutes * 60 )) + (intval( $hours * 3600 )) ); 54 return $myepoch; 55 } 53 } else if( count($time_fields) == 2 ) { 54 55 $hours = 0; 56 $minutes = $time_fields[0]; 57 $seconds = $time_fields[1]; 58 59 } else if( count($time_fields) == 1 ) { 60 61 $hours = 0; 62 $minutes = 0; 63 $seconds = $time_fields[0]; 64 } 65 66 $myepoch = intval( $seconds + (intval( $minutes * 60 )) + (intval( $hours * 3600 )) ); 67 68 return $myepoch; 56 69 } 57 70 … … 59 72 60 73 $days = intval( $time / 86400 ); 61 $time = $days ? $time % ($days * 86400) : $time; 74 $time = ($days>0) ? $time % ($days * 86400) : $time; 75 76 //printf( "time = %s, days = %s\n", $time, $days ); 77 78 $date_str = ''; 79 $day_str = ''; 62 80 63 81 if( $days > 0 ) { 64 82 if( $days > 1 ) 65 $da te_str .= $days . ' days -';83 $day_str .= $days . ' days'; 66 84 else 67 $da te_str .= $days . ' day -';85 $day_str .= $days . ' day'; 68 86 } 69 87 … … 71 89 $time = $hours ? $time % ($hours * 3600) : $time; 72 90 91 //printf( "time = %s, days = %s, hours = %s\n", $time, $days, $hours ); 92 73 93 if( $hours > 0 ) { 74 94 $date_str .= $hours . ':'; 75 $date_unit = ' 95 $date_unit = 'hours'; 76 96 } 77 97 … … 87 107 88 108 $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit; 89 } else if( $days > 0 or $hours > 0 ) { 90 $date_str .= '00:'; 91 $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit; 92 } 109 } else { 110 if($hours > 0 ) { 111 $date_str .= '00:'; 112 $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit; 113 } 114 } 115 93 116 94 117 $date_unit = (!isset($date_unit)) ? 'seconds' : $date_unit; … … 101 124 $date_str .= '0' . $seconds . ' ' . $date_unit; 102 125 103 } else if ( $days > 0 or $hours > 0 or $minutes > 0 ) 126 } else if ( $hours > 0 or $minutes > 0 ) 127 104 128 $date_str .= '00 ' . $date_unit; 129 130 if( $days > 0) { 131 132 if( $hours > 0 or $minutes > 0 or $seconds > 0 ) 133 $date_str = $day_str . ' - ' . $date_str; 134 else 135 $date_str = $day_str; 136 } 105 137 106 138 return $date_str; … … 351 383 352 384 case "req_cpu": 353 $sorted[$jobid] = $req_cpu;385 $sorted[$jobid] = timeToEpoch( $req_cpu ); 354 386 break; 355 387 … … 380 412 } 381 413 382 uasort( $sorted, $cmp ); 414 //uasort( $sorted, $cmp ); 415 if( $sortorder == "asc" ) 416 arsort( $sorted ); 417 else if( $sortorder == "desc" ) 418 asort( $sorted ); 383 419 384 420 return $sorted;
Note: See TracChangeset
for help on using the changeset viewer.