1,5 → 1,4 |
<?php |
require_once('/var/www/html/acc/manager/lib/alcasar/ticketspdf.class.php'); |
// ticket d'impression (thank's to Geoffroy MUSITELLI) |
//--recupération des variables provenant du formulaire |
$langue_imp=utf8_decode($_POST["langue_imp"]); |
16,11 → 15,8 |
case 'fr': |
$l_title_imp = "TICKET D'ACCÈS INTERNET"; |
$l_footer_imp = "Généré par ALCASAR"; |
//$l_explain1_imp = "Entrer 'alcasar' dans votre navigateur pour gérer votre compte (mot de passe, certificat, etc.)."; |
//$l_explain2_imp = "Entrer 'logout' dans votre navigateur pour vous déconnecter."; |
$l_explain = "Entrer 'alcasar' dans votre navigateur pour gérer votre compte |
(mot de passe, certificat, etc.). |
Entrer 'logout' dans votre navigateur pour vous déconnecter."; |
$l_explain1_imp = "Entrer 'alcasar' dans votre navigateur pour gérer votre compte (mot de passe, certificat, etc.)."; |
$l_explain2_imp = "Entrer 'logout' dans votre navigateur pour vous déconnecter."; |
$l_login_imp = "Utilisateur :"; |
$l_password_imp = "Mot de passe :"; |
$l_max_all_session_imp="Durée totale autorisée :"; |
30,16 → 26,12 |
$l_expiration_imp="Date d'expiration :"; |
$l_unlimited="Illimitée"; |
$l_without="Aucune"; |
$l_duplicate="Duplicata"; |
break; |
case 'de': |
$l_title_imp = "INTERNETZUGANG TICKET"; |
$l_footer_imp = "Präsentiert von ALCASAR"; |
//$l_explain1_imp = "Geben Sie 'Alcasar' in Ihrem Browser, um Ihr Konto zu verwalten (kennwort, zertifikat, etc.)."; |
//$l_explain2_imp = "Geben Sie 'logout' in Ihrem Browser zu trennen."; |
$l_explain = "Geben Sie 'Alcasar' in Ihrem Browser, um Ihr Konto zu verwalten (kennwort, zertifikat, etc.). |
Geben Sie 'logout' in Ihrem Browser zu trennen. |
"; |
$l_explain1_imp = "Geben Sie 'Alcasar' in Ihrem Browser, um Ihr Konto zu verwalten (kennwort, zertifikat, etc.)."; |
$l_explain2_imp = "Geben Sie 'logout' in Ihrem Browser zu trennen."; |
$l_login_imp = "Login :"; |
$l_password_imp = "Passwort :"; |
$l_max_all_session_imp="Maximale erlaubt Dauer :"; |
49,15 → 41,12 |
$l_expiration_imp="Verfallsdatum :"; |
$l_unlimited="Unbegrentz"; |
$l_without="Ohne"; |
$l_duplicate="Duplikat"; |
break; |
case 'nl': |
$l_title_imp = "ONTVANGST INTERNET"; |
$l_footer_imp = "Powered by ALCASAR"; |
//$l_explain1_imp = "Voer 'Alcasar' in uw browser om uw account te beheren (wachtwoord, certificaat, etc.)."; |
//$l_explain2_imp = "Voer 'logout' in uw browser de verbinding te verbreken."; |
$l_explain = "Voer 'Alcasar' in uw browser om uw account te beheren (wachtwoord, certificaat, etc.). |
Voer 'logout' in uw browser de verbinding te verbreken."; |
$l_explain1_imp = "Voer 'Alcasar' in uw browser om uw account te beheren (wachtwoord, certificaat, etc.)."; |
$l_explain2_imp = "Voer 'logout' in uw browser de verbinding te verbreken."; |
$l_login_imp = "Gebruikers :"; |
$l_password_imp = "Wachtwoord :"; |
$l_max_all_session_imp="Totaal toegestane tijd :"; |
67,15 → 56,12 |
$l_expiration_imp="Vervaldatum :"; |
$l_unlimited="Onbeperkte"; |
$l_without="Ohne"; |
$l_duplicate="Duplicaat"; |
break; |
case 'es': |
$l_title_imp = "BONO INTERNET"; |
$l_footer_imp = "Desarrollado por ALCASAR"; |
//$l_explain1_imp = "Escribe 'Alcasar' de su navegador para administrar su cuenta (contraseña, certificado, etc.)."; |
//$l_explain2_imp = "Escribe 'logout' de su navegador para desconectar."; |
$l_explain = "Escribe 'Alcasar' de su navegador para administrar su cuenta (contraseña, certificado, etc.). |
Escribe 'logout' de su navegador para desconectar."; |
$l_explain1_imp = "Escribe 'Alcasar' de su navegador para administrar su cuenta (contraseña, certificado, etc.)."; |
$l_explain2_imp = "Escribe 'logout' de su navegador para desconectar."; |
$l_login_imp = "Usuario :"; |
$l_password_imp = "Contraseña :"; |
$l_max_all_session_imp="Tiempo total permitido :"; |
85,15 → 71,12 |
$l_expiration_imp="Fecha de caducidad :"; |
$l_unlimited="Ilimitado"; |
$l_without="Sin"; |
$l_duplicate="Duplicado"; |
break; |
case 'it': |
$l_title_imp = "RICEVIMENTO INTERNET"; |
$l_footer_imp = "Powered by ALCASAR"; |
//$l_explain1_imp = "Inserisci 'alcasar' nel tuo browser per gestire il tuo account (password, certificato, ecc)."; |
//$l_explain2_imp = "Inserisci 'logout' nel tuo browser per disconnettersi."; |
$l_explain = "Inserisci 'alcasar' nel tuo browser per gestire il tuo account (password, certificato, ecc). |
Inserisci 'logout' nel tuo browser per disconnettersi."; |
$l_explain1_imp = "Inserisci 'alcasar' nel tuo browser per gestire il tuo account (password, certificato, ecc)."; |
$l_explain2_imp = "Inserisci 'logout' nel tuo browser per disconnettersi."; |
$l_login_imp = "Utenti :"; |
$l_password_imp = "Password :"; |
$l_max_all_session_imp="Tempo totale consentito:"; |
103,15 → 86,12 |
$l_expiration_imp="Data di scadenza :"; |
$l_unlimited="Illimitato"; |
$l_without="Senza"; |
$l_duplicate="Duplicato"; |
break; |
case 'pt': |
$l_title_imp = "BILHETE DE ACESSO À INTERNET"; |
$l_footer_imp = "Desenvolvido por ALCASAR"; |
//$l_explain1_imp = "Digite 'Alcasar' no seu navegador para gerenciar sua conta (senha, certidão, etc)."; |
//$l_explain2_imp = "Digite 'logout' no seu navegador para desligar."; |
$l_explain = "Digite 'Alcasar' no seu navegador para gerenciar sua conta (senha, certidão, etc). |
Digite 'logout' no seu navegador para desligar."; |
$l_explain1_imp = "Digite 'Alcasar' no seu navegador para gerenciar sua conta (senha, certidão, etc)."; |
$l_explain2_imp = "Digite 'logout' no seu navegador para desligar."; |
$l_login_imp = "Usuário :"; |
$l_password_imp = "Senha :"; |
$l_max_all_session_imp="Tempo máximo de toda conexão :"; |
121,15 → 101,12 |
$l_expiration_imp="Data de vencimento :"; |
$l_unlimited="Ilimitado"; |
$l_without="Sem"; |
$l_duplicate="Duplicado"; |
break; |
default: |
$l_title_imp = "INTERNET ACCESS TICKET"; |
$l_footer_imp = "Powered by ALCASAR"; |
//$l_explain1_imp = "Enter 'alcasar' in your browser to manage your account (password, certificate, etc.)."; |
//$l_explain2_imp = "Enter 'logout' in your browser to disconnect."; |
$l_explain = "Enter 'alcasar' in your browser to manage your account (password, certificate, etc.). |
Enter 'logout' in your browser to disconnect."; |
$l_explain1_imp = "Enter 'alcasar' in your browser to manage your account (password, certificate, etc.)."; |
$l_explain2_imp = "Enter 'logout' in your browser to disconnect."; |
$l_login_imp = "Login :"; |
$l_password_imp = "Password :"; |
$l_max_all_session_imp="Total time allowed :"; |
139,46 → 116,144 |
$l_expiration_imp="Expiration date :"; |
$l_unlimited="Unlimited"; |
$l_without="Without"; |
$l_duplicate="Duplicate"; |
break; |
} |
|
/* Si les valeurs de durée sont égal à '-' remplissage avec la valeur 'Illimitée'*/ |
if ($sto_imp=='-'){ $sto_imp=$l_unlimited;} |
if ($mas_imp=='-'){ $mas_imp=$l_unlimited;} |
if ($mds_imp=='-'){ $mds_imp=$l_unlimited;} |
if ($mms_imp=='-'){ $mms_imp=$l_unlimited;} |
//création de la classe PDF pour faire l'entête et pieds de page |
// Ajout d'un ticket sur la fiche PDF |
require('../lib/fpdf/fpdf.php'); |
class PDF extends FPDF |
{ |
//Entête |
function Header() |
{ |
global $l_title_imp; |
//Logo coordonnées x , y, largeur de l'image |
$this->Image('../../../images/logo-alcasar.png',30,15,30); |
$this->Image('../../../images/organisme.png',150,15,25); |
//Police Arial gras 15 |
$this->SetFont('Arial','B',18); |
//couleur de l'écriture en rouge |
$this->SetTextColor(250,1,10); |
//Titre largeur cellule x , hauteur y, texte, bordure 0 , Indique où déplace la prochaine position courante 0 droite, centré C |
$this->Cell(190,10,utf8_decode($l_title_imp),0,0,'C'); |
//Saut de ligne |
$this->Ln(25); |
} |
//Pied de page |
function Footer() |
{ |
global $l_footer_imp; |
//Positionnement à 1,5 cm du bas |
$this->SetY(-15); |
//Police Arial italique 8 |
$this->SetFont('Arial','I',8); |
$this->Cell(200,20,utf8_decode($l_footer_imp),0,0,'C'); |
} |
//fonction rectangle |
//Rectangle : x, y : coin supérieur gauche du rectangle.w, h : largeur et hauteur. r : rayon des coins arrondis. |
//style : comme celui de Rect() : F, D (défaut), FD ou DF. |
function RoundedRect($x, $y, $w, $h, $r, $style = '') |
{ |
$k = $this->k; |
$hp = $this->h; |
if($style=='F') |
$op='f'; |
elseif($style=='FD' or $style=='DF') |
$op='B'; |
else |
$op='S'; |
$MyArc = 4/3 * (sqrt(2) - 1); |
$this->_out(sprintf('%.2F %.2F m',($x+$r)*$k,($hp-$y)*$k )); |
$xc = $x+$w-$r ; |
$yc = $y+$r; |
$this->_out(sprintf('%.2F %.2F l', $xc*$k,($hp-$y)*$k )); |
|
// Préparation de la fiche PDF |
$pdf = new ticketsPDF(2,3); |
$pdf->setTicketsTitle($l_title_imp); |
$pdf->setTicketsFooter($l_footer_imp); |
$pdf->newTickets(); |
$pdf->Ln(5); |
$pdf->addInfos($l_login_imp, $log_imp); |
$pdf->addInfos($l_password_imp, $passwd_imp); |
$pdf->Ln(5); |
$pdf->addInfos($l_max_all_session_imp, $mas_imp); |
$pdf->addInfos($l_session_timeout_imp, $sto_imp); |
$pdf->addInfos($l_max_daily_session_imp, $mds_imp); |
$pdf->addInfos($l_expiration_imp, $exp_imp); |
$pdf->Ln(10); |
$pdf->addComment($l_explain); |
$this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc); |
$xc = $x+$w-$r ; |
$yc = $y+$h-$r; |
$this->_out(sprintf('%.2F %.2F l',($x+$w)*$k,($hp-$yc)*$k)); |
$this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r); |
$xc = $x+$r ; |
$yc = $y+$h-$r; |
$this->_out(sprintf('%.2F %.2F l',$xc*$k,($hp-($y+$h))*$k)); |
$this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc); |
$xc = $x+$r ; |
$yc = $y+$r; |
$this->_out(sprintf('%.2F %.2F l',($x)*$k,($hp-$yc)*$k )); |
$this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r); |
$this->_out($op); |
} |
//fonction arc de cercle |
function _Arc($x1, $y1, $x2, $y2, $x3, $y3) |
{ |
$h = $this->h; |
$this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c ', $x1*$this->k, ($h-$y1)*$this->k, |
$x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k)); |
} |
} |
|
// Création du duplicata |
$pdf->newTickets(); |
//création du constructeur pdf avec fpdf : portrait P sinon paysage L, unite mm, page A4 |
$pdf = new PDF('L','mm','A5'); |
$pdf->AliasNbPages(); |
//creation de la page |
$pdf->Addpage(); |
//Couleur du texte en noir |
$pdf->SetTextColor(0); |
|
//création du cadre arrondi qui entoure le ticket d'impression |
//x, y : coin supérieur gauche du rectangle.w, h : largeur et hauteur. r : rayon des coins arrondis. |
//style : comme celui de Rect() : F, D (défaut), FD ou DF. |
$pdf->RoundedRect(40, 32, 130, 80, 3.5, 'D'); |
//création utilisateur et mot de passe coordonnées x , y hauteur et largeur , texte |
$pdf->Ln(5); |
$pdf->addInfos($l_login_imp, $log_imp); |
$pdf->addInfos($l_password_imp, $passwd_imp); |
$pdf->Ln(5); |
$pdf->addInfos($l_max_all_session_imp, $mas_imp); |
$pdf->addInfos($l_session_timeout_imp, $sto_imp); |
$pdf->addInfos($l_max_daily_session_imp, $mds_imp); |
$pdf->addInfos($l_expiration_imp, $exp_imp); |
$pdf->Ln(10); |
$pdf->addComment($l_duplicate,'C');//à mettre en rouge |
$pdf->SetFont('Arial','',12); |
$pdf->cell(50); |
$pdf->Cell(45,10,utf8_decode($l_login_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
$pdf->Cell(45,10,$log_imp,0,1,'L'); |
$pdf->cell(50); |
$pdf->SetFont('Arial','',12); |
$pdf->Cell(45,10,utf8_decode($l_password_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
$pdf->Cell(45,10,$passwd_imp,0,1,'L'); |
//saut de ligne |
$pdf->Ln(7); |
//création des attributs utilisateurs coordonnées x , y hauteur et largeur , texte |
$pdf->cell(50); |
$pdf->SetFont('Arial','',12); |
$pdf->Cell(45,10,utf8_decode($l_max_all_session_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
if ($mas_imp == "Unlimited") $mas_imp=utf8_decode($l_unlimited); |
$pdf->Cell(45,10,$mas_imp,0,1,'L'); |
$pdf->cell(50); |
$pdf->SetFont('Arial','',12); |
$pdf->Cell(45,10,utf8_decode($l_session_timeout_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
if ($sto_imp == "Unlimited") $sto_imp=utf8_decode($l_unlimited); |
$pdf->Cell(45,10,$sto_imp,0,1,'L'); |
$pdf->cell(50); |
$pdf->SetFont('Arial','',12); |
$pdf->Cell(45,10,utf8_decode($l_max_daily_session_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
if ($mds_imp == "Unlimited") $mds_imp=utf8_decode($l_unlimited); |
$pdf->Cell(45,10,$mds_imp,0,1,'L'); |
//$pdf->SetFont('Arial','',12); |
//$pdf->cell(50); |
//$pdf->Cell(45,10,$l_max_monthly_session_imp,0,0,'R'); |
//$pdf->SetFont('Arial','B',12); |
//$pdf->Cell(45,10,$mms_imp,0,1,'L'); |
$pdf->cell(50); |
$pdf->SetFont('Arial','',12); |
$pdf->Cell(45,10,utf8_decode($l_expiration_imp),0,0,'R'); |
$pdf->SetFont('Arial','B',12); |
if ($exp_imp == "Without") $exp_imp=utf8_decode($l_without); |
$pdf->Cell(45,10,$exp_imp,0,1,'L'); |
$pdf->Ln(7); |
$pdf->cell(30); |
$pdf->SetFont('Arial','',8); |
$pdf->Cell(0,5,utf8_decode($l_explain1_imp),0,1,'L'); |
$pdf->cell(30); |
$pdf->SetFont('Arial','',8); |
$pdf->Cell(0,5,utf8_decode($l_explain2_imp),0,1,'L'); |
|
// envoie du document au navigateur |
$ticket_name="ticket_".$log_imp.".pdf"; |