merge fix for events
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 14 Jan 2006 21:41:16 +0000 (21:41 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 14 Jan 2006 21:41:16 +0000 (21:41 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@216 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs.net/groupe/evenements.php
templates/xnet/groupe/evenements.tpl

index edaf1f2..d35f1ed 100644 (file)
@@ -117,6 +117,7 @@ $evenements = $globals->xdb->iterator(
         LEFT(10,e.fin) AS fin_day,
          e.paiement_id, e.membres_only,
         e.show_participants, u.nom, u.prenom, u.promo, a.alias, MAX(ep.nb) AS inscrit,
+         MAX(ep.paid) AS paid,
         e.short_name,
          IF(e.deadline_inscription,e.deadline_inscription >= LEFT(NOW(), 10), 1) AS inscr_open, e.deadline_inscription
       FROM  groupex.evenements AS e
@@ -136,7 +137,15 @@ while ($e = $evenements->next())
       LEFT JOIN groupex.evenements_participants AS ep ON (ep.eid = ei.eid AND ep.item_id = ei.item_id AND uid = {?})
           WHERE ei.eid = {?}",
             Session::get('uid'), $e['eid']);
-    $e['paid'] = 0;
+    $query = $globals->xdb->query(
+        "SELECT montant
+           FROM {$globals->money->mpay_tprefix}transactions AS t
+         WHERE ref = {?} AND uid = {?}", $e['paiement_id'], Session::get('uid'));
+    $montants = $query->fetchColumn();
+    foreach ($montants as $m) {
+        $p = strtr(substr($m, 0, strpos($m, "EUR")), ",", ".");
+        $e['paid'] += trim($p);
+    }
     $evts[] = $e;
 }
 
index f3ffaed..fbd0fbf 100644 (file)
@@ -47,7 +47,7 @@ Ev
   <form action="{$smarty.server.PHP_SELF}" method="post">
   {foreach from=$evenements item=e}
   <table class="tiny" cellspacing="0" cellpadding="0">
-    <tr {popup caption=$e.intitule text=$e.descriptif}>
+    <tr {popup caption=$e.intitule" text=$e.descriptif}>
       <th colspan="2">
         {$e.intitule}
         {if $admin}