0337d704 |
1 | <?php |
2 | /*************************************************************************** |
3 | * Copyright (C) 2003-2004 Polytechnique.org * |
4 | * http://opensource.polytechnique.org/ * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License, or * |
9 | * (at your option) any later version. * |
10 | * * |
11 | * This program is distributed in the hope that it will be useful, * |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
14 | * GNU General Public License for more details. * |
15 | * * |
16 | * You should have received a copy of the GNU General Public License * |
17 | * along with this program; if not, write to the Free Software * |
18 | * Foundation, Inc., * |
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
20 | ***************************************************************************/ |
21 | |
22 | require_once('xorg.inc.php'); |
23 | new_admin_page('admin/ax-xorg.tpl'); |
24 | |
25 | // liste des différences |
26 | $res = $globals->xdb->query( |
27 | 'SELECT u.promo,u.nom AS nom,u.prenom AS prenom,ia.nom AS nomax,ia.prenom AS prenomax,u.matricule AS mat,ia.matricule_ax AS matax |
28 | FROM auth_user_md5 AS u |
29 | INNER JOIN identification_ax AS ia ON u.matricule_ax = ia.matricule_ax |
30 | WHERE (SOUNDEX(u.nom) != SOUNDEX(ia.nom) AND SOUNDEX(CONCAT(ia.particule,u.nom)) != SOUNDEX(ia.nom) |
31 | AND SOUNDEX(u.nom) != SOUNDEX(ia.nom_patro) AND SOUNDEX(CONCAT(ia.particule,u.nom)) != SOUNDEX(ia.nom_patro)) |
32 | OR u.prenom != ia.prenom OR (u.promo != ia.promo AND u.promo != ia.promo+1 AND u.promo != ia.promo-1) |
33 | ORDER BY u.promo,u.nom,u.prenom'); |
34 | $page->assign('diffs', $res->fetchAllAssoc()); |
35 | |
36 | // gens à l'ax mais pas chez nous |
37 | $res = $globals->xdb->query( |
38 | 'SELECT ia.promo,ia.nom,ia.nom_patro,ia.prenom |
39 | FROM identification_ax as ia |
40 | LEFT JOIN auth_user_md5 AS u ON u.matricule_ax = ia.matricule_ax |
41 | WHERE u.nom IS NULL'); |
42 | $page->assign('mank', $res->fetchAllAssoc()); |
43 | |
44 | // gens chez nous et pas à l'ax |
45 | $res = $globals->xdb->query('SELECT promo,nom,prenom FROM auth_user_md5 WHERE matricule_ax IS NULL'); |
46 | $page->assign('plus', $res->fetchAllAssoc()); |
47 | |
48 | |
49 | $page->run(); |
50 | ?> |