Commit 6470ae4e authored by Mac Newbold's avatar Mac Newbold

Add an "hours idle" column to the expt displays on the user, group, and

project pages. Also fix the group one to be more consistent with the
others.
parent 2b0a5286
......@@ -107,24 +107,43 @@ if (TBProjAccessCheck($uid, $pid, $gid, $TB_PROJECT_EDITGROUP) ||
# A list of Group experiments.
#
$query_result =
DBQueryFatal("SELECT eid,expt_name FROM experiments ".
"WHERE pid='$pid' and gid='$gid'");
DBQueryFatal("select e.*,count(r.node_id) as nodes from experiments as e ".
"left join reserved as r on e.pid=r.pid and e.eid=r.eid ".
"where e.gid='$gid' ".
"group by e.eid order by e.state,e.eid");
if (mysql_num_rows($query_result)) {
echo "<center>
<h3>Group Experiments</h3>
</center>
<table align=center border=1>\n";
while ($row = mysql_fetch_row($query_result)) {
$eid = $row[0];
$name = stripslashes($row[1]);
echo "<tr>
<th>EID</th>
<th>State</th>
<th align=center>Nodes</th>
<th align=center>Hours Idle</th>
<th>Description</th>
</tr>\n";
while ($row = mysql_fetch_array($query_result)) {
$eid = $row[eid];
$name = stripslashes($row[expt_name]);
$state= $row[state];
$nodes= $row[nodes];
$idlehours = TBGetExptIdleTime($pid,$eid);
if ($idlehours == -1) { $idlehours = "&nbsp;"; }
if (!$name)
$name = "--";
if ($row[swap_requests] > 0) {
$state .= "&nbsp;(idle)";
}
echo "<tr>
<td>
<A href='showexp.php3?pid=$pid&eid=$eid'>$eid</a>
</td>
<td>$name</td>
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</a></td>
<td>$state</td>
<td align=center>$nodes</td>
<td align=center>$idlehours</td>
<td>$name</td>
</tr>\n";
}
echo "</table>\n";
......
......@@ -59,7 +59,7 @@ echo "<br /><br />\n";
# A list of project experiments.
#
$query_result =
DBQueryFatal("select e.*,count(r.node_id) from experiments as e ".
DBQueryFatal("select e.*,count(r.node_id) as nodes from experiments as e ".
"left join reserved as r on e.pid=r.pid and e.eid=r.eid ".
"where e.pid='$pid' ".
"group by e.eid order by e.state,e.eid");
......@@ -73,14 +73,17 @@ if (mysql_num_rows($query_result)) {
echo "<tr>
<th>EID</th>
<th>State</th>
<th>Nodes</th>
<th align=center>Nodes</th>
<th align=center>Hours Idle</th>
<th>Description</th>
</tr>\n";
while ($projrow = mysql_fetch_array($query_result)) {
$eid = $projrow[eid];
$state= $projrow[state];
$nodes= $projrow["count(r.node_id)"];
$nodes= $projrow[nodes];
$idlehours = TBGetExptIdleTime($pid,$eid);
if ($idlehours == -1) { $idlehours = "&nbsp;"; }
$name = stripslashes($projrow[expt_name]);
if ($projrow[swap_requests] > 0) {
$state .= "&nbsp;(idle)";
......@@ -89,7 +92,8 @@ if (mysql_num_rows($query_result)) {
echo "<tr>
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td>
<td>$state</td>
<td>$nodes</td>
<td align=center>$nodes</td>
<td align=center>$idlehours</td>
<td>$name</td>
</tr>\n";
}
......
......@@ -86,11 +86,12 @@ if (mysql_num_rows($query_result)) {
<table align=center border=1 cellpadding=2 cellspacing=2>\n";
echo "<tr>
<th align=center>PID</td>
<th align=center>EID</td>
<th align=center>State</td>
<th align=center>Nodes</td>
<th align=center>Description</td>
<th>PID</th>
<th>EID</th>
<th>State</th>
<th align=center>Nodes</th>
<th align=center>Hours Idle</th>
<th>Description</th>
</tr>\n";
while ($projrow = mysql_fetch_array($query_result)) {
......@@ -98,6 +99,8 @@ if (mysql_num_rows($query_result)) {
$eid = $projrow[eid];
$state= $projrow[state];
$nodes= $projrow["count(r.node_id)"];
$idlehours = TBGetExptIdleTime($pid,$eid);
if ($idlehours == -1) { $idlehours = "&nbsp;"; }
$name = stripslashes($projrow[expt_name]);
if ($projrow[swap_requests] > 0) {
$state .= "&nbsp;(idle)";
......@@ -107,7 +110,8 @@ if (mysql_num_rows($query_result)) {
<td><A href='showproject.php3?pid=$pid'>$pid</A></td>
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td>
<td>$state</td>
<td>$nodes</td>
<td align=center>$nodes</td>
<td align=center>$idlehours</td>
<td>$name</td>
</tr>\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment