Commit 2479a97b authored by Leigh B. Stoller's avatar Leigh B. Stoller

Another quickie; Add a show projects information page. At the same time,

move the project information listing from approveproject, and make it
useable from there and from the showproject stuff, but making it a simple
include file.
parent 22c34b36
......@@ -30,8 +30,6 @@ $query_result = mysql_db_query($TBDBNAME,
if (mysql_num_rows($query_result) == 0) {
USERERROR("The project $pid is not a valid project.", 1);
}
$row = mysql_fetch_array($query_result);
echo "<center><h3>You have the following choices:</h3></center>
<table align=center border=0>
......@@ -66,147 +64,10 @@ echo "<center><h3>You have the following choices:</h3></center>
</tr>
</table>\n";
echo "<center>
<h3>Project Information</h3>
</center>
<table align=center border=1>\n";
$proj_created = $row[created];
$proj_expires = $row[expires];
$proj_name = $row[name];
$proj_URL = $row[URL];
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
$proj_sharks = $row[num_sharks];
$proj_why = $row[why];
$control_node = $row[control_node];
#
# Generate the table.
#
echo "<tr>
<td>Name: </td>
<td class=\"left\">$pid</td>
</tr>\n";
echo "<tr>
<td>Long Name: </td>
<td class=\"left\">$proj_name</td>
</tr>\n";
echo "<tr>
<td>Project Head: </td>
<td class=\"left\">$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>URL: </td>
<td class=\"left\">
<A href='$proj_URL'>$proj_URL</A></td>
</tr>\n";
echo "<tr>
<td>#Project Members: </td>
<td class=\"left\">$proj_members</td>
</tr>\n";
echo "<tr>
<td>#PCs: </td>
<td class=\"left\">$proj_pcs</td>
</tr>\n";
echo "<tr>
<td>#Sharks: </td>
<td class=\"left\">$proj_sharks</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=\"left\">$proj_created</td>
</tr>\n";
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$proj_expires</td>
</tr>\n";
echo "<tr>
<td colspan='2'>Why?</td>
</tr>\n";
echo "<tr>
<td colspan='2' width=600>$proj_why</td>
</tr>\n";
echo "</table>\n";
$userinfo_result = mysql_db_query($TBDBNAME,
"SELECT * from users where uid=\"$proj_head_uid\"");
$row = mysql_fetch_array($userinfo_result);
$usr_expires = $row[usr_expires];
$usr_email = $row[usr_email];
$usr_URL = $row[usr_URL];
$usr_addr = $row[usr_addr];
$usr_name = $row[usr_name];
$usr_phone = $row[usr_phone];
$usr_passwd = $row[usr_pswd];
$usr_title = $row[usr_title];
$usr_affil = $row[usr_affil];
echo "<center>
<h3>Project Leader Information</h3>
</center>
<table align=center border=1>\n";
echo "<tr>
<td>Username:</td>
<td>$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>Full Name:</td>
<td>$usr_name</td>
</tr>\n";
echo "<tr>
<td>Email Address:</td>
<td>$usr_email</td>
</tr>\n";
echo "<tr>
<td>Home Page URL:</td>
<td><A href='$usr_URL'>$usr_URL</A></td>
</tr>\n";
echo "<tr>
<td>Expiration date:</td>
<td>$usr_expires</td>
</tr>\n";
echo "<tr>
<td>Mailing Address:</td>
<td>$usr_addr</td>
</tr>\n";
echo "<tr>
<td>Phone #:</td>
<td>$usr_phone</td>
</tr>\n";
echo "<tr>
<td>Title/Position:</td>
<td>$usr_title</td>
</tr>\n";
echo "<tr>
<td>Institutional Affiliation:</td>
<td>$usr_affil</td>
</tr>\n";
echo "</table>\n";
# This will spit out the info.
#
include("showproject_dump.php3");
#
# Now put up the menu choice along with a text box for an email message.
......
......@@ -99,6 +99,8 @@ if (isset($uid)) {
if ($admin) {
echo "<A href='approveproject_list.php3?uid=$uid'>
New Project Approval</A><p>\n";
echo "<A href='showproject_list.php3?uid=$uid'>
Project Information</A><p>\n";
echo "<A href='nodecontrol_list.php3?uid=$uid'>
Node Control</A><p>\n";
}
......
......@@ -37,7 +37,6 @@ $query_result = mysql_db_query($TBDBNAME,
if (mysql_num_rows($query_result) == 0) {
USERERROR("The project $pid is not a valid project.", 1);
}
$row = mysql_fetch_array($query_result);
#
# Verify that this uid is a member of the project for the experiment
......@@ -51,80 +50,7 @@ if (!$isadmin) {
}
}
echo "<center>
<h3>Project Information</h3>
</center>
<table align=center border=1>\n";
$proj_created = $row[created];
$proj_expires = $row[expires];
$proj_name = $row[name];
$proj_URL = $row[URL];
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
$proj_sharks = $row[num_sharks];
$proj_why = $row[why];
$control_node = $row[control_node];
#
# Generate the table.
#
echo "<tr>
<td>Name: </td>
<td class=\"left\">$pid</td>
</tr>\n";
echo "<tr>
<td>Long Name: </td>
<td class=\"left\">$proj_name</td>
</tr>\n";
echo "<tr>
<td>Project Head: </td>
<td class=\"left\">$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>URL: </td>
<td class=\"left\">
<A href='$proj_URL'>$proj_URL</A></td>
</tr>\n";
echo "<tr>
<td>#Project Members: </td>
<td class=\"left\">$proj_members</td>
</tr>\n";
echo "<tr>
<td>#PCs: </td>
<td class=\"left\">$proj_pcs</td>
</tr>\n";
echo "<tr>
<td>#Sharks: </td>
<td class=\"left\">$proj_sharks</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=\"left\">$proj_created</td>
</tr>\n";
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$proj_expires</td>
</tr>\n";
echo "<tr>
<td colspan='2'>Why?</td>
</tr>\n";
echo "<tr>
<td colspan='2' width=600>$proj_why</td>
</tr>\n";
echo "</table>\n";
include("showproject_dump.php3");
?>
</center>
......
<?php
#
# This is an included file.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects WHERE pid=\"$pid\"");
if (mysql_num_rows($query_result) == 0) {
USERERROR("The project $pid is not a valid project.", 1);
}
$row = mysql_fetch_array($query_result);
echo "<center>
<h3>Project Information</h3>
</center>
<table align=center border=1>\n";
$proj_created = $row[created];
$proj_expires = $row[expires];
$proj_name = $row[name];
$proj_URL = $row[URL];
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
$proj_pcs = $row[num_pcs];
$proj_sharks = $row[num_sharks];
$proj_why = $row[why];
$control_node = $row[control_node];
#
# Generate the table.
#
echo "<tr>
<td>Name: </td>
<td class=\"left\">$pid</td>
</tr>\n";
echo "<tr>
<td>Long Name: </td>
<td class=\"left\">$proj_name</td>
</tr>\n";
echo "<tr>
<td>Project Head: </td>
<td class=\"left\">$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>URL: </td>
<td class=\"left\">
<A href='$proj_URL'>$proj_URL</A></td>
</tr>\n";
echo "<tr>
<td>#Project Members: </td>
<td class=\"left\">$proj_members</td>
</tr>\n";
echo "<tr>
<td>#PCs: </td>
<td class=\"left\">$proj_pcs</td>
</tr>\n";
echo "<tr>
<td>#Sharks: </td>
<td class=\"left\">$proj_sharks</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=\"left\">$proj_created</td>
</tr>\n";
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$proj_expires</td>
</tr>\n";
echo "<tr>
<td colspan='2'>Why?</td>
</tr>\n";
echo "<tr>
<td colspan='2' width=600>$proj_why</td>
</tr>\n";
echo "</table>\n";
$userinfo_result = mysql_db_query($TBDBNAME,
"SELECT * from users where uid=\"$proj_head_uid\"");
$row = mysql_fetch_array($userinfo_result);
$usr_expires = $row[usr_expires];
$usr_email = $row[usr_email];
$usr_URL = $row[usr_URL];
$usr_addr = $row[usr_addr];
$usr_name = $row[usr_name];
$usr_phone = $row[usr_phone];
$usr_passwd = $row[usr_pswd];
$usr_title = $row[usr_title];
$usr_affil = $row[usr_affil];
echo "<center>
<h3>Project Leader Information</h3>
</center>
<table align=center border=1>\n";
echo "<tr>
<td>Username:</td>
<td>$proj_head_uid</td>
</tr>\n";
echo "<tr>
<td>Full Name:</td>
<td>$usr_name</td>
</tr>\n";
echo "<tr>
<td>Email Address:</td>
<td>$usr_email</td>
</tr>\n";
echo "<tr>
<td>Home Page URL:</td>
<td><A href='$usr_URL'>$usr_URL</A></td>
</tr>\n";
echo "<tr>
<td>Expiration date:</td>
<td>$usr_expires</td>
</tr>\n";
echo "<tr>
<td>Mailing Address:</td>
<td>$usr_addr</td>
</tr>\n";
echo "<tr>
<td>Phone #:</td>
<td>$usr_phone</td>
</tr>\n";
echo "<tr>
<td>Title/Position:</td>
<td>$usr_title</td>
</tr>\n";
echo "<tr>
<td>Institutional Affiliation:</td>
<td>$usr_affil</td>
</tr>\n";
echo "</table>\n";
#
# This is an included file.
#
?>
<html>
<head>
<title>Show Experiment Information</title>
<link rel="stylesheet" href="tbstyle.css" type="text/css">
</head>
<body>
<?php
include("defs.php3");
#
# Only known and logged in users can end experiments.
#
#
# Only known and logged in users can end experiments.
#
LOGGEDINORDIE($uid);
#
# Admin users can do this.
#
$isadmin = ISADMIN($uid);
if (! $isadmin) {
USERERROR("You do not have admin privledges!", 1);
}
#
# Show a menu of all projects.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT pid FROM projects");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error getting project list: $err\n", 1);
}
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no projects!", 1);
}
while ($projectrow = mysql_fetch_array($query_result)) {
$pid = $projectrow[pid];
$headuid = $projectrow[head_uid];
$Purl = $projectrow[URL];
$Pname = $projectrow[name];
$Paffil = $projectrow[affil];
}
#
# Lets see if the user is even part of any experiements before
# presenting a bogus option list.
#
$experiments = "";
while ($projrow = mysql_fetch_array($projmemb_result)) {
$pid = $projrow[pid];
$exp_result = mysql_db_query($TBDBNAME,
"SELECT eid FROM experiments WHERE pid=\"$pid\"");
while ($exprow = mysql_fetch_array($exp_result)) {
$eid = $exprow[eid];
$experiments = "$experiments " .
"<option value=\"$pid\$\$$eid\">$pid/$eid</option>\n";
}
}
if (strcmp($experiments, "") == 0) {
USERERROR("There are no experiments running in any of the projects ".
"you are a member of.", 1);
}
?>
<center>
<h1>Experiment Information Selection</h1>
<h2>Select an experiment from the list below.<br>
These are the experiments in the projects
you are a member of.</h2>
<table align="center" border="1">
<?php
echo "<form action=\"showexp.php3?$uid\" method=\"post\">";
echo "<tr>
<td align='center'>Project/Experiment</td>
</tr>\n";
echo "<tr></tr>";
echo "<tr></tr>";
#
# Suck the current info out of the database and display a list of
# experiments as an option list.
#
echo "<tr>";
echo " <td><select name=\"exp_pideid\">";
echo " $experiments";
echo " </select>";
echo " </td>
</tr>\n";
?>
<td align="center">
<b><input type="submit" value="Submit"></b></td></tr>
</form>
</table>
</center>
</body>
</html>
<html>
<head>
<title>Show Experiment Information</title>
<link rel="stylesheet" href="tbstyle.css" type="text/css">
</head>
<body>
<?php
include("defs.php3");
#
# Only known and logged in users can end experiments.
#
#
# Only known and logged in users can end experiments.
#
LOGGEDINORDIE($uid);
#
# Admin users can do this.
#
$isadmin = ISADMIN($uid);
if (! $isadmin) {
USERERROR("You do not have admin privledges!", 1);
}
#
# Show a menu of all projects.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error getting project list: $err\n", 1);
}
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no projects!", 1);
}
echo "<center><h3>
Project List
</h3></center>\n";
echo "<table width=\"100%\" border=2 cellpadding=0 cellspacing=2
align='center'>\n";
echo "<tr>
<td>Project Info</td>
<td>Name</td>
<td>Leader</td>
<td>Affiliation</td>
</tr>\n";
while ($projectrow = mysql_fetch_array($query_result)) {
$pid = $projectrow[pid];
$headuid = $projectrow[head_uid];
$Pname = $projectrow[name];
$Paffil = $projectrow[affil];
echo "<tr>
<td><A href='showproject.php3?uid=$uid&pid=$pid'>$pid</A></td>
<td>$Pname</td>
<td>$headuid</td>
<td>$Paffil</td>
</tr>\n";
}
echo "</table>\n";
?>
</body>
</html>
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