Check();
// TODO a specific level of security for the "bilan" ???
// Change must be done here
if ( $User->admin == 0 ) {
if ($User->CheckAction($cn,IMP)
==0
)
{
/* Cannot Access */
NoAccess();
}
}
// A rtf file is generated
header('Content-type: application/rtf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="bilan.rtf"');
// Variable
// Start periode
$start=( isset ($_POST['from_periode']))?$_POST['from_periode']:-1;
$end=( isset ($_POST['to_periode']))?$_POST['to_periode']:-1;
// Variable if ok ?
if ( $start*$end < 0 ) {
echo_error("Missing Variable start = $start end=$end");
exit (-1);
}
// Open forms
$bnb_form=fopen('document/fr_be/bnb.form','r');
if ( $bnb_form == false) {
echo 'Cannot Open';
exit();
}
$col=array();
// read forms line per line
while (! feof ($bnb_form)) {
$buffer=trim(fgets($bnb_form));
// $a=(CheckFormula($buffer) == true)?"$buffer ok
":''.'Pas ok '.$buffer."
";
// echo $a;
// blank line are skipped
if (strlen(trim($buffer))==0)
continue;
// buffer contains a formula A$=....
// We need to eval it
//ereg("\\$[a-zA-Z]+[0-9]*=",$buffer,$e);
// echo $e[0];
//echo "
".$form;
$a=ParseFormula($cn,"$buffer",$buffer,$start,$end,false);
$b=str_replace("$","\$",$a);
// echo "Formule to eval".$b.'