extranet/www/exportxml.php

35 lines
1011 B
PHP
Raw Normal View History

2009-03-06 17:12:26 +00:00
<?php
//Start...
$page = $_REQUEST['page'];
2009-03-11 07:51:18 +00:00
$idEntreprise = $_REQUEST['idEntreprise'];
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<61>tres fournis
$path = realpath(dirname(__FILE__).'/../cache/');
if (($siret*1)==0 || ($siren*1)<100){
2009-03-09 08:41:39 +00:00
$fileName = $path.'/'.$page.'-'.$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';
}elseif($page=='annonces'){
2009-05-28 17:10:09 +00:00
if(isset($_REQUEST['vue']) && $$_REQUEST['vue']!=''){$fileName.= '-'.$_REQUEST['idan'];}
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();
2009-03-09 08:27:25 +00:00
print file_get_contents($fileName);
2009-03-06 17:12:26 +00:00
}
?>