".$key."\n"; $sql = "SELECT ".xaxis_column("walltime").",COUNT(jobid) AS jobs, SUM(".cpuhours($db,$_POST['system']).") AS cpuhours, SUM(TIME_TO_SEC(cput))/3600.0 AS cpuhours_alt,MIN(TIME_TO_SEC(walltime)) AS hidden FROM Jobs WHERE system LIKE '".$_POST['system']."' AND username IS NOT NULL AND ( script IS NOT NULL AND "; if ( isset($pkgmatch[$key]) ) { $sql .= $pkgmatch[$key]; } else { $sql .= "script LIKE '%".$key."%' OR software LIKE '%".$key."%'"; } $sql .= " ) AND ( ".dateselect("start",$_POST['start_date'],$_POST['end_date'])." ) GROUP BY walltime UNION SELECT 'TOTAL:' AS walltime,COUNT(jobid) AS jobs, SUM(".cpuhours($db,$_POST['system']).") AS cpuhours, SUM(TIME_TO_SEC(cput))/3600.0 AS alt_cpuhours, 100000000 AS hidden FROM Jobs WHERE system LIKE '".$_POST['system']."' AND username IS NOT NULL AND ( "; if ( isset($pkgmatch[$key]) ) { $sql .= $pkgmatch[$key]; } else { $sql .= "script LIKE '%".$key."%' OR software LIKE '%".$key."%'"; } $sql .= " ) AND ( ".dateselect("start",$_POST['start_date'],$_POST['end_date'])." ) ORDER BY hidden;"; #echo "
".htmlspecialchars($sql)."
"; $result = db_query($db,$sql); if ( PEAR::isError($result) ) { echo "
".$result->getMessage()."
\n"; } echo "\n"; echo "\n"; while ($result->fetchInto($row)) { $rkeys=array_keys($row); echo ""; foreach ($rkeys as $rkey) { if ( $rkey!="hidden" ) { $data[$rkey]=array_shift($row); echo ""; } } echo "\n"; } echo "
walltimejobscpuhourscpuhours_alt
".$data[$rkey]."
\n"; } } db_disconnect($db); bookmarkable_url(); } else { begin_form("software-usage-by-walltime.php"); system_chooser(); date_fields(); checkboxes_from_array("Packages",$packages); end_form(); } page_footer(); ?>