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('Hide 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('Year').":"; echo ""; echo "
"; echo "
"; echo ""; echo "
"; echo "
"; echo ""; echo "
".i18n('Add New User').""; echo ''; echo "
"; echo "
"; /* Grab a list of users */ $w = array(); foreach($show_types as $t) { $w [] = "u1.types LIKE '%$t%'"; } $where_types = "AND (".join(" OR ", $w).")"; $where_complete = ""; if($show_complete == 'yes') { foreach($show_types as $t) { $where_complete .= "AND ({$t}_complete='yes' OR {$t}_complete IS NULL) "; } } if($show_year == 'current') $having_year = "AND u1.year={$config['FAIRYEAR']}"; echo ""; $querystr="SELECT * FROM users u1 LEFT JOIN `users_committee` ON `users_committee`.`users_id`=`u1`.`id` LEFT JOIN `users_judge` ON `users_judge`.`users_id`=`u1`.`id` LEFT JOIN `users_volunteer` ON `users_volunteer`.`users_id`=`u1`.`id` LEFT JOIN `users_fair` ON `users_fair`.`users_id`=`u1`.`id` LEFT JOIN `users_sponsor` ON `users_sponsor`.`users_id`=`u1`.`id` WHERE u1.year=( SELECT MAX(`year`) FROM users u2 WHERE u1.uid=u2.uid ) GROUP BY uid HAVING u1.deleted='no' $having_year $where_types $where_complete ORDER BY lastname ASC, firstname ASC, year DESC"; $q=mysql_query($querystr); echo mysql_error(); // echo $querystr; $num=mysql_num_rows($q); echo i18n("Listing %1 people total. See the bottom for breakdown of by complete status",array($num)); echo mysql_error(); 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['inactive']['complete'] = 0; $tally['inactive']['incomplete'] = 0; while($r=mysql_fetch_assoc($q)) { //JAMES - TEMP - due to the previous error with improperly setting judge status to NOT complete when special awards was turned off //we now need to make sure we re-calculate all the judge statuses somehow, so might as well do it here. //FIXME: remove this after all the fairs are done this year SUMMER 2010 if(in_array('judge',$show_types)){ $u=user_load_by_uid($r['uid']); //we also set teh $r array so it displays properly on first load if(judge_status_update($u)=="complete") $r['judge_complete']='yes'; } $types = split(',', $r['types']); $span = count($types) > 1 ? "rowspan=\"".count($types)."\"" : ''; echo ""; echo ""; echo ""; $first = true; $complete = false; $incomplete = false; foreach($types as $t) { if(!$first) echo ''; echo ""; echo ""; echo ""; if($first) { /* Finish off the the first line */ echo ""; } $first = false; } echo ''; if($complete){ $tally[$userstate]['complete']++; }else if($incomplete){ $tally[$userstate]['incomplete']++; } } echo "
".i18n("Name")."".i18n("Email Address")."".i18n("Year")."".i18n("Type(s)")."".i18n("Active")."".i18n("Complete")."".i18n("Actions")."
"; $name = "{$r['firstname']} {$r['lastname']}"; if(in_array('fair', $types)) { $qq = mysql_query("SELECT * FROM users_fair LEFT JOIN fairs ON fairs.id=users_fair.fairs_id WHERE users_id='{$r['id']}'"); $rr = mysql_fetch_assoc($qq); $name = "{$rr['name']}".((trim($name)=='') ? '' : "
($name)"); } echo "$name"; echo "
{$r['email']}{$r['year']}
{$user_what[$t]}"; if($r["{$t}_active"] == 'yes') { echo "
".i18n("yes")."
"; $userstate = 'active'; } else { echo "
".i18n("no")."
"; $userstate = 'inactive'; } echo "
"; if(in_array($t, array('parent','committee','alumni','mentor','fair'))) { /* Do nothing, there's nothing to complete */ } else if($r["{$t}_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 Total
Active
Inactive
Total