Subversion Repositories Applications.annuaire

Rev

Rev 523 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 523 Rev 531
1
<?php
1
<?php
2
// Création de l'objet pdf
2
// Création de l'objet pdf
3
 
3
 
4
class Recu extends AppControleur {
4
class Recu extends AppControleur {
5
	
5
	
6
	public function Recu() {
6
	public function Recu() {
7
 
7
 
8
		require_once('bibliotheque/tcpdf/config/lang/fra.php');
8
		require_once('bibliotheque/tcpdf/config/lang/fra.php');
9
		require 'bibliotheque/tcpdf/tcpdf.php';
9
		require 'bibliotheque/tcpdf/tcpdf.php';
10
		require 'bibliotheque/Words/Words.php';
10
		require 'bibliotheque/Words/Words.php';
11
		// Constante nécessaire à fpdf.php
11
		// Constante nécessaire à fpdf.php
12
		parent::__construct();
12
		parent::__construct();
13
	}
13
	}
14
 
14
 
15
	public function fabriquerRecuPdf($utilisateur, $cotisation) {
15
	public function fabriquerRecuPdf($utilisateur, $cotisation) {
16
	
16
	
17
		$num_recu = $cotisation['recu_envoye'];
17
		$num_recu = $cotisation['recu_envoye'];
18
		
18
		
19
		$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
19
		$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
20
		
20
		
21
		//$pdf->Open();
21
		//$pdf->Open();
22
		$pdf->SetTitle('Recu pour don à Tela Botanica');
22
		$pdf->SetTitle('Recu pour don à Tela Botanica');
23
		
23
		
24
		$pdf->SetFont('helvetica','',14);
24
		$pdf->SetFont('helvetica','',14);
25
		
25
		
26
		$pdf->AddPage();
26
		$pdf->AddPage();
27
		
27
		
28
		$pdf->Line(10, 10, 200, 10) ;
28
		$pdf->Line(10, 10, 200, 10) ;
29
 
29
 
30
		// Contenu du document
30
		// Contenu du document
31
		
31
		
32
		$pdf->SetFont('helvetica', '', 8) ;
32
		$pdf->SetFont('helvetica', '', 8) ;
33
		
33
		
34
		$pdf->Cell(150, 10, "", 0, 0) ;
34
		$pdf->Cell(150, 10, "", 0, 0) ;
35
		
35
		
36
		$pdf->MultiCell(40, 10, "Numéro d'ordre : $num_recu", 1, "C") ;
36
		$pdf->MultiCell(40, 10, "Numéro d'ordre : $num_recu", 1, "C") ;
37
		
37
		
38
		$pdf->SetY($pdf->GetY() - 10) ;
38
		$pdf->SetY($pdf->GetY() - 10) ;
39
		
39
		
40
		$pdf->SetFont('helvetica','B',14);
40
		$pdf->SetFont('helvetica','B',14);
41
		$pdf->Cell(0,10,'Reçu dons aux oeuvres', 0, 1, "C");
41
		$pdf->Cell(0,10,'Reçu dons aux oeuvres', 0, 1, "C");
42
		$pdf->SetFont('helvetica', '', 10) ;
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") ;
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
		
44
		
45
		$pdf->Cell(0, 10, 'REÇU A CONSERVER ET A JOINDRE A VOTRE DECLARATION DE REVENUS '.$cotisation['annee_cotisation'], 0, 1, "L") ;
45
		$pdf->Cell(0, 10, 'REÇU A CONSERVER ET A JOINDRE A VOTRE DECLARATION DE REVENUS '.$cotisation['annee_cotisation'], 0, 1, "L") ;
46
		
46
		
47
		// On met le logo de Tela
47
		// On met le logo de Tela
48
		$pdf->Image(dirname(__FILE__)."/logo_tela.png", 12, 40, "29", "", "PNG", "http://www.tela-botanica.org/") ;
48
		$pdf->Image(dirname(__FILE__)."/logo_tela.png", 12, 40, "29", "", "PNG", "http://www.tela-botanica.org/") ;
49
		
49
		
50
		// On écrit Les titres du cadre
50
		// On écrit Les titres du cadre
51
		$pdf->SetFontSize(12) ;
51
		$pdf->SetFontSize(12) ;
52
		$pdf->Cell(100, 10, 'Bénéficiaire du don', 0, 0, "C") ;
52
		$pdf->Cell(100, 10, 'Bénéficiaire du don', 0, 0, "C") ;
53
		$pdf->Cell(100, 10, 'Donateur', 0, 1, "C") ;
53
		$pdf->Cell(100, 10, 'Donateur', 0, 1, "C") ;
54
		
54
		
55
		$pdf->Cell(38, 5, '', 0, 0) ;
55
		$pdf->Cell(38, 5, '', 0, 0) ;
56
		$pdf->Cell(62, 5, 'Association Tela Botanica', 0, 0, "L") ;
56
		$pdf->Cell(62, 5, 'Association Tela Botanica', 0, 0, "L") ;
57
		
57
		
58
		$pdf->SetFont('helvetica', 'B', 10) ;
58
		$pdf->SetFont('helvetica', 'B', 10) ;
59
		
59
		
60
		$pdf->Cell(100, 5, $utilisateur['nom']['amv_valeur'].' '.$utilisateur['prenom']['amv_valeur'], 0, 1, "L") ;
60
		$pdf->Cell(100, 5, $utilisateur['nom']['amv_valeur'].' '.$utilisateur['prenom']['amv_valeur'], 0, 1, "L") ;
61
		
61
		
62
		$pdf->SetFont('helvetica', '', 10) ;
62
		$pdf->SetFont('helvetica', '', 10) ;
63
		
63
		
64
		$pdf->Cell(38, 5, '', 0, 0) ;
64
		$pdf->Cell(38, 5, '', 0, 0) ;
65
		$pdf->Cell(62, 5, 'Institut de Botanique', 0, 1, "L") ;
65
		$pdf->Cell(62, 5, 'Institut de Botanique', 0, 1, "L") ;
66
		$pdf->Cell(38, 5, '', 0, 0) ;
66
		$pdf->Cell(38, 5, '', 0, 0) ;
67
		$pdf->Cell(62, 5, '163, rue A. Broussonnet', 0, 0, "L") ;
67
		$pdf->Cell(62, 5, '163, rue A. Broussonnet', 0, 0, "L") ;
68
		$pdf->Cell(100, 5, $utilisateur['adresse']['amv_valeur'], 0, 1, "L") ;
68
		$pdf->Cell(100, 5, $utilisateur['adresse']['amv_valeur'], 0, 1, "L") ;
69
				
69
				
70
		$pdf->Cell(38, 5, '', 0, 0) ;
70
		$pdf->Cell(38, 5, '', 0, 0) ;
71
		$pdf->Cell(62, 5, '34090 Montpellier', 0, 0, "L") ;
71
		$pdf->Cell(62, 5, '34090 Montpellier', 0, 0, "L") ;
72
		$pdf->Cell(100, 8, $utilisateur['adresse_comp']['amv_valeur'], 0, 1, "L") ;
72
		$pdf->Cell(100, 8, $utilisateur['adresse_comp']['amv_valeur'], 0, 1, "L") ;
73
		
73
		
74
		
74
		
75
		$pdf->Cell(100, 5, 'Objet :', 0,1, "L") ;
75
		$pdf->Cell(100, 5, 'Objet :', 0,1, "L") ;
76
		$pdf->SetFontSize(8) ;
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'.
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, "") ;
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, "") ;
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
		
80
		
81
		$pdf->SetFontSize(10) ;
81
		$pdf->SetFontSize(10) ;
82
		
82
		
83
		$pdf->Text(111, 58 + 8, $utilisateur['code_postal']['amv_valeur'].' '.$utilisateur['ville']['amv_valeur']) ;
83
		$pdf->Text(111, 58 + 8, $utilisateur['code_postal']['amv_valeur'].' '.$utilisateur['ville']['amv_valeur']) ;
84
		$pdf->SetFontSize(8) ;
84
		$pdf->SetFontSize(8) ;
85
		
85
		
86
		// On remonte le curseur de 52
86
		// On remonte le curseur de 52
87
		$pdf->SetY($pdf->GetY() - 30) ;
87
		$pdf->SetY($pdf->GetY() - 30) ;
88
		
88
		
89
		// Le cadre central
89
		// Le cadre central
90
		$pdf->Cell(100, 60, '', 1) ;
90
		$pdf->Cell(100, 60, '', 1) ;
91
		$pdf->Cell(90, 60, '', 1) ;
91
		$pdf->Cell(90, 60, '', 1) ;
92
		$pdf->Ln() ;
92
		$pdf->Ln() ;
93
		
93
		
94
		$pdf->SetFontSize(10) ;
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") ;
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
		
96
		
97
		$wordsConverter = new Numbers_Words() ;
97
		$wordsConverter = new Numbers_Words() ;
98
		$montantLettres = $wordsConverter->toWords($cotisation['montant_cotisation'],'fr') ;
98
		$montantLettres = $wordsConverter->toWords($cotisation['montant_cotisation'],'fr') ;
99
				
99
				
100
		$pdf->SetFont('helvetica', 'B', 11) ;
100
		$pdf->SetFont('helvetica', 'B', 11) ;
101
		$pdf->Cell(0,10,  "*** ".$cotisation['montant_cotisation']." euros ***", 0, 1, "C") ;
101
		$pdf->Cell(0,10,  "*** ".$cotisation['montant_cotisation']." euros ***", 0, 1, "C") ;
102
		$pdf->Ln() ;
102
		$pdf->Ln() ;
103
		$pdf->Cell(0,10,  "*** (".$montantLettres." euros) ***", 0, 1, "C") ;
103
		$pdf->Cell(0,10,  "*** (".$montantLettres." euros) ***", 0, 1, "C") ;
104
		
104
		
105
		$pdf->SetFont('helvetica', '', 10) ;
105
		$pdf->SetFont('helvetica', '', 10) ;
106
		
106
		
107
		$pdf->Ln() ;
107
		$pdf->Ln() ;
108
		$pdf->Cell(100,10, "Date du paiement : ".$cotisation['date_cotisation'], 0, 0, "L") ;
108
		$pdf->Cell(100,10, "Date du paiement : ".$cotisation['date_cotisation'], 0, 0, "L") ;
109
		$pdf->Cell(100, 10, 'Montpellier, le '.$cotisation['date_envoi_recu'], 0, 1, "L") ;
109
		$pdf->Cell(100, 10, 'Montpellier, le '.$cotisation['date_envoi_recu'], 0, 1, "L") ;
110
				
110
				
111
		// La signature de David Delon
111
		// La signature de Daniel Mathieu
112
		$pdf->Image(dirname(__FILE__).'/signature_Daniel.png', 110, $pdf->GetY(),28.22, "") ;
112
		$pdf->Image(dirname(__FILE__).'/signature_Daniel.png', 110, $pdf->GetY(),28.22, "") ;
113
				
113
				
114
		$pdf->Ln() ;
114
		$pdf->Ln() ;
115
		$pdf->Cell(0, 10, "Mode de versement : ".$cotisation['mode_cotisation'], 0, 1, "L") ;
115
		$pdf->Cell(0, 10, "Mode de versement : ".$cotisation['mode_cotisation'], 0, 1, "L") ;
116
		
116
		
117
		$pdf->Cell(100, 10, '', 0, 0) ;
117
		$pdf->Cell(100, 10, '', 0, 0) ;
118
		$pdf->Cell (100, 10, 'Daniel Mathieu, Président', 0, 1, "L") ;
118
		$pdf->Cell (100, 10, 'Daniel Mathieu, Président', 0, 1, "L") ;
119
		$pdf->Ln(5) ;
119
		$pdf->Ln(5) ;
120
		
120
		
121
		$pdf->SetFontSize(10) ;
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") ;
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
	
123
	
124
		return $pdf;
124
		return $pdf;
125
	}
125
	}
126
	
126
	
127
	public function afficherRecuPdf($utilisateur, $cotisation) {
127
	public function afficherRecuPdf($utilisateur, $cotisation) {
128
		
128
		
129
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
129
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
130
		$pdf->Output();
130
		$pdf->Output();
131
		exit;
131
		exit;
132
	}
132
	}
133
	
133
	
134
	public function renvoyerRecuPdf($utilisateur, $cotisation) {
134
	public function renvoyerRecuPdf($utilisateur, $cotisation) {
135
		
135
		
136
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
136
		$pdf = $this->fabriquerRecuPdf($utilisateur, $cotisation);
137
		
137
		
138
		$contenu_pdf = $pdf->Output('','S');
138
		$contenu_pdf = $pdf->Output('','S');
139
		
139
		
140
		return $contenu_pdf;
140
		return $contenu_pdf;
141
	}
141
	}
142
}
142
}
143
?>
143
?>