From: x2000habouzit Date: Fri, 15 Oct 2004 09:52:22 +0000 (+0000) Subject: please do not commit shit, especialy when you commit from the prod ... X-Git-Tag: xorg/old~1273 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=3b645064a850eb1e0f4ec156d9753d8ac0793031;p=platal.git please do not commit shit, especialy when you commit from the prod ... if you dunno understand a part of the code, please ask before removing it. here the thing is used to sort the fields by name or by promo. and you broke the feature --- diff --git a/htdocs/listes/members.php b/htdocs/listes/members.php index 33b5641..1b1da01 100644 --- a/htdocs/listes/members.php +++ b/htdocs/listes/members.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: members.php,v 1.5 2004-10-15 09:40:31 web Exp $ + $Id: members.php,v 1.6 2004-10-15 09:52:22 x2000habouzit Exp $ ***************************************************************************/ if(empty($_REQUEST['liste'])) header('Location: index.php'); @@ -41,12 +41,13 @@ if(list($det,$mem,$own) = $members) { $membres = Array(); foreach($mem as $member) { list($m) = split('@',$member[1]); - $res = $globals->db->query("SELECT IF(epouse='', CONCAT(prenom, ' ', nom), CONCAT(prenom, ' ', epouse)), promo + $res = $globals->db->query("SELECT prenom,IF(epouse='', nom, epouse), promo FROM auth_user_md5 AS u INNER JOIN aliases AS a ON u.user_id = a.id WHERE a.alias = '$m'"); - if(list($nom, $promo) = mysql_fetch_row($res)) { - $membres[$promo][] = Array('n' => $nom, 'l' => $m); + if(list($prenom, $nom, $promo) = mysql_fetch_row($res)) { + $key = $tri_promo ? $promo : strtoupper($nom{0}); + $membres[$key][$nom.$m] = Array('n' => "$prenom $nom", 'l' => $m); } else { $membres[0][] = Array('l' => $member[0]); }