40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
require_once '../config/prepend.php';
|
|
if (isset($_REQUEST['idan']) && $_REQUEST['idan']*1<>0 &&
|
|
$_REQUEST['vue']=='balo' &&
|
|
isset($_GET['mode']) && $_GET['mode']=='pdf' )
|
|
{
|
|
$tmp=explode('.', $_REQUEST['idan']);
|
|
$rcs=substr($_REQUEST['siret'],0,9);
|
|
if (is_numeric($tmp[0])) $num=$tmp[0];
|
|
if (is_numeric($tmp[1])) $par=$tmp[1];
|
|
|
|
$wdb = new WDB('sdv1');
|
|
$tabTmp = $wdb->select('balo',
|
|
'Url_Annonce_Pdf, YEAR(Date_Parution) as Annee',
|
|
"Societe_Rcs='$rcs' AND Num_Affaire='$num' AND Num_Parution='$par'");
|
|
|
|
$ann = $tabTmp[0];
|
|
$file = PATH_DATA.'/jo/balo/'.$ann['Annee'].'/'.basename($ann['Url_Annonce_Pdf']);
|
|
if (file_exists($file)) {
|
|
header("Pragma: public");
|
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
|
header("Cache-Control: must-revalidate");
|
|
header("Content-type: application/pdf");
|
|
header("Content-Length: ".filesize($file));
|
|
header("Content-disposition: inline; filename=$file");
|
|
header("Accept-Ranges: ".filesize($file));
|
|
readfile($file);
|
|
} else
|
|
afficheErreur('Erreur 11000 : Document inexistant !');
|
|
die();
|
|
}
|
|
$title='Annonces légales - Siren '.
|
|
substr($_REQUEST['siret'],0,3).' '.
|
|
substr($_REQUEST['siret'],3,3).' '.
|
|
substr($_REQUEST['siret'],6,3);
|
|
//echo "<!--_page=annonces-->\n";
|
|
$page2 = 'annonces.php';
|
|
include('./pages/main.php');
|
|
?>
|