Do not write the rows in calendar cat. report if all columns are zero

This commit is contained in:
Hadi Nategh 2017-01-10 09:26:57 +01:00
parent 49ccc373ba
commit 20cddc8445

View File

@ -397,6 +397,14 @@ class calendar_category_report extends calendar_ui{
foreach ($raw_csv as &$row) foreach ($raw_csv as &$row)
{ {
$check_row = 0;
foreach ($row as $val)
{
$check_row += $val;
}
//check if all values of the row is zero then escape the row
if (!$check_row) continue;
// printout each row into file // printout each row into file
fputcsv($fp, array_values($row)); fputcsv($fp, array_values($row));
} }