Commit ab009f6b authored by Mac Newbold's avatar Mac Newbold
Browse files

Added counts of expts, projects.

parent 54d9ba49
......@@ -25,7 +25,7 @@ $isadmin = ISADMIN($uid);
#
if ($isadmin) {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects order by pid");
"SELECT pid,head_uid,name,approved FROM projects order by pid");
}
else {
$query_result = mysql_db_query($TBDBNAME,
......@@ -52,6 +52,8 @@ echo "<tr>
<td>Project Info</td>
<td>Name</td>
<td>Leader</td>
<td>Expts</td>
<td>Nodes</td>
<td align=center>Approved?</td>\n";
#
......@@ -67,13 +69,25 @@ while ($projectrow = mysql_fetch_array($query_result)) {
$headuid = $projectrow[head_uid];
$Pname = $projectrow[name];
$approved = $projectrow[approved];
echo "<tr>
<td><A href='showproject.php3?pid=$pid'>$pid</A></td>
<td>$Pname</td>
<td><A href='showuser.php3?target_uid=$headuid'>
$headuid</A></td>\n";
if ($isadmin) {
$count1 = mysql_db_query($TBDBNAME,
"SELECT count(*) FROM experiments where pid='$pid'");
$row1 = mysql_fetch_array($count1);
$count2 = mysql_db_query($TBDBNAME,
"SELECT count(*) FROM reserved where pid='$pid'");
$row2 = mysql_fetch_array($count2);
if ($row1[0] > 0) {
echo "<td>$row1[0]</td><td>$row2[0]</td>\n";
} else { echo "<td>&nbsp;</td><td>&nbsp;</td>\n"; }
}
if ($approved) {
echo "<td align=center><img alt=\"Y\" src=\"greenball.gif\"></td>\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