| Current Path : /home/ataenra/www/ATA/INTRANET/GenPDF/7DossierClient2/ |
| Current File : /home/ataenra/www/ATA/INTRANET/GenPDF/7DossierClient2/genpdfDossier2.php |
<?php
use setasign\Fpdi\Fpdi;
require_once('../Outils/fpdf/fpdf.php');
require_once('../Outils/fpdi-2.3.7/src/autoload.php');
//require('required/modelepdf/grid.php');
//RECUPERATION DES DONNEES
//connexion a la base de donnée
require_once '../Outils/co.php';
//recuperation les informations selon ID en get (page?ID=)
$ID = $_GET['ID'];
$sth = $dbco->prepare("SELECT * FROM dossier D JOIN client C ON D.IDclient=C.IDc JOIN ".$Tp." P ON P.IDp=D.IDprojet WHERE ID = $ID");
$sth->execute();
$R = $sth->fetch(PDO::FETCH_OBJ);
$sth2 = $dbco->prepare("SELECT * FROM tablepac WHERE IDm = '$R->IDm'");
$sth2->execute();
$R2 = $sth2->fetch(PDO::FETCH_OBJ);
//recup date devis correcte
$DDevis = $R->DateDevis;
$DD = new datetime($DDevis);
$DRecep = date('d/m/Y');
// initiate FPDI
$pdf= new FPDI();
$pdf->SetAutoPagebreak(False);
$pdf->AddPage();
$pdf->setSourceFile('../Genpdf/7DossierClient2/required/PV1.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->SetFont('Helvetica','','9');
// Cachet entreprise
$pdf->Image('../Genpdf/7DossierClient2/required/tampon.png',134,46,65);
// Coordonnées maitre ouvrage
$pdf->SetFont('Helvetica','','12');
$pdf->SetXY(40, 85.7);
$pdf->Cell(0,8,''.$R->nom.' '.$R->prenom.'',0,1,'L',false);
//Date devis
$pdf->SetXY(165, 96.5);
$pdf->Cell(0,8,''.$DD->format('d/m/Y').'',0,1,'L',false);
//relatif a
if($R->typeprojet=="PAC_AE_S"||$R->typeprojet=="PAC_AE_M"||$R->typeprojet=="PAC_AE_H"){
$naturetravaux = "Installation Pompe a Chaleur Air/Eau";
}elseif($R->typeprojet=="PAC AA"){
$naturetravaux = "Installation Pompe a Chaleur Air/Air";
}elseif($R->typeprojet=="SOL CESI"){
$naturetravaux = "Installation d un ballon ECS Solaire";
}elseif($R->typeprojet=="SOL SSC"){
$naturetravaux = "Installation d un Systeme Solaire Combine";
}elseif($R->typeprojet=="BOIS P"){
$naturetravaux = "Installation d un Poel a Granules";
}elseif($R->typeprojet=="BOIS C"){
$naturetravaux = "Installation d une chaudiere Biomasse";
}elseif($R->typeprojet=="SOL PACTH"){
$naturetravaux = "Installation d un systeme Hybride PAC et solaire";
}
$pdf->SetXY(35, 100.5);
$pdf->Cell(0,10,''.$naturetravaux.'',0,1,'L',false);
//Fait a
$pdf->SetXY(25, 228);
$pdf->Cell(0,8,''.$R->VilleC.'',0,1,'L',false);
//Le (date)
$pdf->SetXY(75, 228);
$pdf->Cell(0,8,''.$DRecep.'',0,1,'L',false);
//Signature Gerant
// Cachet entreprise
$pdf->Image('../Genpdf/7DossierClient2/required/tampon.png',15,255,65);
//PAGE 2
$pdf->AddPage();
$pdf->setSourceFile('../Genpdf/7DossierClient2/required/PV1.pdf');
$tplIdx = $pdf->importPage(2);
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->SetFont('Helvetica','','9');
//Sortie du fichier
//$pdf->Output("I", 'test');
$pdf->Output('F', '../../FICHIERS/'.$ID.'/A_Signer/PVreception'.$ID.'.pdf');
?>