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. */ // This file was modified March of 2015 by Sebastian Ruan /* Flagging for judges has been added to monitor concerns. Update User button also added; allows super users to update a judge to the current fair year without logging in as them. */ ?> '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 mysql_error(); echo i18n("Listing %1 people total. See the table at the bottom for the totals by status


",array($num)); echo i18n(" Notes:"; 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 the $r array so it displays properly on first load if(judge_status_update($u)=="complete") $r['judge_complete']='yes'; else{ $r['judge_complete']='no'; } } $types = explode(',', $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 ""; // Begin flagging process echo ""; //end flagging process if($first) { if ($name == ' ') $name = 'Noname'; /* Finish off the the first line */ // If judge not in current fair year need seperate icons so that all icons align nicely in the table if ($t == 'judge' and $r['year'] != $config['FAIRYEAR']){ 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("Flagged")."".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 "
"; // Must be a judge in order to be flagged if ($t == 'judge'){ /* Determine if judge is flagged and display X icon. Icon is clickable. Brings user to user_editor_window file. Would preferably ALSO bring the user to the judge other tab*/ if($r['flagged_judge'] == '1') { echo ""; echo ""; echo ""; // Otherwise judge is not flagged; display checkmark icon. Also clickable. } else { echo ""; echo ""; echo ""; } } else { // Do nothing. Only judges can be flagged. } echo ""; echo "      "; // aligns icons echo " "; echo ""; echo " "; }else{ echo ""; echo " "; echo ""; } echo "
"; // let's make a table with the complete/incomplete counts and the active/inacteve states ?>
List Totals
Complete Incomplete Total
Active
Inactive
Total