Files
code-cegled/_include/include_export_balance.php
2020-07-12 13:47:12 +02:00

22 lines
400 B
PHP

<?php
$trainingAssocArray = $sql->assoc_array("
SELECT uk_name, uk_balance
FROM user_kid
WHERE uk_deleted = 0 AND uk_is_active = 1
ORDER BY uk_name ASC;
");
$file_name = date("Y-m") . ".csv";
$path = 'balance-report/';
touch($path.$file_name);
$file = fopen($path.$file_name, "w");
foreach ($trainingAssocArray as $key => $row) {
fputcsv($file, $row, ';');
}
fclose($file);