Allows payments for non logged users.
[platal.git] / templates / payment / payment.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2011 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 {if $smarty.request.op eq "submit" and !$pl_errors}
24
25 <h1>Télépaiements</h1>
26
27 <table class="bicol">
28   <tr>
29     <th colspan="2">Paiement via {$meth->text}</th>
30   </tr>
31   <tr>
32     <td><b>Transaction</b></td>
33     <td>{$pay->text}</td>
34   </tr>
35   <tr>
36     <td><b>Montant</b></td>
37     <td>{$amount} &euro;</td>
38   </tr>
39 {if $comment}
40   <tr>
41     <td><b>Commentaire</b></td>
42     <td>{$comment}</td>
43   </tr>
44 {/if}
45   <tr>
46     <td>&nbsp;</td>
47     <td>
48       <form method="post" action="{$pay->api->urlform}">
49       <div>
50         <!-- infos commercant -->
51         {foreach from=$pay->api->infos.commercant key="name" item="value"}
52         <input type="hidden" name="{$name}" value="{$value}" />
53         {/foreach}
54         <!-- infos client -->
55         {foreach from=$pay->api->infos.client key="name" item="value"}
56         <input type="hidden" name="{$name}" value="{$value}" />
57         {/foreach}
58         <!-- infos commande -->
59         {foreach from=$pay->api->infos.commande key="name" item="value"}
60         <input type="hidden" name="{$name}" value="{$value}" />
61         {/foreach}
62
63         <!-- infos divers -->
64         {foreach from=$pay->api->infos.divers key="name" item="value"}
65         <input type="hidden" name="{$name}" value="{$value}" />
66         {/foreach}
67         <input type="submit" value="Valider" />
68       </div>
69       </form>
70     </td>
71   </tr>
72 </table>
73 <p>
74 En cliquant sur "Valider", tu seras redirigé{if $sex}e{/if} vers le site de {$pay->api->nomsite}, où il te
75 sera demandé de saisir ton numéro de carte bancaire. Lorsque le paiement aura été effectué, tu
76 recevras une confirmation par email.
77 </p>
78 {if $pay->api->text}
79 <p>
80 {$pay->api->text}
81 </p>
82 {/if}
83 {if $evtlink}
84 <p class="erreur">
85 Si tu n'es pas encore inscrit à cet événement, n'oublie pas d'aller t'<a href='http://www.polytechnique.net/{$evtlink.diminutif}/events/sub/{$evtlink.eid}'>inscrire</a>.
86 </p>
87 {/if}
88
89 {else}
90
91 {if t($donation)}
92 {include wiki=Docs.Dons}
93 {/if}
94
95 <form method="post" action="{$platal->pl_self()}">
96   <table class="bicol">
97     <tr>
98       <th colspan="2">Effectuer un télépaiement</th>
99     </tr>
100     <tr>
101       <td>Transaction</td>
102       <td>
103         <strong>{$pay->text}</strong><input type="hidden" name="ref" value="{$pay->id}" />
104         {if $pay->url}
105         <br />
106         <a href="{$pay->url}">plus d'informations</a>
107         {/if}
108       </td>
109     </tr>
110     <tr>
111       <td>Méthode</td>
112       <td>
113         <select name="methode">
114           {select_db_table table="payment_methods" valeur=$smarty.request.methode}
115         </select>
116       </td>
117     </tr>
118     <tr>
119       <td>Montant</td>
120       <td><input type="text" name="amount" size="13" class="right" value="{$pay->amount_def}" /> &euro;</td>
121     </tr>
122     {if t($public)}
123     <tr>
124       <td>Identifiant <small>(prenom.nom.promo)</small></td>
125       <td><input type="text" name="login" size="30" /></td>
126     </tr>
127     {/if}
128     <tr>
129       <td>Commentaire</td>
130       <td><textarea name="comment" rows="5" cols="30"></textarea></td>
131     </tr>
132     {if t($donation)}
133     <tr>
134       <td>Afficher ton nom dans la liste des donateurs</td>
135       <td>
136         <label>Oui<input type="radio" name="display" value="1" checked="checked" /></label>
137         &nbsp;-&nbsp;
138         <label><input type="radio" name="display" value="0" />Non</label>
139       </td>
140     </tr>
141     {/if}
142     <tr>
143       <td>&nbsp;</td>
144       <td>
145         <input type="hidden" name="op" value="submit" />
146         <input type="submit" value="Continuer" />
147       </td>
148     </tr>
149   </table>
150 </form>
151
152 {if t($transactions)}
153 <p class="descr">Tu as déjà effectué des paiements pour cette transaction&nbsp;:</p>
154 <table class="bicol">
155 <tr><th>Date</th><th>Montant</th></tr>
156 {iterate from=$transactions item=t}
157   <tr class="{cycle values="pair,impair"}">
158     <td>{$t.ts_confirmed|date_format}</td>
159     <td>{$t.amount|replace:'.':','} &euro;</td>
160   </tr>
161 {/iterate}
162 </table>
163 {/if}
164
165 {if t($donation)}
166 <p class="descr">Les 10 plus gros dons sont les suivants&nbsp;:</p>
167 <table class="bicol">
168   <tr>
169     <th>Nom</th>
170     <th>Montant</th>
171     <th>Date</th>
172   </tr>
173   {foreach from=$biggest_donations item=d}
174   <tr class="{cycle values="pair,impair"}">
175     <td>{$d.name}</td>
176     <td class="center">{$d.amount|replace:'.':','} &euro;</td>
177     <td>{$d.ts_confirmed|date_format}</td>
178   </tr>
179   {/foreach}
180 </table>
181
182 <p class="descr">Les dons par période&nbsp;:</p>
183 <table class="tinybicol">
184   <tr>
185     <th>Période</th>
186     <th>Montant</th>
187   </tr>
188   {foreach from=$donations item=d}
189   <tr class="{cycle values="pair,impair"}">
190     <td>{if $d.month neq 0}{$d.ts_confirmed|date_format:"%B %Y"}{else}{$d.ts_confirmed|date_format:"%Y"}{/if}</td>
191     <td style="text-align: right">{$d.amount|replace:'.':','} &euro;</td>
192   </tr>
193   {/foreach}
194 </table>
195 {/if}
196
197 {/if}
198
199 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}