00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024 header('Content-type: application/csv');
00025 header('Content-Disposition: attachment;filename="balance.csv"',FALSE);
00026 include_once ("ac_common.php");
00027 include_once("class_balance.php");
00028 include_once ("postgres.php");
00029
00030 include("class_jrn.php");
00031 $cn=DbConnect($_SESSION['g_dossier']);
00032
00033
00034 include ('class_user.php');
00035 $User=new cl_user(DbConnect());
00036 $User->Check();
00037 if ( $User->CheckAction($cn,BALANCE) == 0)
00038 {
00039 NoAccess();
00040 exit;
00041 }
00042 $bal=new Balance($cn);
00043
00044 $t_cent="";
00045
00046 if ( isset($_POST['central']) ) {
00047 $bal->central='Y';
00048 $t_cent="centralisée";
00049 }
00050 else
00051 $bal->central='N';
00052
00053 $row=$bal->GetRow($_POST['from_periode'],
00054 $_POST['to_periode']);
00055 foreach ($row as $r) {
00056
00057 echo $r['poste'].';'.
00058 $r['label'].';'.
00059 $r['sum_deb'].';'.
00060 $r['sum_cred'].';'.
00061 $r['solde_deb'].';'.
00062 $r['solde_cred'];
00063 printf("\n");
00064 }
00065
00066
00067 ?>