Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
2 |
// ticket d'impression (thank's to Geoffroy MUSITELLI)
|
2 |
// ticket d'impression (thank's to Geoffroy MUSITELLI)
|
3 |
//--recupération des variables provenant du formulaire
|
3 |
//--recupération des variables provenant du formulaire
|
4 |
// Etiquettes
|
- |
|
5 |
$l_login_imp=utf8_decode($_POST["l_login_imp"]);
|
4 |
$langue_imp=utf8_decode($_POST["langue_imp"]);
|
6 |
$l_password_imp=utf8_decode($_POST["l_password_imp"]);
|
- |
|
7 |
$l_max_all_session_imp=utf8_decode($_POST["l_max_all_session_imp"]);
|
- |
|
8 |
$l_session_timeout_imp=utf8_decode($_POST["l_session_timeout_imp"]);
|
- |
|
9 |
$l_max_daily_session_imp=utf8_decode($_POST["l_max_daily_session_imp"]);
|
- |
|
10 |
$l_max_monthly_session_imp=utf8_decode($_POST["l_max_monthly_session_imp"]);
|
- |
|
11 |
$l_expiration_imp=utf8_decode($_POST["l_expiration_imp"]);
|
- |
|
12 |
// Valeurs
|
- |
|
13 |
$log_imp=utf8_decode($_POST["log_imp"]);
|
5 |
$log_imp=utf8_decode($_POST["log_imp"]);
|
14 |
$passwd_imp=utf8_decode($_POST["passwd_imp"]);
|
6 |
$passwd_imp=utf8_decode($_POST["passwd_imp"]);
|
15 |
$exp_imp=utf8_decode($_POST["exp_imp"]);
|
7 |
$exp_imp=utf8_decode($_POST["exp_imp"]);
|
16 |
$sto_imp=utf8_decode($_POST["sto_imp"]);
|
8 |
$sto_imp=utf8_decode($_POST["sto_imp"]);
|
17 |
$mas_imp=utf8_decode($_POST["mas_imp"]);
|
9 |
$mas_imp=utf8_decode($_POST["mas_imp"]);
|
18 |
$mds_imp=utf8_decode($_POST["mds_imp"]);
|
10 |
$mds_imp=utf8_decode($_POST["mds_imp"]);
|
19 |
$mms_imp=utf8_decode($_POST["mms_imp"]);
|
11 |
$mms_imp=utf8_decode($_POST["mms_imp"]);
|
20 |
|
- |
|
21 |
//--initialisation des classes FPDF
|
12 |
//--initialisation des classes FPDF
|
- |
|
13 |
//Langue du Ticket d'impression en fonction de la liste déroulante
|
- |
|
14 |
switch ($langue_imp){
|
- |
|
15 |
case 'fr':
|
- |
|
16 |
$l_title_imp = "TICKET ACCÈS INTERNET";
|
- |
|
17 |
$l_login_imp = "Utilisateur :";
|
- |
|
18 |
$l_password_imp = "Mot de passe :";
|
- |
|
19 |
$l_max_all_session_imp="Durée totale autoriséee :";
|
- |
|
20 |
$l_session_timeout_imp="Durée d'une session :";
|
- |
|
21 |
$l_max_daily_session_imp="Durée journalière :";
|
- |
|
22 |
$l_max_monthly_session_imp ="Durée mensuelle :";
|
- |
|
23 |
$l_expiration_imp="Date d'expiration :";
|
- |
|
24 |
$v_illimit="Illimitée";
|
- |
|
25 |
$v_without="Aucune";
|
- |
|
26 |
break;
|
- |
|
27 |
case 'de':
|
- |
|
28 |
$l_title_imp = "GUTSCHEIN SPRACHE";
|
- |
|
29 |
$l_login_imp = "Login :";
|
- |
|
30 |
$l_password_imp = "Passwort :";
|
- |
|
31 |
$l_max_all_session_imp="Maximale erlaubt Dauer :";
|
- |
|
32 |
$l_session_timeout_imp="Dauer der Sitzung :";
|
- |
|
33 |
$l_max_daily_session_imp="Stunden täglich :";
|
- |
|
34 |
$l_max_monthly_session_imp ="monatlich Dauer :";
|
- |
|
35 |
$l_expiration_imp="Verfallsdatum :";
|
- |
|
36 |
$v_illimit="Unbegrentz";
|
- |
|
37 |
$v_without="Ohne";
|
- |
|
38 |
break;
|
- |
|
39 |
case 'nl':
|
- |
|
40 |
$l_title_imp = "ONTVANGST INTERNET";
|
- |
|
41 |
$l_login_imp = "Gebruikers :";
|
- |
|
42 |
$l_password_imp = "Wachtwoord :";
|
- |
|
43 |
$l_max_all_session_imp="Maximun all session time :"; // a traduire
|
- |
|
44 |
$l_session_timeout_imp="Sessieduur :";
|
- |
|
45 |
$l_max_daily_session_imp="Dagelijkse uren :";
|
- |
|
46 |
$l_max_monthly_session_imp ="Maandelijkse duur :";
|
- |
|
47 |
$l_expiration_imp="Vervaldatum :";
|
- |
|
48 |
$v_illimit="Onbeperkte";
|
- |
|
49 |
$v_without="Ohne";
|
- |
|
50 |
break;
|
- |
|
51 |
case 'es':
|
- |
|
52 |
$l_title_imp = "BONO INTERNET";
|
- |
|
53 |
$l_login_imp = "Usuario :";
|
- |
|
54 |
$l_password_imp = "Contraseña :";
|
- |
|
55 |
$l_max_all_session_imp="Maximun all session time :"; // a traduire
|
- |
|
56 |
$l_session_timeout_imp="Duraciôn de Sesiôn :";
|
- |
|
57 |
$l_max_daily_session_imp="Horas diarias :";
|
- |
|
58 |
$l_max_monthly_session_imp ="Duraciôn mensual :";
|
- |
|
59 |
$l_expiration_imp="Fecha de caducidad :";
|
- |
|
60 |
$v_illimit="Ilimitado";
|
- |
|
61 |
$v_without="Sin";
|
- |
|
62 |
break;
|
- |
|
63 |
case 'it':
|
- |
|
64 |
$l_title_imp = "RICEVIMENTO INTERNET";
|
- |
|
65 |
$l_login_imp = "Utenti :";
|
- |
|
66 |
$l_password_imp = "Password :";
|
- |
|
67 |
$l_max_all_session_imp="Maximun all session time :"; // a traduire
|
- |
|
68 |
$l_session_timeout_imp="Durata della sessione :";
|
- |
|
69 |
$l_max_daily_session_imp="Ore giornaliere :";
|
- |
|
70 |
$l_max_monthly_session_imp ="Durata mensile :";
|
22 |
require('../../lib/fpdf16/fpdf.php');
|
71 |
$l_expiration_imp="Data di scadenza :";
|
- |
|
72 |
$v_illimit="Illimitato";
|
- |
|
73 |
$v_without="Senza";
|
- |
|
74 |
break;
|
- |
|
75 |
default:
|
- |
|
76 |
$l_title_imp = "INTERNET VOUCHER";
|
- |
|
77 |
$l_login_imp = "Login :";
|
- |
|
78 |
$l_password_imp = "Password :";
|
- |
|
79 |
$l_max_all_session_imp="Maximun all session time :";
|
- |
|
80 |
$l_session_timeout_imp="Session timeout :";
|
- |
|
81 |
$l_max_daily_session_imp="Max daily session :";
|
- |
|
82 |
$l_max_monthly_session_imp ="Max monthly session :";
|
- |
|
83 |
$l_expiration_imp="Expiration date :";
|
- |
|
84 |
$v_illimit="Unlimited";
|
- |
|
85 |
$v_without="Without";
|
- |
|
86 |
break;
|
23 |
|
87 |
}
|
- |
|
88 |
//echo "$langue_imp - $l_login_imp - $exp_imp - $l_title_imp";
|
- |
|
89 |
//exit;
|
24 |
//création de la classe PDF pour faire l'entête et pieds de page
|
90 |
//création de la classe PDF pour faire l'entête et pieds de page
|
- |
|
91 |
require('../../lib/fpdf17/fpdf.php');
|
25 |
class PDF extends FPDF
|
92 |
class PDF extends FPDF
|
26 |
{
|
93 |
{
|
27 |
//Entête
|
94 |
//Entête
|
28 |
function Header()
|
95 |
function Header()
|
29 |
{
|
96 |
{
|
30 |
$l_title_imp=utf8_decode($_POST["l_title_imp"]);
|
97 |
global $l_title_imp;
|
31 |
//Logo coordonnées x , y, largeur de l'image ---Attention fpdf ne supporte pas le png avec fond transparent----
|
98 |
//Logo coordonnées x , y, largeur de l'image
|
32 |
// $this->Image('../../../images/organisme.jpg',25,5,25);
|
99 |
$this->Image('../../../images/logo-alcasar.png',25,5,25);
|
33 |
//Police Arial gras 15
|
100 |
//Police Arial gras 15
|
34 |
$this->SetFont('Arial','B',18);
|
101 |
$this->SetFont('Arial','B',18);
|
35 |
//couleur de l'écriture en rouge
|
102 |
//couleur de l'écriture en rouge
|
36 |
$this->SetTextColor(250,1,10);
|
103 |
$this->SetTextColor(250,1,10);
|
37 |
//Titre largeur cellule x , hauteur y, texte, bordure 0 , Indique où déplace la prochaine position courante 0 droite, centré C
|
104 |
//Titre largeur cellule x , hauteur y, texte, bordure 0 , Indique où déplace la prochaine position courante 0 droite, centré C
|
Line 48... |
Line 115... |
48 |
$this->SetFont('Arial','I',8);
|
115 |
$this->SetFont('Arial','I',8);
|
49 |
//Produit par est volontairement resté en français
|
116 |
//Produit par est volontairement resté en français
|
50 |
$this->Cell(200,20,'Produit par : ALCASAR',0,0,'C');
|
117 |
$this->Cell(200,20,'Produit par : ALCASAR',0,0,'C');
|
51 |
}
|
118 |
}
|
52 |
//fonction rectangle
|
119 |
//fonction rectangle
|
53 |
//Rectangle :
|
- |
|
54 |
//x, y : coin supérieur gauche du rectangle.w, h : largeur et hauteur. r : rayon des coins arrondis.
|
120 |
//Rectangle : x, y : coin supérieur gauche du rectangle.w, h : largeur et hauteur. r : rayon des coins arrondis.
|
55 |
//style : comme celui de Rect() : F, D (défaut), FD ou DF.
|
121 |
//style : comme celui de Rect() : F, D (défaut), FD ou DF.
|
56 |
function RoundedRect($x, $y, $w, $h, $r, $style = '')
|
122 |
function RoundedRect($x, $y, $w, $h, $r, $style = '')
|
57 |
{
|
123 |
{
|
58 |
$k = $this->k;
|
124 |
$k = $this->k;
|
59 |
$hp = $this->h;
|
125 |
$hp = $this->h;
|
60 |
if($style=='F')
|
126 |
if($style=='F')
|
Line 145... |
Line 211... |
145 |
$pdf->Cell(45,10,$l_expiration_imp,0,0,'R');
|
211 |
$pdf->Cell(45,10,$l_expiration_imp,0,0,'R');
|
146 |
$pdf->SetFont('Arial','B',12);
|
212 |
$pdf->SetFont('Arial','B',12);
|
147 |
$pdf->Cell(45,10,$exp_imp,0,1,'L');
|
213 |
$pdf->Cell(45,10,$exp_imp,0,1,'L');
|
148 |
|
214 |
|
149 |
//renvoie au navigateur du document
|
215 |
//renvoie au navigateur du document
|
- |
|
216 |
$ticket_name="ticket_".$log_imp.".pdf";
|
150 |
$pdf->Output('ticket.pdf','I');
|
217 |
$pdf->Output($ticket_name,'D');
|
151 |
|
218 |
|
152 |
?>
|
219 |
?>
|