| 1 | <?php |
| 2 | |
| 3 | require 'xnet.inc.php'; |
| 4 | |
| 5 | new_group_page('xnet/groupe/telepaiement.tpl'); |
| 6 | |
| 7 | $res = $globals->xdb->query("SELECT id, text FROM {$globals->money->mpay_tprefix}paiements WHERE asso_id = {?}", $globals->asso('id')); |
| 8 | $tit = $res->fetchAllAssoc(); |
| 9 | $page->assign('titres', $tit); |
| 10 | |
| 11 | if (may_update()) { |
| 12 | $trans = array(); |
| 13 | foreach($tit as $foo) { |
| 14 | $pid = $foo['id']; |
| 15 | $res = $globals->xdb->query( |
| 16 | "SELECT IF(u.nom_usage<>'', u.nom_usage, u.nom) as nom, u.prenom, u.promo, a.alias, timestamp, montant |
| 17 | FROM {$globals->money->mpay_tprefix}transactions AS t |
| 18 | INNER JOIN auth_user_md5 AS u ON ( t.uid = u.user_id ) |
| 19 | INNER JOIN aliases AS a ON ( t.uid = a.id AND a.type='a_vie' ) |
| 20 | WHERE ref = {?} |
| 21 | ORDER BY timestamp DESC", $pid); |
| 22 | $trans[$pid] = $res->fetchAllAssoc(); |
| 23 | } |
| 24 | $page->assign('trans', $trans); |
| 25 | } |
| 26 | |
| 27 | $page->run(); |
| 28 | ?> |