extranet/www/exportxml.php

38 lines
1.1 KiB
PHP
Raw Normal View History

2009-03-06 17:12:26 +00:00
<?php
//Start...
$page = $_REQUEST['page'];
2009-03-06 17:12:26 +00:00
$siret = $_REQUEST['siret'];
$siren = substr($siret,0,9);
//Construire le titre du fichier PDF en fonction des paramètres fournis
$path = realpath(dirname(__FILE__).'/../cache/pages/');
if (($siret*1)==0 || ($siren*1)<100){
$fileName = $path.'/'.$page.'-'.$_REQUEST['idEntreprise'];
2009-03-06 17:12:26 +00:00
}else{
$fileName = $path.'/'.$page.'-'.$siret;
2009-03-06 17:12:26 +00:00
}
//Gestion des cas particulier
if ($page == 'dirigeants' && $_REQUEST['vue'] == 'histo'){
$fileName .= '-histo';
} else if ($page == 'annonces') {
if (isset($_REQUEST['vue']) && $$_REQUEST['vue'] != '') {
$fileName .= '-'.$_REQUEST['idan'];
}
} else if ($page == 'competences' && isset($_GET['type'])) {
$fileName .= '-'.$_GET['type'];
2009-03-06 17:12:26 +00:00
}
//Ajout de l'extension
$fileName.='.xml';
//Envoi du fichier au navigateur
2009-03-06 17:32:33 +00:00
if (file_exists($fileName)){
$xmlNameFile = substr($fileName, strrpos($fileName, "/")+1);
2009-03-06 17:12:26 +00:00
// Write the content type to the client...
header("Content-type: application/xml");
2009-03-06 17:32:33 +00:00
header("Content-Disposition: attachement; filename=\"$xmlNameFile\"");
2009-03-06 17:12:26 +00:00
flush();
print file_get_contents($fileName);
}
2009-03-06 17:12:26 +00:00
?>