forked from science-ation/science-ation
- 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:
parent
22f75ffd1f
commit
c23ce973b1
@ -32,7 +32,7 @@
|
|||||||
if(user_valid_type($show_types) == false) $show_types = array('judge');
|
if(user_valid_type($show_types) == false) $show_types = array('judge');
|
||||||
|
|
||||||
$show_complete = ($_GET['show_complete'] == 'yes') ? 'yes' : 'no';
|
$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']);
|
$uid = intval($_GET['uid']);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ function neweditor()
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
echo "<div class=\"notice\">";
|
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\">";
|
echo "<form method=\"GET\" action=\"$PHP_SELF\">";
|
||||||
|
|
||||||
@ -178,11 +178,12 @@ function neweditor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($show_year == 'current')
|
if($show_year == 'current')
|
||||||
$where_year = "AND year={$config['FAIRYEAR']}";
|
$having_year = "AND MAX(`users`.`year`)={$config['FAIRYEAR']}";
|
||||||
|
|
||||||
echo "<table class=\"tableview\">";
|
echo "<table class=\"tableview\">";
|
||||||
|
|
||||||
$querystr="SELECT
|
$querystr="SELECT
|
||||||
*
|
*, MAX(`users`.`year`) as maxyear
|
||||||
FROM
|
FROM
|
||||||
users
|
users
|
||||||
LEFT JOIN `users_committee` ON `users_committee`.`users_id`=`users`.`id`
|
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_volunteer` ON `users_volunteer`.`users_id`=`users`.`id`
|
||||||
LEFT JOIN `users_fair` ON `users_fair`.`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`
|
LEFT JOIN `users_sponsor` ON `users_sponsor`.`users_id`=`users`.`id`
|
||||||
WHERE
|
GROUP BY uid
|
||||||
|
HAVING
|
||||||
users.deleted='no'
|
users.deleted='no'
|
||||||
$where_year
|
$having_year
|
||||||
$where_types
|
$where_types
|
||||||
$where_complete
|
$where_complete
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
Loading…
Reference in New Issue
Block a user