telepaiement.php
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Thu, 21 Apr 2005 16:15:43 +0000 (16:15 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:43 +0000 (23:28 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-584

htdocs.net/groupe/telepaiement.php [new file with mode: 0644]
templates/xnet/groupe/telepaiement.tpl [new file with mode: 0644]

diff --git a/htdocs.net/groupe/telepaiement.php b/htdocs.net/groupe/telepaiement.php
new file mode 100644 (file)
index 0000000..9410b73
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+require 'xnet.inc.php';
+
+new_group_page('xnet/groupe/telepaiement.tpl');
+$page->setType($globals->asso('cat'));
+$page->useMenu();
+$page->assign('asso', $globals->asso());
+
+$res = $globals->xdb->query("SELECT id, text FROM {$globals->money->mpay_tprefix}paiements WHERE asso_id = {?}", $globals->asso('id'));
+$tit = $res->fetchAllAssoc();
+$page->assign('titres', $tit);
+
+if (may_update()) {
+    $trans = array();
+    foreach($tit as $foo) {
+        $pid = $foo['id'];
+        $res = $globals->xdb->query(
+                "SELECT  u.nom, u.prenom, u.promo, a.alias, timestamp, 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 ( t.uid = a.id AND a.type='a_vie' )
+                  WHERE  ref = {?}
+               ORDER BY  timestamp DESC", $id);
+        $trans[$pid] = $res->fetchAllAssoc();
+    }
+    $page->assign('trans', $trans);
+}
+
+$page->run();
+?>
diff --git a/templates/xnet/groupe/telepaiement.tpl b/templates/xnet/groupe/telepaiement.tpl
new file mode 100644 (file)
index 0000000..702420f
--- /dev/null
@@ -0,0 +1,51 @@
+{***************************************************************************
+ *  Copyright (C) 2003-2004 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  This program is free software; you can redistribute it and/or modify   *
+ *  it under the terms of the GNU General Public License as published by   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************}
+
+<h1>{$asso.nom} : Gestion des télépaiements </h1>
+
+<p class="descr">
+Voici la liste des paiements en ligne possible pour le groupe {$asso.nom}
+</p>
+
+{foreach from=$pitres item=t}
+<a href="https://www.polytechnique.org/paiement/?ref={$p.id}">{$p.text}</a>
+{if $trans[$p.id]}
+<table>
+  <tr>
+    <th colspan="3">{$p.text} : détails pour les administrateur</th>
+  </tr>
+  <tr>
+    {foreach from=$trans[$p.id] item=p}
+    <td>{$p.date|date_format}</td>
+    <td>
+      <a href="https://www.polytechnique.org/fiche.php?user={$p.alias}">{$p.nom} {$p.prenom} (X{$promo})</a>
+      (<a href="mailto:{$p.alias}@polytechnique.org">mail</a>)
+    </td>
+    <td>{$p.montant}</td>
+    {/foreach}
+  </tr>
+{/if}
+{foreachelse}
+<p class="descr">
+<em>Pas de micropaiement en cours ...</em>
+</p>
+{/foreach}
+
+{* vim:set et sw=2 sts=2 sws=2: *}