diff --git a/resources/views/reports/violations.blade.php b/resources/views/reports/violations.blade.php index 029060f..34d29ef 100644 --- a/resources/views/reports/violations.blade.php +++ b/resources/views/reports/violations.blade.php @@ -31,12 +31,12 @@
- -
@@ -331,6 +331,22 @@ this.dateTo = to; this.$nextTick(() => document.getElementById('filter-form').submit()); }, + queryString() { + const p = new URLSearchParams(); + if (this.dateFrom) p.set('date_from', this.dateFrom); + if (this.dateTo) p.set('date_to', this.dateTo); + if (this.classId) p.set('class_id', this.classId); + if (this.jenisId) p.set('violation_type_id', this.jenisId); + return p.toString(); + }, + cetakPdf() { + const qs = this.queryString(); + window.open('{{ route('reports.violations.pdf') }}' + (qs ? '?' + qs : ''), '_blank'); + }, + exportExcel() { + const qs = this.queryString(); + window.location.href = '{{ route('violations.export') }}' + (qs ? '?' + qs : ''); + }, resetFilter() { this.dateFrom = ''; this.dateTo = '';