<?php
/***************************************************************************
- * Copyright (C) 2003-2011 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
return false;
}
- // smart calculation of the total number
if (!$item_id) {
- $res = XDB::query('SELECT MAX(nb)
- FROM group_events AS e
- INNER JOIN group_event_items AS ei ON (e.eid = ei.eid)
- LEFT JOIN group_event_participants AS ep ON (e.eid = ep.eid AND ei.item_id = ep.item_id)
- WHERE e.eid = {?}
- GROUP BY ep.uid', $evt['eid']);
- $evt['nb_tot'] = array_sum($res->fetchColumn());
+ /* Don't try to be to smart here, in case we're getting the global summary, we cannot have
+ * a general formula to estimate the total number of comers since 'moments' may (or may not be)
+ * disjuncted. As a consequence, we can only provides the number of user having fullfiled the
+ * registration procedure.
+ */
+ $evt['user_count'] = $evt['nb_tot'] = $evt['nb'];
$evt['titre'] = '';
$evt['item_id'] = 0;
$evt['csv_name'] = urlencode($evt['intitule']);
$evt['topay'] = 0;
$evt['paid'] = 0;
foreach ($tab as $uid=>&$u) {
- $u['adminpaid'] = $u['paid'];
+ $u['adminpaid'] = (float)$u['paid'];
$u['montant'] = 0;
if ($money && $pay_id) {
$montant = XDB::fetchOneCell('SELECT SUM(amount)
$eid, $uid);
while ($i = $res_->next()) {
$u[$i['item_id']] = $i['nb'];
- $u['montant'] += $i['montant']*$i['nb'];
+ $u['montant'] += $i['montant'] * $i['nb'];
}
$evt['telepaid'] += $u['telepayment'];
$evt['adminpaid'] += $u['adminpaid'];
}
// }}}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>