This commit is contained in:
Masroor Ehsan 2025-01-08 21:10:56 +06:00
parent 58fa758826
commit 56c6012112
3 changed files with 27 additions and 2 deletions

View File

@ -267,7 +267,7 @@ private function renderCustomColumns(): array
private function generateReportingButtons(Study $study): string
{
return 'x';
return $this->renderButton($study->hash, 'fa-circle-info', 'show-reports btn-outline', 'Rep');
}
private function renderButton(string $data_id, string $fa_icon, string $data_class, string $text, string $url = '#', bool $blank = false): string

View File

@ -65,6 +65,15 @@
});
});
$('body').on('click', '.show-reports', function () {
var study_id = $(this).data('id');
$.get("{{ route('staff.report.popup') }}", {hashid: study_id}, function (data) {
$('#report-details').html(data);
$('#report-modal').modal('show');
});
});
});
</script>
@ -120,4 +129,19 @@
</div>
</div>
<div class="modal fade" id="report-modal" tabindex="-1" aria-labelledby="label-report" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="label-report">Reports</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="report-details"></div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -84,8 +84,9 @@
});
Route::group(['prefix' => 'report', 'as' => 'report.'], function () {
Route::get('popup', [ReportController::class, 'popup'])->name('popup');
Route::get('view/{uuid}', [ReportController::class, 'view'])->name('view');
Route::get('download/{uuid}', [ReportController::class, 'view'])->name('download');
Route::get('download/{uuid}', [ReportController::class, 'download'])->name('download');
});
});