1 | <?php |
---|
2 | /** |
---|
3 | * Plugin Association |
---|
4 | * |
---|
5 | * Copyright (c) 2007 |
---|
6 | * Bernard Blazin & François de Montlivault |
---|
7 | * http://www.plugandspip.com |
---|
8 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. |
---|
9 | * Pour plus de details voir le fichier COPYING.txt. |
---|
10 | * |
---|
11 | **/ |
---|
12 | include_spip('inc/presentation'); |
---|
13 | |
---|
14 | function exec_ajout_cotisation(){ |
---|
15 | global $connect_statut, $connect_toutes_rubriques; |
---|
16 | |
---|
17 | debut_page(_T('Ajout de cotisation'), "", ""); |
---|
18 | |
---|
19 | $url_action_cotisations = generer_url_ecrire('action_cotisations'); |
---|
20 | $url_retour = $_SERVER['HTTP_REFERER']; |
---|
21 | |
---|
22 | include_spip ('inc/navigation'); |
---|
23 | |
---|
24 | debut_cadre_relief( "", false, "", $titre = _T('Tous les membres actifs')); |
---|
25 | debut_boite_info(); |
---|
26 | |
---|
27 | print association_date_du_jour(); |
---|
28 | |
---|
29 | $id_adherent=$_GET['id']; |
---|
30 | |
---|
31 | $query = spip_query( "SELECT * FROM spip_asso_adherents where id_adherent='$id_adherent' " ); |
---|
32 | |
---|
33 | echo '<fieldset><legend>Ajouter une cotisation </legend>'; |
---|
34 | echo '<table width="70%" class="noclass">'; |
---|
35 | echo '<p align="center"><form action="'.$url_action_cotisations.'" method="POST">'; |
---|
36 | |
---|
37 | while($data = spip_fetch_array($query)) { |
---|
38 | $nom=$data['nom']; |
---|
39 | $prenom=$data['prenom']; |
---|
40 | $categorie=$data['categorie']; |
---|
41 | $validite=$data['validite']; |
---|
42 | $split = explode("-",$validite); |
---|
43 | $annee = $split[0]; |
---|
44 | $mois = $split[1]; |
---|
45 | $jour = $split[2]; |
---|
46 | |
---|
47 | echo '<tr>'; |
---|
48 | echo '<td>Adhérent :</td>'; |
---|
49 | echo '<td><strong>'.$nom.' '.$prenom.'</strong></td>'; |
---|
50 | echo '<tr>'; |
---|
51 | echo '<td>Catégorie :</td>'; |
---|
52 | echo '<td>'.$categorie.'</td>'; |
---|
53 | |
---|
54 | echo '<tr> '; |
---|
55 | echo '<td> </td>'; |
---|
56 | echo '<td> </td>'; |
---|
57 | echo '<tr>'; |
---|
58 | |
---|
59 | echo '<td>Date du paiement (AAAA-MM-JJ):'; |
---|
60 | echo '<td><input name="date" type="text" value="'.date('Y-m-d').'">'; |
---|
61 | echo '<tr> '; |
---|
62 | echo '<td>Montant payé (en euros):</td>'; |
---|
63 | |
---|
64 | $sql = spip_query( "SELECT * FROM spip_asso_categories WHERE valeur='$categorie' "); |
---|
65 | while($categorie = spip_fetch_array($sql)) { |
---|
66 | $duree=$categorie['duree']; |
---|
67 | $mois=$mois+$duree; |
---|
68 | $validite=date("Y-m-d", mktime(0, 0, 0, $mois, $jour, $annee)); |
---|
69 | |
---|
70 | echo '<td><input name="montant" type="text" value=" '.$categorie['cotisation'].' "></td>'; |
---|
71 | } |
---|
72 | echo '<tr>'; |
---|
73 | echo '<td>Mode de paiement :</td>'; |
---|
74 | echo '<td><select name="journal" type="text">'; |
---|
75 | $sql = spip_query ("SELECT * FROM spip_asso_banques ORDER BY id_banque" ); |
---|
76 | while ($banque = spip_fetch_array($sql)) { |
---|
77 | echo '<option value="'.$banque['code'].'"> '.$banque['intitule'].' </option>'; |
---|
78 | } |
---|
79 | echo '<option value="don"> Don </option>'; |
---|
80 | echo '</select></td>'; |
---|
81 | echo '<tr>'; |
---|
82 | echo '<td>Validité (AAAA-MM-JJ):'; |
---|
83 | echo '<td><input name="validite" type="text" value="'.$validite.'">'; |
---|
84 | echo '<tr> '; |
---|
85 | echo '<td>Justification :'; |
---|
86 | echo '<td><input name="justification" type="text" size="50" value="'.$prenom.' '.$nom.'">'; |
---|
87 | echo '<input type="hidden" name="id_adherent" value="'.$id_adherent.'">'; |
---|
88 | echo '<input type="hidden" name="nom" value="'.$nom.'">'; |
---|
89 | echo '<input type="hidden" name="prenom" value="'.$prenom.'">'; |
---|
90 | echo '<input type="hidden" name="action" value="ajoute"></td></tr>'; |
---|
91 | } |
---|
92 | echo '</table>'; |
---|
93 | echo '<tr>'; |
---|
94 | echo '<td> </td>'; |
---|
95 | echo '<td><input name="url_retour" type="hidden" value="'.$url_retour.'">'; |
---|
96 | echo '<input name="submit" type="submit" value="Ajouter" class="fondo"></td></tr>'; |
---|
97 | echo '</form>'; |
---|
98 | echo '</table>'; |
---|
99 | echo '</fieldset>'; |
---|
100 | |
---|
101 | // ON FERME TOUT |
---|
102 | fin_boite_info(); |
---|
103 | |
---|
104 | fin_cadre_relief(); |
---|
105 | |
---|
106 | fin_page(); |
---|
107 | } |
---|
108 | ?> |
---|