$array = $Form->get_row($_GET['from_periode'], $_GET['to_periode'], $_GET['type_periode']); } else { $array = $Form->get_row($_GET['from_date'], $_GET['to_date'], $_GET['type_periode']); } if (count($Form->row) == 0) { exit; } echo "\"Description\";" . "\"Montant\"\n"; foreach ($Form->row as $op) { echo '"' . $op['desc'] . '"' . ";" . nb($op['montant']) . "\n"; } } elseif ($step == 1) { // Gather all the data //--- for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) { $periode = getPeriodeName($cn, $e); if ($periode == null) { continue; } $array[] = $Form->get_row($e, $e, $_GET['type_periode']); $periode_name[] = $periode; } // Display column heading //-- $x = ""; printf("Mois;"); foreach ($array[0] as $e) { printf("%s%s", $x, $e['desc']); $x = ";"; } printf("\n");
for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) { $periode = getPeriodeName($cn, $e); if ($periode == null) { continue; } $array[] = $Form->get_row($e, $e, 'periode'); $periode_name[] = $periode; } } $pdf->SetFont('DejaVuCond', '', 8); // without step if ($step == 0) { if ($_GET['type_periode'] == 0) { $q = getPeriodeName($cn, $from_periode); if ($from_periode != $to_periode) { $periode = sprintf("Période %s à %s", $q, getPeriodeName($cn, $to_periode)); } else { $periode = sprintf("Période %s", $q); } } else { $periode = sprintf("Date %s jusque %s", $_GET['from_date'], $_GET['to_date']); } $pdf->Cell(0, 7, $periode, 'B'); $pdf->Ln(); for ($i = 0; $i < count($array); $i++) { $pdf->Cell(160, 6, $array[$i]['desc']); $pdf->Cell(30, 6, sprintf('% 12.2f', $array[$i]['montant']), 0, 0, 'R'); $pdf->Ln(); } } else { // With Step
//-- for ($e = $_GET['from_periode']; $e <= $_GET['to_periode']; $e += $_GET['p_step']) { $periode = getPeriodeName($cn, $e); if ($periode == null) { continue; } $array[] = $Form->get_row($e, $e, $_GET['type_periode']); $periode_name[] = $periode; } } $rep = ""; $hid = new IHidden(); echo '<div class="content">'; if ($_GET['type_periode'] == 0) { $t = $_GET['from_periode'] == $_GET['to_periode'] ? "" : " -> " . getPeriodeName($cn, $_GET['to_periode'], 'p_end'); echo '<h2 class="info">' . $Form->id . " " . $Form->name . " - " . getPeriodeName($cn, $_GET['from_periode'], 'p_start') . " " . $t . '</h2>'; } else { echo '<h2 class="info">' . $Form->id . " " . $Form->name . ' Date :' . $_GET['from_date'] . " au " . $_GET['to_date'] . '</h2>'; } echo '<table >'; echo '<TR>'; echo '<TD><form method="GET" ACTION="?">' . dossier::hidden() . HtmlInput::submit('bt_other', "Autre Rapport") . $hid->input("type", "rapport") . $hid->input("ac", $_GET['ac']) . "</form></TD>"; echo '<TD><form method="GET" ACTION="export.php">' . HtmlInput::submit('bt_pdf', "Export PDF") . HtmlInput::hidden('act', 'PDF:report') . dossier::hidden() . $hid->input("type", "rapport") . $hid->input("ac", $_GET['ac']) . $hid->input("form_id", $Form->id); if (isset($_GET['from_periode'])) { echo $hid->input("from_periode", $_GET['from_periode']); } if (isset($_GET['to_periode'])) { echo $hid->input("to_periode", $_GET['to_periode']); } if (isset($_GET['p_step'])) { echo $hid->input("p_step", $_GET['p_step']);