Add missing
This commit is contained in:
parent
150d8ca268
commit
8bd4bd94c6
2 changed files with 78 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ BODY {
|
|||
<script src="scripts.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<BODY onLoad="SetFocus(\'login\',0)">
|
||||
Version developpement 1.2.2 patch 5
|
||||
Version BETA 2.0
|
||||
<div class="remark">
|
||||
<p class="gras">Il est conseillé de ne PAS utiliser Internet Explorer.
|
||||
</p><p>
|
||||
|
|
|
|||
77
html/show_pj.php
Normal file
77
html/show_pj.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?
|
||||
/*
|
||||
* This file is part of PhpCompta.
|
||||
*
|
||||
* PhpCompta is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* PhpCompta is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with PhpCompta; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
/* $Revision$ */
|
||||
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
||||
// Verify parameters
|
||||
include_once ("ac_common.php");
|
||||
if ( !isset ($_GET['jrn'] ) ||
|
||||
!isset($_GET['jr_grpt_id'])) {
|
||||
echo_error("Missing parameters");
|
||||
}
|
||||
|
||||
include_once ("postgres.php");
|
||||
|
||||
|
||||
$jr_grpt_id=$_GET['jr_grpt_id'];
|
||||
|
||||
$cn=DbConnect($_SESSION['g_dossier']);
|
||||
|
||||
|
||||
include ('class_user.php');
|
||||
$User=new cl_user(DbConnect());
|
||||
$User->Check();
|
||||
// retrieve the jrn
|
||||
$r=ExecSql($cn,"select jr_def_id from jrn where jr_grpt_id=$jr_grpt_id");
|
||||
if ( pg_num_rows($r) == 0 ) {
|
||||
echo_error("Invalid operation id jr_grpt_id=$jr_grpt_id");
|
||||
exit;
|
||||
}
|
||||
$a=pg_fetch_array($r,0);
|
||||
$jrn=$a['jr_def_id'];
|
||||
|
||||
if ($User->AccessJrn($cn,$jrn) == false ){
|
||||
/* Cannot Access */
|
||||
NoAccess();
|
||||
exit -1;
|
||||
}
|
||||
|
||||
StartSql($cn);
|
||||
$ret=ExecSql($cn,"select jr_pj,jr_pj_name,jr_pj_type from jrn where jr_grpt_id=$jr_grpt_id");
|
||||
if ( pg_num_rows ($ret) == 0 )
|
||||
return;
|
||||
$row=pg_fetch_array($ret,0);
|
||||
$tmp=tempnam('/tmp/','document_');
|
||||
pg_lo_export($cn,$row['jr_pj'],$tmp);
|
||||
ini_set('zlib.output_compression','Off');
|
||||
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: '.$row['jr_pj_type']);
|
||||
header('Content-Disposition: attachment;filename="'.$row['jr_pj_name'].'"',FALSE);
|
||||
header("Accept-Ranges: bytes");
|
||||
$file=fopen($tmp,'r');
|
||||
while ( !feof ($file) )
|
||||
echo fread($file,8192);
|
||||
|
||||
fclose($file);
|
||||
|
||||
unlink ($tmp);
|
||||
|
||||
Commit($cn);
|
||||
Loading…
Add table
Add a link
Reference in a new issue