Your IP : 216.73.216.65


Current Path : /home/ataenra/www/ATA/INTRANET/Admin/Test/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/Admin/Test/Simulation.php

<?php

    use setasign\Fpdi\Fpdi;

    require_once('../../Outils/fpdf/fpdf.php');

    require_once('../../Outils/FPDI-2.3.7/src/autoload.php');

     



//RECUPERATION DES DONNEES

//connexion a la base de donnée

require_once '../../Outils/co.php';

$ID = $_GET['ID'];

$pdf = new FPDI();

//TEST COMMANDE RECUP TOUTES LES INFOS EN VENANT D IMPORTATION
// initiate FPDI



    $sth1 = $dbco->prepare("SELECT * FROM gest_ens_pac_ae E JOIN gest_gamme_pac G ON E.ID_gamme=G.ID_gamme JOIN gest_join_pac_ae J ON J.ID_ens=E.ID_Ens JOIN gest_produits_pac_ae P ON P.ID_Produit=J.ID_produit WHERE E.ID_Ens = '$ID'");
    $sth1->execute();
    $Info = $sth1->fetch(PDO::FETCH_OBJ);



    

    




    $pdf->AddPage();

     

    $pdf->setSourceFile('../../GenPDF/1Simulation/Required/Bases/Resultat_PACAE.pdf');
    
     
    
    $tplIdx = $pdf->importPage(1);
    
    $pdf->useTemplate($tplIdx, 0, 0, 210);
    
    
    
    //Modele selectionne
    
    $pdf->SetFont('Helvetica','B','12');
    
    $pdf->SetXY(20, 104);
    
    $pdf->Cell(0,6,''.$Info->appel.' '.$Info->Puissance.'',0,1,'L',false);
    
    $pdf->SetFont('Helvetica','','10');
    
    $pdf->SetXY(20, 110);
    
    $pdf->Cell(0,6,''.$Info->modele.'',0,1,'L',false);
    
    $TRegimeau1="Regime d'eau utilise : 35.C"; 
    
    $TRegime='Puissance : a Air -7.C_Eau 30/35.C : ';$CE="CE35"; $NS="NS35"; $Scop="ScopBT35"; $Puissance="P7m35";
    
   
    
    
    
    $pdf->SetFont('Helvetica','','8');
    
    $pdf->SetXY(20, 114);
    
    $pdf->Cell(0,6,"".$TRegimeau1."",0,1,'L',false);
    
    $pdf->SetXY(20, 118);
    
    $pdf->Cell(0,6,''.$TRegime.''.($Info->$Puissance/1000).' kW',0,1,'L',false);
    
    $pdf->SetXY(20, 122);
    
    $pdf->Cell(0,6,'Performances : Classe energetique : '.$Info->$CE.',',0,1,'L',false);
    
    $pdf->SetXY(20, 126);
    
    $pdf->Cell(0,6,'Efficacite saisonniere : '.$Info->$NS.' %, Scop : '.$Info->$Scop.'',0,1,'L',false);
    
    $pdf->SetXY(20, 130);
    
    $pdf->Cell(0,6,'Puissance acoustique : '.$Info->Pacous.' db(A), Pression acoustique a 1m : '.$Info->Pacous1m.' db(A).',0,1,'L',false);
    
    $pdf->SetXY(20, 134);
    
    $pdf->Cell(0,6,'Plages de fonctionnement : Chauffage : '.$Info->LimiteFc.'.C',0,1,'L',false);
    
    $pdf->SetXY(20, 138);
    
    if($Info->Elec=="Mono"){$Telec = "1P220-240/50Hz";}
    
    if($Info->Elec=="Tri"){$Telec = "3P380-400/50Hz";}
    
    $pdf->Cell(0,6,'Alimentation : '.$Telec.', resistance electrique : '.($Info->appoint/1000).' kW',0,1,'L',false);
    
    $pdf->SetXY(20, 142);
    
    $pdf->Cell(0,6,'Protection electrique : '.$Info->protecUE.'A.',0,1,'L',false);
    
    $pdf->SetXY(20, 146);
    
    $pdf->Cell(0,6,'Refrigerant : R'.$Info->GAZ.', Charge : '.$Info->ChargeI.' kg.',0,1,'L',false);
    
    
    
    if($Info->TypePac=="Split"){
    
    $int = $dbco->prepare("SELECT * FROM gest_produits_pac_ae P 
    
                                    JOIN gest_join_pac_ae J ON P.ID_Produit=J.ID_produit
    
                                    WHERE J.ID_ens=".$Info->ID_Ens." AND P.Emp='UI'");
    
    $int->execute();
    
    $INT=$int->fetch(PDO::FETCH_OBJ); 
    
    
    
    $pdf->SetFont('Helvetica','','10');
    
    $pdf->SetXY(20, 152);
    
    $pdf->Cell(0,6,''.$INT->modele.'',0,1,'L',false);
    
    $pdf->SetFont('Helvetica','','8');
    
    $pdf->SetXY(20, 156);
    
    $pdf->Cell(0,6,'Caracteristiques : ',0,1,'L',false);
    
    if($Info->sectionalim=="3G2.5mm2"||$Info->sectionalim=="3G6.0mm2"||$Info->sectionalim=="3G10.0mm2"){$Telec = "1P220-240/50Hz";}
    
    if($Info->sectionalim=="5G1.5mm2"||$Info->sectionalim=="5G2.5mm2"||$Info->sectionalim=="5G4.0mm2"||$Info->sectionalim=="5G6.0mm2"){$Telec = "3P380-400/50Hz";}
    
    $pdf->SetXY(20, 160);
    
    $pdf->Cell(0,6,'Alimentation : '.$Telec.'',0,1,'L',false);
    
    $pdf->SetXY(20, 164);
    
    $pdf->Cell(0,6,'Protection electrique : '.$INT->protecUI.'A.',0,1,'L',false);
    
    if($Info->EcsInt=="Oui"){
    
    $pdf->SetXY(20, 168);
    
    $pdf->Cell(0,6,'Performances : Classe energetique : '.$INT->CEEcs.',',0,1,'L',false);
    
    $pdf->SetXY(20, 172);
    
    $pdf->Cell(0,6,'Efficacite saisonniere : '.$INT->NSEcs.' %, Scop : '.$INT->ScopEcs.'',0,1,'L',false);
    
    $pdf->SetXY(20, 176);
    
    $pdf->Cell(0,6,'Volume ECS : '.$INT->Volumeau.' Litres.',0,1,'L',false);
    
    }
    
    
    
    
    

}
    
    
    
    
    
    
    
    
    
    
    
    
    
    //Image Pac
    
    $pdf->Image('../../Outils/produits/PAC_AE/'.$Info->Fabricant.'/'.$Info->Ref_img.'.png',27,212,60);
    
    
    
    //Enregistrement
    
    //$pdf->Output('F', '../../../FICHIERS/'.$ID.'/Simulation/Simulation'.$ID.'.pdf'); 
    
    $pdf->Output("I", 'test');
    
    ?>