- Change the default user list to show all users from all years

- Change the SQL query to use MAX(year), so that we really only show a single
  (non-deleted) entry for each user.
This commit is contained in:
dave 2009-09-26 17:59:50 +00:00
parent 22f75ffd1f
commit c23ce973b1

View File

@ -32,7 +32,7 @@
if(user_valid_type($show_types) == false) $show_types = array('judge');
$show_complete = ($_GET['show_complete'] == 'yes') ? 'yes' : 'no';
$show_year = ($_GET['show_year'] == 'all') ? 'all' : 'current';
$show_year = ($_GET['show_year'] == 'current') ? 'current' : 'all';
$uid = intval($_GET['uid']);
@ -99,7 +99,7 @@ function neweditor()
<?
echo "<div class=\"notice\">";
echo "<a id=\"optionstext\" href=\"javascript:toggleoptions()\">- ".i18n('Hide Display Options')."</a>";
echo "<a id=\"optionstext\" onclick=\"toggleoptions();return false;\">- ".i18n('Hide Display Options')."</a>";
echo "<form method=\"GET\" action=\"$PHP_SELF\">";
@ -178,11 +178,12 @@ function neweditor()
}
if($show_year == 'current')
$where_year = "AND year={$config['FAIRYEAR']}";
$having_year = "AND MAX(`users`.`year`)={$config['FAIRYEAR']}";
echo "<table class=\"tableview\">";
$querystr="SELECT
*
*, MAX(`users`.`year`) as maxyear
FROM
users
LEFT JOIN `users_committee` ON `users_committee`.`users_id`=`users`.`id`
@ -190,9 +191,10 @@ function neweditor()
LEFT JOIN `users_volunteer` ON `users_volunteer`.`users_id`=`users`.`id`
LEFT JOIN `users_fair` ON `users_fair`.`users_id`=`users`.`id`
LEFT JOIN `users_sponsor` ON `users_sponsor`.`users_id`=`users`.`id`
WHERE
GROUP BY uid
HAVING
users.deleted='no'
$where_year
$having_year
$where_types
$where_complete
ORDER BY