5a9255fd67158a33760ec1e6655821d2df8a2519
[platal.git] / templates / payment / index.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2007 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
24 <h1>Télépaiements</h1>
25
26 {if $smarty.request.op eq "submit" and !$xorg_errors|count}
27
28 <table class="bicol">
29   <tr>
30     <th colspan="2">Paiement via {$meth->text}</th>
31   </tr>
32   <tr>
33     <td><b>Transaction</b></td>
34     <td>{$pay->text}</td>
35   </tr>
36   <tr>
37     <td><b>Montant</b></td>
38     <td>{$montant} &euro;</td>
39   </tr>
40 {if $comment}
41   <tr>
42     <td><b>Commentaire</b>
43     <td>{$comment}</td>
44   </tr>
45 {/if}
46   <tr>
47     <td>&nbsp;</td>
48     <td>
49       <form method="post" action="{$pay->api->urlform}">
50       <div>
51         <!-- infos commercant -->
52         {foreach from=$pay->api->infos.commercant key="name" item="value"}
53         <input type="hidden" name="{$name}" value="{$value}" />
54         {/foreach}
55         <!-- infos client -->
56         {foreach from=$pay->api->infos.client key="name" item="value"}
57         <input type="hidden" name="{$name}" value="{$value}" />
58         {/foreach}
59         <!-- infos commande -->
60         {foreach from=$pay->api->infos.commande key="name" item="value"}
61         <input type="hidden" name="{$name}" value="{$value}" />
62         {/foreach}
63
64         <!-- infos divers -->
65         {foreach from=$pay->api->infos.divers key="name" item="value"}
66         <input type="hidden" name="{$name}" value="{$value}" />
67         {/foreach}
68         <input type="submit" value="Valider" />
69       </div>
70       </form>
71     </td>
72   </tr>
73 </table>
74 <p>
75 En cliquant sur "Valider", tu seras redirigé{if $smarty.session.sexe}e{/if} vers le site de {$pay->api->nomsite}, où il te
76 sera demandé de saisir ton numéro de carte bancaire.  Lorsque le paiement aura été effectué, tu
77 recevras une confirmation par email.
78 </p>
79 {if $pay->api->text}
80 <p>
81 {$pay->api->text}
82 </p>
83 {/if}
84 {if $evtlink}
85 <p class="erreur">
86 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>.
87 </p>
88 {/if}
89
90 {else}
91
92 <script type='text/javascript'>
93 {literal}
94 function payment_submit(form)
95 {
96     form.op.value = 'select';
97     form.montant.value = 0;
98     form.action = 'payment/' + form.ref.value;
99     form.submit();
100 }
101 {/literal}
102 </script>
103
104 <form method="post" action="{$platal->pl_self()}">
105   <p> Si tu ne souhaites pas utiliser notre interface de
106   télépaiement, tu peux virer directement la somme de ton choix sur notre compte
107   <strong>30004 00314 00010016782 60</strong>. Nous veillerons à ce que ton paiement parvienne à
108   son destinataire.  Pense toutefois à le préciser dans le motif du
109   versement.
110   <br /><br />
111   </p>
112   <table class="bicol">
113     <tr>
114       <th colspan="2">Effectuer un télépaiement</th>
115     </tr>
116     <tr>
117       <td>Transaction</td>
118       <td>
119         {if $asso}
120         <strong>{$pay->text}</strong><input type="hidden" name="ref" value="{$pay->id}" />
121         {else}
122         <select name="ref" onchange="payment_submit(this.form)">
123           {select_db_table table="`$prefix`paiements" valeur=$pay->id where="WHERE FIND_IN_SET('old',t.flags)=0"
124                            join="LEFT JOIN groupex.asso AS g ON (t.asso_id = g.id)" group="g.nom"}
125         </select>
126         {/if}
127         {if $pay->url}
128         <br />
129         <a href="{$pay->url}">plus d'informations</a>
130         {/if}
131       </td>
132     </tr>
133     <tr>
134       <td>Méthode</td>
135       <td>
136         <select name="methode">
137           {select_db_table table="paiement.methodes" valeur=$smarty.request.methode}
138         </select>
139       </td>
140     </tr>
141     <tr>
142       <td>Montant</td>
143       <td><input type="text" name="montant" size="13" class='right' value="{$montant}" /> &euro;</td>
144     </tr>
145     <tr>
146       <td>Commentaire</td>
147       <td><textarea name="comment" rows="5" cols="30"></textarea></td>
148     </tr>
149     <tr>
150       <td>&nbsp;</td>
151       <td>
152         <input type="hidden" name="op" value="submit" />
153         <input type="submit" value="Continuer" />
154       </td>
155     </tr>
156   </table>
157 </form>
158
159 {if $transactions}
160 <p class="descr">Tu as déjà effecuté des paiements pour cette transaction :</p>
161 <table class="bicol">
162 <tr><th>Date</th><th>Montant</th></tr>
163 {iterate from=$transactions item=t}
164   <tr class="{cycle values="pair,impair"}">
165     <td>{$t.timestamp|date_format}</td>
166     <td>{$t.montant|replace:'EUR':'&euro;'}</td>
167   </tr>
168 {/iterate}
169 </table>
170 {/if}
171
172 {/if}
173
174
175 {* vim:set et sw=2 sts=2 sws=2: *}