| Current Path : /home/ataenra/www/ATA/INTRANET/GenPDF/1Simulation/ |
| Current File : /home/ataenra/www/ATA/INTRANET/GenPDF/1Simulation/genpdfresultat.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';
//TEST COMMANDE RECUP TOUTES LES INFOS EN VENANT D IMPORTATION
// Si on attaque le generateur directement
if(isset($_GET['ID'])){$ID=$_GET['ID'];}
//recuperer les informations du dossier dans la basse dossier
$dossier = $dbco->prepare("SELECT typeprojet, PrimeATA, IDprime FROM dossier WHERE ID = $ID");
$dossier->execute();
$D = $dossier->fetch(PDO::FETCH_OBJ);
$sth = $dbco->prepare("SELECT * FROM gest_routeur WHERE routeur_Famille = '".$D->typeprojet."'");
$sth->execute();
$I = $sth->fetch(PDO::FETCH_OBJ);
$table_gamme = $I->table_gamme;
$table_jointure = $I->table_jointure;
$table_jointure_access = $I->table_jointure_access;
$table_ensemble = $I->table_ensemble;
$table_produits = $I->table_produits;
$table_projet = $I->table_projet;
if($D->PrimeATA == "Oui"){
$INFO = $dbco->prepare("SELECT * FROM dossier D
JOIN client C ON D.IDclient=C.IDc
JOIN ".$table_projet." P ON D.IDprojet=P.IDp
JOIN ".$table_ensemble." E ON P.IDm=E.ID_Ens
JOIN ".$table_gamme." G ON E.ID_gamme=G.ID_gamme
JOIN ".$table_jointure." J ON P.IDm=J.ID_ens
JOIN ".$table_produits." Pr ON Pr.ID_Produit=J.ID_produit
JOIN simulationprime SM ON D.IDprime=SM.IDps
WHERE D.ID=$ID AND Pr.Emp='UE'");
$INFO->execute();
}elseif($D->PrimeATA== "Non"){
$INFO = $dbco->prepare("SELECT * FROM dossier D
JOIN client C ON D.IDclient=C.IDc
JOIN ".$table_projet." P ON D.IDprojet=P.IDp
JOIN ".$table_ensemble." E ON P.IDm=E.ID_Ens
JOIN ".$table_gamme." G ON E.ID_gamme=G.ID_gamme
JOIN ".$table_jointure." J ON P.IDm=J.ID_Ens
JOIN ".$table_produits." Pr ON Pr.ID_Produit=J.ID_produit
WHERE D.ID=$ID AND Pr.Emp='UE'");
$INFO->execute();
}
$Info=$INFO->fetch(PDO::FETCH_OBJ);
$DossierProjet ="../../../FICHIERS/$ID";
$chemin ="../../../FICHIERS/$ID/Simulation";
// Vérifie si le répertoire existe :
if (!is_dir($DossierProjet)) {
mkdir($DossierProjet, 0777,true);
}
// Création du nouveau répertoire
if(!is_dir($chemin)) {
mkdir($chemin, 0777,true);
}
// initiate FPDI
$pdf = new FPDI();
require "TypeProjet/Simul_".$Info->typeprojet.".php";
//$pdf->Output("I", 'test');
require "mailSimulation.php";
header("location:../../../../index.php/comgp");
?>