approveproject_form.php3 5.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<html>
<head>
<title>New Project Approval</title>
<link rel='stylesheet' href='tbstyle.css' type='text/css'>
</head>
<body>
<?php
include("defs.php3");

#
# Only known and logged in users can do this.
#
LOGGEDINORDIE($uid);

#
# Of course verify that this uid has admin privs!
#
18 19
$isadmin = ISADMIN($uid);
if (! $isadmin) {
20 21 22
    USERERROR("You do not have admin privledges to approve projects!", 1);
}

23 24
echo "<center><h1>Approve a Project</h1></center>\n";

25
#
26
# Check to make sure thats this is a valid PID.
27 28
#
$query_result = mysql_db_query($TBDBNAME,
29
	"SELECT * FROM projects WHERE pid=\"$pid\"");
30
if (mysql_num_rows($query_result) == 0) {
31
  USERERROR("The project $pid is not a valid project.", 1);
32
}
33 34
$row = mysql_fetch_array($query_result);

35

36
echo "<center><h3>You have the following choices:</h3></center>
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
      <table align=center border=0>
        <tr>
            <td>Deny</td>
            <td>-</td>
            <td>Deny project application (kills project records)</td>
        </tr>

        <tr>
            <td>Destroy</td>
            <td>-</td>
            <td>Deny project application, and kill the user account</td>
        </tr>

        <tr>
            <td>Approve</td>
            <td>-</td>
            <td>Approve the project</td>
        </tr>

56 57 58 59 60 61
        <tr>
            <td>More Info</td>
            <td>-</td>
            <td>Ask for more info</td>
        </tr>

62 63 64 65 66 67 68
        <tr>
            <td>Postpone</td>
            <td>-</td>
            <td>Twiddle your thumbs some more</td>
        </tr>
      </table>\n";

69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
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_pcs       = $row[num_pcs];
$proj_sharks    = $row[num_sharks];
$proj_why       = $row[why];
$control_node	= $row[control_node];

84
#
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
# 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>#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 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_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>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";

194
#
195
# Now put up the menu choice along with a text box for an email message.
196
#
197 198 199 200 201
echo "<center>
      <h3>What would you like to do?</h3>
      </center>
      <table align=center border=1>
      <form action='approveproject.php3?uid=$uid&pid=$pid' method='post'>\n";
202 203

echo "<tr>
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
          <td align=center>
              <select name=approval>
                      <option value='postpone'>Postpone</option>
                      <option value='approve'>Approve</option>
                      <option value='moreinfo'>More Info</option>
                      <option value='deny'>Deny</option>
                      <option value='destroy'>Destroy</option>
              </select>
          </td>
       </tr>\n";


echo "<tr>
          <td>Use the text box to add a message to the email notification.</td>
      </tr>\n";

220
echo "<tr>
221 222 223 224 225 226 227
         <td align=center class=left>
             <textarea name=message rows=5 cols=60></textarea>
         </td>
      </tr>\n";

echo "<tr>
          <td align=center colspan=2>
228 229 230 231 232 233 234
              <b><input type='submit' value='Submit' name='OK'></td>
      </tr>
      </form>
      </table>\n";
?>
</body>
</html>