Copyright (C) 2005 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> 'committee_main.php', 'Administration' => 'admin/index.php') ); ?> "; echo "- ".i18n('Show Display Options').""; echo "
"; echo "
"; echo ""; $x = 0; foreach($user_what as $k=>$v ) { $sel = (in_array($k, $show_types)) ? 'checked="checked"' : ''; echo ""; if($x) echo ""; $x = ~$x; } echo ""; echo ""; echo "
".i18n('Type').":".i18n($v)."
".i18n('Complete').":"; echo ""; echo "
".i18n('Conference').":"; echo ""; echo "
"; echo "
"; echo ""; echo "
"; echo "
"; echo ""; echo "
".i18n('Add New User').""; echo ''; echo "
"; echo "
"; /* Grab a list of users */ $clauses = array(); $showroles = array(); foreach($show_types as $t){ $showroles[] = "type = '$t'"; } if(count($showroles) > 0) $clauses[] = 'user_roles.roles_id IN(SELECT id FROM roles WHERE ' . implode(' OR ', $showroles) . ')'; if($show_complete == 'yes') $clauses[] = 'user_roles.complete = "yes"'; if($show_all == 'no') $clauses[] = "users.conferences_id={$conference['id']}"; $querystr = "SELECT users.*, accounts.username, accounts.email AS emailaddress, user_roles.accounts_id, user_roles.roles_id, user_roles.active, user_roles.complete, roles.type, conferences.name AS conference_name FROM users JOIN user_roles ON user_roles.users_id = users.id JOIN roles ON user_roles.roles_id=roles.id JOIN conferences ON users.conferences_id = conferences.id JOIN accounts ON user_roles.accounts_id=accounts.id"; if(count($clauses) > 0){ $querystr .= " WHERE " . implode(' AND ', $clauses) . " "; } $querystr .= " ORDER BY lastname ASC, firstname ASC, conferences_id DESC "; /* echo $querystr; echo "
\n"; echo "
\n"; */ $q = mysql_query($querystr); echo mysql_error(); echo "
\n"; $num = mysql_num_rows($q); echo i18n("Listing %1 people total. See the bottom for breakdown by complete status",array($num)); echo mysql_error(); echo ""; echo ""; echo ""; echo " "; echo " "; echo " "; echo " "; // echo " "; echo " "; echo " "; echo " "; echo ""; echo ""; echo ""; $tally = array(); $tally['active'] = array(); $tally['inactive'] = array(); $tally['active']['complete'] = 0; $tally['active']['incomplete'] = 0; $tally['active']['na'] = 0; $tally['inactive']['complete'] = 0; $tally['inactive']['incomplete'] = 0; $tally['inactive']['na'] = 0; while($r=mysql_fetch_assoc($q)) { // get the role data for this user echo ""; echo ""; echo ""; echo ""; $complete = false; $incomplete = false; echo ""; echo ""; /* Finish off the the first line */ echo ""; echo ''; if($complete){ $tally[$userstate]['complete']++; }else if($incomplete){ $tally[$userstate]['incomplete']++; }else{ $tally[$userstate]['na']++; } } echo ""; echo "
".i18n("Name")."".i18n("Username")."".i18n("Email Address")."".i18n("Conference")."".i18n("Type(s)")."".i18n("Active")."".i18n("Complete")."".i18n("Actions")."
"; $name = "{$r['firstname']} {$r['lastname']}"; if($r['type']=='fair') { $qq = mysql_query("SELECT * FROM fairs WHERE id = " . $r['fairs_id']); echo $qq.";
"; $rr = mysql_fetch_assoc($qq); $name = "{$rr['name']}".((trim($name)=='') ? '' : "
($name)"); } if(strlen(trim($name)) == 0) $name = "<" . i18n("not specified") . ">"; echo "$name"; echo "
{$r['username']}{$r['emailaddress']}{$r['conference_name']}"; if($r["active"] == 'yes') { echo "
".i18n("yes")."
"; $userstate = 'active'; } else { echo "
".i18n("no")."
"; $userstate = 'inactive'; } echo "
"; if(in_array($r['type'], array('parent','committee','alumni','mentor','fair','admin','config'))) { /* Do nothing, there's nothing to complete */ } else if($r["complete"] == 'yes') { echo "
".i18n("yes")."
"; $complete = true; } else { echo "
".i18n("no")."
"; $incomplete = true; } echo "
"; echo " "; echo ""; echo "
"; echo i18n("Note: Deleting users from this list is a permanent operation and cannot be undone. Consider editting the user and deactivating or deleting roles in their account instead."); // let's make a table with the complete/incomplete counts and the active/inacteve states ?>
List Totals
Complete Incomplete N/A Total
Active
Inactive
Total