Commit 642a1672 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Mike Nit: Show number of nodes used per experiment in the My.Emulab

page.
parent 3389881e
...@@ -70,29 +70,34 @@ if ($yourpcs) { ...@@ -70,29 +70,34 @@ if ($yourpcs) {
# Lets show Experiments. # Lets show Experiments.
# #
$query_result = $query_result =
DBQueryFatal("select * from experiments ". DBQueryFatal("select e.*,count(r.node_id) from experiments as e ".
"where expt_head_uid='$target_uid' order by pid,eid"); "left join reserved as r on e.pid=r.pid and e.eid=r.eid ".
"where expt_head_uid='$target_uid' ".
"group by e.pid,e.eid");
if (mysql_num_rows($query_result)) { if (mysql_num_rows($query_result)) {
echo "<center> echo "<center>
<h3>Current Experiments</h3> <h3>Current Experiments</h3>
</center> </center>
<table align=center border=1 cellpadding=1 cellspacing=2>\n"; <table align=center border=1 cellpadding=2 cellspacing=2>\n";
echo "<tr> echo "<tr>
<td align=center>PID</td> <td align=center>PID</td>
<td align=center>EID</td> <td align=center>EID</td>
<td align=center>Name</td> <td align=center>Nodes</td>
<td align=center>Description</td>
</tr>\n"; </tr>\n";
while ($projrow = mysql_fetch_array($query_result)) { while ($projrow = mysql_fetch_array($query_result)) {
$pid = $projrow[pid]; $pid = $projrow[pid];
$eid = $projrow[eid]; $eid = $projrow[eid];
$nodes= $projrow["count(r.node_id)"];
$name = $projrow[expt_name]; $name = $projrow[expt_name];
echo "<tr> echo "<tr>
<td><A href='showproject.php3?pid=$pid'>$pid</A></td> <td><A href='showproject.php3?pid=$pid'>$pid</A></td>
<td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td> <td><A href='showexp.php3?pid=$pid&eid=$eid'>$eid</A></td>
<td>$nodes</td>
<td>$name</td> <td>$name</td>
</tr>\n"; </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