2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
|
|
|
|
require_once 'classes/model/OutputDocument.php';
|
|
|
|
|
$uid = $_SERVER['QUERY_STRING'];
|
|
|
|
|
$oOutputDocument = new OutputDocument();
|
|
|
|
|
$aFields = $oOutputDocument->load($uid);
|
|
|
|
|
$type = $aFields['OUT_DOC_TYPE'];
|
|
|
|
|
|
|
|
|
|
if ( $type == 'JRXML') $extension = 'jrxml';
|
|
|
|
|
if ( $type == 'ACROFORM') $extension = 'pdf';
|
|
|
|
|
|
|
|
|
|
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension ;
|
|
|
|
|
|
|
|
|
|
$bDownload = true;
|
2012-02-28 16:15:54 -04:00
|
|
|
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
|
|
|
|
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
|
|
|
|
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
2010-12-02 23:34:41 +00:00
|
|
|
G::streamFile ( $fileJrxml, $bDownload, $downFileName );
|