1 |
<? |
<? |
2 |
|
/* |
3 |
|
* This file is part of PhpCompta. |
4 |
|
* |
5 |
|
* PhpCompta is free software; you can redistribute it and/or modify |
6 |
|
* it under the terms of the GNU General Public License as published by |
7 |
|
* the Free Software Foundation; either version 2 of the License, or |
8 |
|
* (at your option) any later version. |
9 |
|
* |
10 |
|
* PhpCompta is distributed in the hope that it will be useful, |
11 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
* GNU General Public License for more details. |
14 |
|
* |
15 |
|
* You should have received a copy of the GNU General Public License |
16 |
|
* along with PhpCompta; if not, write to the Free Software |
17 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 |
|
*/ |
19 |
|
/* $Revision$ */ |
20 |
|
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr |
21 |
|
|
22 |
include_once("ac_common.php"); |
include_once("ac_common.php"); |
23 |
include_once("impress_inc.php"); |
include_once("impress_inc.php"); |
24 |
|
include_once("postgres.php"); |
25 |
|
|
26 |
|
|
27 |
|
include ('class_user.php'); |
28 |
|
/* Admin. Dossier */ |
29 |
|
$cn=DbConnect($_SESSION['g_dossier']); |
30 |
|
|
31 |
|
$User=new cl_user($cn); |
32 |
|
$User->Check(); |
33 |
|
|
34 |
|
// TODO a specific level of security for the "bilan" ??? |
35 |
|
// Change must be done here |
36 |
|
if ( $User->admin == 0 ) { |
37 |
|
if (CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],IMP) == 0 ){ |
38 |
|
/* Cannot Access */ |
39 |
|
NoAccess(); |
40 |
|
} |
41 |
|
} |
42 |
|
|
43 |
|
// A rtf file is generated |
44 |
header('Content-type: application/rtf'); |
header('Content-type: application/rtf'); |
45 |
|
|
46 |
// It will be called downloaded.pdf |
// It will be called downloaded.pdf |
47 |
header('Content-Disposition: attachment; filename="bilan.rtf"'); |
header('Content-Disposition: attachment; filename="bilan.rtf"'); |
48 |
|
|
|
include_once("postgres.php"); |
|
49 |
|
|
50 |
// Open a connection |
// Variable |
51 |
$cn=DbConnect(4); |
// Start periode |
52 |
|
$start=( isset ($_POST['from_periode']))?$_POST['from_periode']:-1; |
53 |
|
$end=( isset ($_POST['to_periode']))?$_POST['to_periode']:-1; |
54 |
|
|
55 |
|
// Variable if ok ? |
56 |
|
if ( $start*$end < 0 ) { |
57 |
|
echo_error("Missing Variable start = $start end=$end"); |
58 |
|
exit (-1); |
59 |
|
} |
60 |
// Open forms |
// Open forms |
61 |
$bnb_form=fopen('document/fr_be/bnb.form','r'); |
$bnb_form=fopen('document/fr_be/bnb.form','r'); |
62 |
if ( $bnb_form == false) { |
if ( $bnb_form == false) { |
63 |
echo 'Cannot Open'; |
echo 'Cannot Open'; |
64 |
exit(); |
exit(); |
65 |
} |
} |
|
$start=40; |
|
|
$end=52; |
|
66 |
$col=array(); |
$col=array(); |
67 |
|
|
68 |
// read forms line per line |
// read forms line per line |