prestation/Controleur/ControleurAjaximprimerlivraisonbonsdiffere.php
2025-12-05 10:42:46 +00:00

112 lines
3.5 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleurrequete.php'; // OK
require_once 'Modele/Generartionbon.php';
class ControleurAjaximprimerlivraisonbonsdiffere extends Controleurrequete
{
private $generartionbon;
public function __construct()
{
$this->generartionbon = new Generartionbon();
}
public function index()
{
$idgenerartionbon = $this->requete->getParametreFormulaire("idgenerartionbon");
$generartionbon = $this->generartionbon->unegenerationbon($idgenerartionbon) ;
$pdf = new FPDF_Protection();
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=10;
$lg=60;
$pdf->SetMargins(10, 10, 10) ;
$pdf->SetFont('Arial','B', 15);
$pdf->SetY(30);
$pdf->Cell(0,10,convertirc($_SESSION['nomSociete']),1,1,'C',false);
$pdf->Ln(10);
$pdf->SetFont('Arial','BU', 15);
$pdf->SetFontSize(12);
$pdf->Cell(0,10,convertirc(_("BON DE SORTIE DE PRISES EN CHARGE")." No ".$generartionbon['idGenerationbon']),0,1,'C',false);
$pdf->Ln(10);
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_("Prestataire")),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,convertirc(': '.$generartionbon['prestataire']),0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_("TYPE DE PEC")),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".convertirc($generartionbon['typeBon']),0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_("No DE DEPART")),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".format_N($generartionbon['noDepart']),0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_("No DE FIN")),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".format_N($generartionbon['noFin']),0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_('QUANTITE')),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".format_N($generartionbon['nbLigne']),0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_('LIVRES PAR')),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".$generartionbon['utilisateur'],0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_('RECEPTIONNAIRE')),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".$generartionbon['receptionnaire'],0,1,'L');
$pdf->SetFont('Arial','B', 12);
$pdf->Cell($lg,10,convertirc(_('DATE SYSTEME')),0,0,'L',false);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(0,10,": ".dateheureFr($generartionbon['dateSysteme']),0,1,'L');
// dateheureFr(
$pdf->Ln(10);
$pdf->Cell(0,10,convertirc(_('Fait à')).' '.$_SESSION['villeSociete'].', '._('le').' '.heureCouranteLang($_SESSION['lang']),0,1,'C',false);
$fichier="Temp/TMP_bon_livraison_pec"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
// echo '<br> <br> <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> <br> <br> <br> ';
$t_html =' <div class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" >' . _("Télécharger") . ' </a> ';
$t_html .=' </div ';
echo $t_html;
exit();
}
}