Commit 6e11b74f authored by Leigh Stoller's avatar Leigh Stoller

Change more/less verbose option to show/hide events, as per Jay's

request.
parent b798592b
......@@ -1009,6 +1009,22 @@ function TBNodeUidLastLogin($node_id)
return $row;
}
#
# Return number of events in an experiment.
#
function TBEventCount($pid, $eid)
{
$query_result =
DBQueryFatal("select count(*) from eventlist ".
"where pid='$pid' and eid='$eid'");
if (mysql_num_rows($query_result) == 0) {
return 0;
}
$row = mysql_fetch_row($query_result);
return $row[0];
}
#
# Return the last login for all of the nodes in an experiment, but only
# after the experiment was created (swapped in).
......
......@@ -27,17 +27,6 @@ if (!isset($eid) ||
USERERROR("You must provide an Experiment ID.", 1);
}
if ($verbose) {
echo "<b><a href='shownsfile.php3?pid=$pid&eid=$eid'>
Be Less Verbose</a>
</b><br><br>\n";
}
else {
echo "<b><a href='shownsfile.php3?pid=$pid&eid=$eid&verbose=1'>
Be More Verbose</a>
</b><br><br>\n";
}
#
# Check to make sure this is a valid PID/EID tuple.
#
......@@ -64,6 +53,17 @@ if (!$isadmin) {
}
}
if ($showevents) {
echo "<b><a href='shownsfile.php3?pid=$pid&eid=$eid'>
Hide Event List</a>
</b><br><br>\n";
}
elseif (TBEventCount($pid, $eid)) {
echo "<b><a href='shownsfile.php3?pid=$pid&eid=$eid&showevents=1'>
Show Event List</a>
</b><br><br>\n";
}
#
# Spit out an image that refers to a php script. That script will run and
# send back the GIF image contents.
......@@ -97,7 +97,7 @@ echo "<br>
$output = array();
$retval = 0;
if ($verbose) {
if ($showevents) {
$flags = "-v";
}
else {
......
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