/var/www/vhosts/ihelp.ro/httpdocs/src/Controller/Admin
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Controller/Admin/CronsController.php (1800B)
=" => $dateFrom];
$conditions['AND'][] = ["Donations.created >=" => $dateUntil];
$data = $this->fetchTable('Donations')->find('all')->contain($contain)->toArray();
$results = [];
foreach ($data as $key => $value) {
$results[] = [
'id' => $value['id'],
'f_name' => $value['first_name'],
'l_name' => $value['last_name'],
'nickname' => $value['nickname'],
'email' => $value['email'],
'value' => $value['value'],
'transation' => isset($value['transation']) ? $value['transation']['bank_account_id'] : '',
'cause' => $value['cause']['name'],
'is_anonymus' => $value['is_anonymus'] ? 'true' : 'false',
'is_visible' => $value['is_visible'] ? 'true' : 'false',
'created' => !empty($value['created']) ? $value['created']->i18nFormat('yyyy-MM-dd HH:mm:ss') : '',
];
}
if (empty($results)) {
$results[] = [
__('No results found') => ''
];
}
$this->loadComponent('Spreadsheet');
$this->Spreadsheet->export($results, 'Report', 'Donors', 'AdminCron', 'save', ['dateFrom'=>$dateFrom,'dateUntil'=>$dateUntil]);
}
}