- $res = XDB::iterator(
- "SELECT IF(u.nom_usage<>'', u.nom_usage, u.nom) AS nom, u.prenom,
- u.promo, a.alias AS email, t.montant
- FROM {$globals->money->mpay_tprefix}transactions AS t
- INNER JOIN auth_user_md5 AS u ON(t.uid = u.user_id)
- INNER JOIN aliases AS a ON (a.id = t.uid AND a.type='a_vie' )
- LEFT JOIN groupex.evenements_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
- WHERE t.ref = {?} AND ep.uid IS NULL",
- $evt['eid'], $evt['paiement_id']);
- $page->assign('oublis', $res->total());
- $page->assign('oubliinscription', $res);
- }
-
- $absents = XDB::iterator("SELECT p.uid,
- IF(m.origine = 'X', IF(u.nom_usage != '', u.nom_usage, u.nom), m.nom) AS nom,
- IF(m.origine = 'X', u.prenom, u.prenom) AS prenom,
- IF(m.origine = 'X', u.promo, m.origine) AS promo,
- IF(m.origine = 'X', FIND_IN_SET('femme', u.flags), m.sexe) AS sexe,
- IF(m.origine = 'X', a.alias, m.email) AS email
- FROM groupex.evenements_participants AS p
- INNER JOIN groupex.membres AS m USING(uid)
- LEFT JOIN groupex.evenements_participants AS p2 ON (p2.uid = m.uid AND p2.eid = p.eid
- AND p2.nb != 0)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = m.uid)
- LEFT JOIN aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie')
- WHERE p.eid = {?} AND p2.eid IS NULL
- " . (Env::v('initiale') ? " AND IF(u.nom IS NULL, m.nom,
- IF(u.nom_usage<>'', u.nom_usage, u.nom)) LIKE '" . Env::v('initiale') . "%'"
- : "") . "
- GROUP BY m.uid
- ORDER BY nom, prenom, promo", $evt['eid']);
-
- $ofs = Env::i('offset');
- $tot = (Env::v('initiale') ? $tot : $nb_tot) - $absents->total();
- $nbp = intval(($tot-1)/NB_PER_PAGE);
- $links = array();
- if ($ofs) {
- $links['précédent'] = $ofs-1;
- }
- for ($i = 0; $i <= $nbp; $i++) {
- $links[(string)($i+1)] = $i;
- }
- if ($ofs < $nbp) {
- $links['suivant'] = $ofs+1;
- }
- if (count($links)>1) {
+ $infos = User::getBulkUsersWithUIDs(
+ XDB::fetchAllAssoc('SELECT t.uid, t.amount
+ FROM payment_transactions AS t
+ LEFT JOIN group_event_participants AS ep ON(ep.uid = t.uid AND ep.eid = {?})
+ WHERE t.ref = {?} AND ep.uid IS NULL',
+ $evt['eid'], $evt['paiement_id']),
+ 'uid', 'user');
+ $page->assign('oublis', count($infos));
+ $page->assign('oubliinscription', $infos);
+ }
+
+ $absents = User::getBulkUsersFromDB('SELECT p.uid
+ FROM group_event_participants AS p
+ LEFT JOIN group_event_participants AS p2 ON (p2.uid = p.uid
+ AND p2.eid = p.eid
+ AND p2.nb != 0)
+ WHERE p.eid = {?} AND p2.eid IS NULL
+ GROUP BY p.uid', $evt['eid']);
+
+ $ofs = Env::i('offset');
+ $tot = (is_null($evt['nb_tot']) ? $evt['nb'] : $evt['nb_tot']);
+ $nbp = ceil($tot / NB_PER_PAGE);
+ if ($nbp > 1) {
+ $links = array();
+ if ($ofs) {
+ $links['précédent'] = $ofs - 1;
+ }
+ for ($i = 1 ; $i <= $nbp; $i++) {
+ $links[(string)$i] = $i - 1;
+ }
+ if ($ofs < $nbp - 1) {
+ $links['suivant'] = $ofs+1;
+ }