showproject.php3 2.56 KB
Newer Older
1
<?php
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2 3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
5 6
# All rights reserved.
#
7
include("defs.php3");
8
include("showstuff.php3");
9

10 11 12 13 14 15
#
# Standard Testbed Header
#
PAGEHEADER("Show Project Information");


16 17 18 19 20 21 22 23 24 25
#
# Note the difference with which this page gets it arguments!
# I invoke it using GET arguments, so uid and pid are are defined
# without having to find them in URI (like most of the other pages
# find the uid).
#

#
# Only known and logged in users can end experiments.
#
26
$uid = GETLOGIN();
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
LOGGEDINORDIE($uid);

$isadmin = ISADMIN($uid);

#
# Verify form arguments.
# 
if (!isset($pid) ||
    strcmp($pid, "") == 0) {
    USERERROR("You must provide a project ID.", 1);
}

#
# Check to make sure thats this is a valid PID.
#
42 43
if (! TBValidProject($pid)) {
    USERERROR("The project '$pid' is not a valid project.", 1);
44 45 46
}

#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
47
# Verify that this uid is a member of the project being displayed.
48
#
49 50
if (! TBProjAccessCheck($uid, $pid, $pid, $TB_PROJECT_READINFO)) {
    USERERROR("You are not a member of Project $pid.", 1);
51 52
}

Chad Barb's avatar
 
Chad Barb committed
53 54
echo "<font size=+2>".
     "Project <b>$pid</b>".
Chad Barb's avatar
 
Chad Barb committed
55 56 57
     "</font>\n";
echo "<br /><br />\n";

58 59 60
#
# A list of project experiments.
#
61
SHOWEXPLIST("PROJ",$pid);
62

63
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
64
# A list of project members (from the default group).
65
#
66
SHOWGROUPMEMBERS($pid, $pid, 0);
67

Leigh B. Stoller's avatar
Leigh B. Stoller committed
68
#
69
# A list of project Groups
Leigh B. Stoller's avatar
Leigh B. Stoller committed
70
#
71 72 73 74 75 76 77 78 79 80 81
echo "<center>
      <h3>Project Groups</h3>\n";

SUBPAGESTART();
SUBMENUSTART("Project Options");
WRITESUBMENUBUTTON("Create Subgroup",
		   "newgroup_form.php3?pid=$pid");
WRITESUBMENUBUTTON("Show Project History",
		   "showstats.php3?showby=project&which=$pid");
SUBMENUEND();

Leigh B. Stoller's avatar
Leigh B. Stoller committed
82 83
$query_result =
    DBQueryFatal("SELECT * FROM groups WHERE pid='$pid'");
84 85 86 87 88 89 90 91 92 93 94
echo "<table align=center border=1>\n";
echo "<tr>
          <th>GID</th>
          <th>Desription</th>
          <th>Leader</th>
      </tr>\n";

while ($row = mysql_fetch_array($query_result)) {
    $gid      = $row[gid];
    $desc     = stripslashes($row[description]);
    $leader   = $row[leader];
Leigh B. Stoller's avatar
Leigh B. Stoller committed
95 96

    echo "<tr>
97 98 99
              <td><A href='showgroup.php3?pid=$pid&gid=$gid'>$gid</a></td>
              <td>$desc</td>
              <td><A href='showuser.php3?target_uid=$leader'>$leader</A></td>
Leigh B. Stoller's avatar
Leigh B. Stoller committed
100 101
          </tr>\n";
}
102 103
echo "</table>\n";
echo "</center>\n";
Leigh B. Stoller's avatar
Leigh B. Stoller committed
104

105
SUBPAGEEND();
106 107
SHOWPROJECT($pid, $uid);

108 109 110 111 112 113 114 115
if ($isadmin) {
    echo "<center>
          <h3>Project Stats</h3>
         </center>\n";

    SHOWPROJSTATS($pid);
}

116 117 118 119 120
if ($isadmin) {
    echo "<p>
          <A href='deleteproject.php3?pid=$pid'>
             <font color=Red>Delete this project?</font></a>\n";
}
121 122 123 124 125

#
# Standard Testbed Footer
# 
PAGEFOOTER();
126
?>