Subversion Repositories Applications.annuaire

Rev

Rev 523 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
296 aurelien 1
<?php
2
// Création de l'objet pdf
3
 
4
class Recu extends AppControleur {
5
 
6
	public function Recu() {
7
 
8
		require_once('bibliotheque/tcpdf/config/lang/fra.php');
9
		require 'bibliotheque/tcpdf/tcpdf.php';
10
		require 'bibliotheque/Words/Words.php';
11
		// Constante nécessaire à fpdf.php
12
		parent::__construct();
13
	}
14
 
15
	public function fabriquerRecuPdf($utilisateur, $cotisation) {
16
 
17
		$num_recu = $cotisation['recu_envoye'];
18
 
19
		$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
20
 
21
		//$pdf->Open();
22
		$pdf->SetTitle('Recu pour don à Tela Botanica');
23
 
24
		$pdf->SetFont('helvetica','',14);
25
 
26
		$pdf->AddPage();
27
 
28
		$pdf->Line(10, 10, 200, 10) ;
29
 
30
		// Contenu du document
31
 
32
		$pdf->SetFont('helvetica', '', 8) ;
33
 
34
		$pdf->Cell(150, 10, "", 0, 0) ;
35
 
36
		$pdf->MultiCell(40, 10, "Numéro d'ordre : $num_recu", 1, "C") ;
37
 
38
		$pdf->SetY($pdf->GetY() - 10) ;
39
 
40
		$pdf->SetFont('helvetica','B',14);
41
		$pdf->Cell(0,10,'Reçu dons aux oeuvres', 0, 1, "C");
42
		$pdf->SetFont('helvetica', '', 10) ;
43
		$pdf->Cell(0, 0, 'Articles 200, 238 bis et 885-0 du code général des impôts (CGI)', 0, 1, "C") ;
44
 
329 aurelien 45
		$pdf->Cell(0, 10, 'REÇU A CONSERVER ET A JOINDRE A VOTRE DECLARATION DE REVENUS '.$cotisation['annee_cotisation'], 0, 1, "L") ;
296 aurelien 46
 
47
		// On met le logo de Tela
427 aurelien 48
		$pdf->Image(dirname(__FILE__)."/logo_tela.png", 12, 40, "29", "", "PNG", "http://www.tela-botanica.org/") ;
296 aurelien 49
 
50
		// On écrit Les titres du cadre
51
		$pdf->SetFontSize(12) ;
52
		$pdf->Cell(100, 10, 'Bénéficiaire du don', 0, 0, "C") ;
53
		$pdf->Cell(100, 10, 'Donateur', 0, 1, "C") ;
54
 
55
		$pdf->Cell(38, 5, '', 0, 0) ;
56
		$pdf->Cell(62, 5, 'Association Tela Botanica', 0, 0, "L") ;
57
 
58
		$pdf->SetFont('helvetica', 'B', 10) ;
59
 
60
		$pdf->Cell(100, 5, $utilisateur['nom']['amv_valeur'].' '.$utilisateur['prenom']['amv_valeur'], 0, 1, "L") ;
61
 
62
		$pdf->SetFont('helvetica', '', 10) ;
63
 
64
		$pdf->Cell(38, 5, '', 0, 0) ;
65
		$pdf->Cell(62, 5, 'Institut de Botanique', 0, 1, "L") ;
66
		$pdf->Cell(38, 5, '', 0, 0) ;
67
		$pdf->Cell(62, 5, '163, rue A. Broussonnet', 0, 0, "L") ;
68
		$pdf->Cell(100, 5, $utilisateur['adresse']['amv_valeur'], 0, 1, "L") ;
69
 
70
		$pdf->Cell(38, 5, '', 0, 0) ;
71
		$pdf->Cell(62, 5, '34090 Montpellier', 0, 0, "L") ;
72
		$pdf->Cell(100, 8, $utilisateur['adresse_comp']['amv_valeur'], 0, 1, "L") ;
73
 
74
 
75
		$pdf->Cell(100, 5, 'Objet :', 0,1, "L") ;
76
		$pdf->SetFontSize(8) ;
77
		$pdf->MultiCell(100, 4, 'Contribuer au rapprochement de tous les botanistes de langue française. Favoriser l\'échange d\'information'.
78
		                        ' et animer des projets botaniques grâce aux nouvelles technologies de la communication.', 0, 1, "") ;
79
		$pdf->MultiCell(100,4, 'Organisme d\'intérêt général à caractère scientifique concourant à la diffusion de la langue et des connaissances scientifiques françaises.', 0,1, "") ;
80
 
81
		$pdf->SetFontSize(10) ;
82
 
83
		$pdf->Text(111, 58 + 8, $utilisateur['code_postal']['amv_valeur'].' '.$utilisateur['ville']['amv_valeur']) ;
84
		$pdf->SetFontSize(8) ;
85
 
86
		// On remonte le curseur de 52
87
		$pdf->SetY($pdf->GetY() - 30) ;
88
 
89
		// Le cadre central
90
		$pdf->Cell(100, 60, '', 1) ;
91
		$pdf->Cell(90, 60, '', 1) ;
92
		$pdf->Ln() ;
93
 
94
		$pdf->SetFontSize(10) ;
95
		$pdf->Cell(0,10, 'L\'Association reconnaît avoir reçu en numéraire, à titre de don, la somme de :', 0, 1, "L") ;
96
 
97
		$wordsConverter = new Numbers_Words() ;
98
		$montantLettres = $wordsConverter->toWords($cotisation['montant_cotisation'],'fr') ;
99
 
100
		$pdf->SetFont('helvetica', 'B', 11) ;
101
		$pdf->Cell(0,10,  "*** ".$cotisation['montant_cotisation']." euros ***", 0, 1, "C") ;
102
		$pdf->Ln() ;
103
		$pdf->Cell(0,10,  "*** (".$montantLettres." euros) ***", 0, 1, "C") ;
104
 
105
		$pdf->SetFont('helvetica', '', 10) ;
106
 
107
		$pdf->Ln() ;
108
		$pdf->Cell(100,10, "Date du paiement : ".$cotisation['date_cotisation'], 0, 0, "L") ;
329 aurelien 109
		$pdf->Cell(100, 10, 'Montpellier, le '.$cotisation['date_envoi_recu'], 0, 1, "L") ;
296 aurelien 110
 
531 mathias 111
		// La signature de Daniel Mathieu
523 aurelien 112
		$pdf->Image(dirname(__FILE__).'/signature_Daniel.png', 110, $pdf->GetY(),28.22, "") ;
296 aurelien 113
 
114
		$pdf->Ln() ;
115
		$pdf->Cell(0, 10, "Mode de versement : ".$cotisation['mode_cotisation'], 0, 1, "L") ;
116
 
117
		$pdf->Cell(100, 10, '', 0, 0) ;
523 aurelien 118
		$pdf->Cell (100, 10, 'Daniel Mathieu, Président', 0, 1, "L") ;
296 aurelien 119
		$pdf->Ln(5) ;
120
 
121
		$pdf->SetFontSize(10) ;
122
		$pdf->Cell(0, 7, '66 % de votre don à Tela Botanica est déductible de vos impôts dans la limite de 20 % de votre revenu imposable.', 1, 1, "C") ;
123
 
124
		return $pdf;
125
	}
126
 
127
	public function afficherRecuPdf($utilisateur, $cotisation) {
128
 
129
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
130
		$pdf->Output();
131
		exit;
132
	}
133
 
134
	public function renvoyerRecuPdf($utilisateur, $cotisation) {
135
 
136
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
137
 
138
		$contenu_pdf = $pdf->Output('','S');
139
 
140
		return $contenu_pdf;
141
	}
142
}
143
?>