Commit 289df0e3 authored by Administrator's avatar Administrator

Update 2 files via Son of Anton

parent 56a76739
......@@ -23,7 +23,7 @@ class ReportController extends Controller
return $this->view('Reports.Views.index', ['grouped' => $grouped]);
}
public function view(Request $request, string $code): Response
public function viewReport(Request $request, string $code): Response
{
$definition = ReportDefinition::findByCode($code);
if (!$definition) return $this->redirect('/reports')->withError('التقرير غير موجود');
......@@ -65,7 +65,7 @@ class ReportController extends Controller
$response = new Response();
header('Content-Type: text/csv; charset=UTF-8');
header('Content-Disposition: attachment; filename="' . $code . '_' . date('Y-m-d') . '.csv"');
echo "\xEF\xBB\xBF"; // UTF-8 BOM
echo "\xEF\xBB\xBF";
echo $csv;
exit;
}
......
......@@ -2,8 +2,8 @@
declare(strict_types=1);
return [
['GET', '/reports', 'Reports\Controllers\ReportController@index', ['auth'], 'report.view_membership'],
['GET', '/reports/view/{code}','Reports\Controllers\ReportController@view', ['auth'], 'report.view_membership'],
['GET', '/reports/export/{code}','Reports\Controllers\ReportController@export', ['auth'], 'report.export'],
['GET', '/reports/print/{code}','Reports\Controllers\ReportController@printReport', ['auth'], 'report.view_membership'],
['GET', '/reports', 'Reports\Controllers\ReportController@index', ['auth'], 'report.view_membership'],
['GET', '/reports/view/{code}', 'Reports\Controllers\ReportController@viewReport', ['auth'], 'report.view_membership'],
['GET', '/reports/export/{code}','Reports\Controllers\ReportController@export', ['auth'], 'report.export'],
['GET', '/reports/print/{code}', 'Reports\Controllers\ReportController@printReport', ['auth'], 'report.view_membership'],
];
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment