Approve New Projects

\n"; # # Of course verify that this uid has admin privs! # $query_result = mysql_db_query($TBDBNAME, "SELECT admin from users where uid='$uid' and admin='1'" ); if (! $query_result) { $err = mysql_error(); TBERROR("Database Error getting admin status for $uid: $err\n", 1); } if (mysql_num_rows($query_result) == 0) { USERERROR("You do not have admin privledges to approve projects!", 1); } # # Look in the projects table to see which projects have not been approved. # Present a menu of options to either approve or deny the projects. # Approving a project implies approving the project leader. Denying a project # implies denying the project leader account, when there is just a single # project pending for that project leader. # $query_result = mysql_db_query($TBDBNAME, "SELECT * from projects where approved='0'"); if (! $query_result) { $err = mysql_error(); TBERROR("Database Error getting unapproved project list: $err\n", 1); } if (mysql_num_rows($query_result) == 0) { USERERROR("There are no projects to approve!", 1); } echo "For each project waiting to be approved, you may select on of the following choices:
Deny - Deny project application (kills project records)
Destroy - Deny project application, and kill the user account
Approve - Approve the project
Postpone - Twiddle your thumbs some more
\n"; # # Now build a table with a bunch of selections. The thing to note about the # form inside this table is that the selection fields are constructed with # name= on the fly, from the uid of the user to be approved. In other words: # # project menu # name=testbed$$approval value=approve,deny,murder,postpone # # so that we can go through the entire list of post variables, looking # for these. The alternative is to work backwards, and I don't like that. # echo "\n"; echo "\n"; echo "\n"; while ($projectrow = mysql_fetch_array($query_result)) { $pid = $projectrow[pid]; $headuid = $projectrow[head_uid]; $Purl = $projectrow[URL]; $Pname = $projectrow[name]; $Paffil = $projectrow[affil]; $userinfo_result = mysql_db_query($TBDBNAME, "SELECT * from users where uid=\"$headuid\""); $row = mysql_fetch_array($userinfo_result); $name = $row[usr_name]; $email = $row[usr_email]; $title = $row[usr_title]; $affil = $row[usr_affil]; $addr = $row[usr_addr]; $addr2 = $row[usr_addr2]; $city = $row[usr_city]; $state = $row[usr_state]; $zip = $row[usr_zip]; $phone = $row[usr_phone]; echo "\n"; echo " \n"; echo "\n"; } echo "
Project User Action User Name Title User Affil E-mail
Proj Name URL Proj Affil Phone
$pid $headuid $name $title $affil $email
$Pname $Purl $Paffil $phone
\n"; ?>