diff --git a/resources/views/form/rapport-team4/1741155802-25a7600f-1613-4a82-af1d-f460a8f79ffa.blade.php b/resources/views/form/rapport-team4/1741155802-25a7600f-1613-4a82-af1d-f460a8f79ffa.blade.php index 18a8b65b..8d9c0b6d 100644 --- a/resources/views/form/rapport-team4/1741155802-25a7600f-1613-4a82-af1d-f460a8f79ffa.blade.php +++ b/resources/views/form/rapport-team4/1741155802-25a7600f-1613-4a82-af1d-f460a8f79ffa.blade.php @@ -83,7 +83,7 @@ Rxn of Furamist Rxn of Furamist AZ Total Rxns - + Upload Acrylic Poster Image @@ -188,8 +188,9 @@ {{isset($sub->formdata->rxn_of_furamist_az) ? $sub->formdata->rxn_of_furamist_az: ''}} - {{isset($sub->formdata->total_rxns) ? $sub->formdata->total_rxns: ''}} - + {{isset($sub->formdata->total_rxns) ? $sub->formdata->total_rxns: ''}} + {{isset($sub->formdata->file_upload) ? $sub->formdata->file_upload: ''}} + @endforeach @@ -207,7 +208,7 @@ @endif @foreach ($questions as $question) - @if (in_array($question->code, ['execution_date','executed_as_per_plan' ,'revised_start_time','patient_screened','patients_diagnosed','rxn_of_montair_lc_adult','rxn_of_montair_lc_kid_tab','rxn_of_montair_lc_kid_syrup','rxn_of_furamist','rxn_of_furamist_az','total_rxns'])) + @if (in_array($question->code, ['execution_date','executed_as_per_plan' ,'revised_start_time','patient_screened','patients_diagnosed','rxn_of_montair_lc_adult','rxn_of_montair_lc_kid_tab','rxn_of_montair_lc_kid_syrup','rxn_of_furamist','rxn_of_furamist_az','total_rxns','file_upload'])) @continue @endif
@@ -672,6 +673,32 @@ } $('#execution-form').append(''); + + $('#execution-file_upload').on('change', function () { + let file = this.files[0]; + + if (file) { + let allowedTypes = ['image/png', 'image/jpg', 'image/jpeg']; + let maxSize = 10 * 1024 * 1024; // 10 MB + + // Type validation + if (!allowedTypes.includes(file.type)) { + alert('Only PNG, JPG, and JPEG files are allowed.'); + $(this).val(''); + return; + } + + // Size validation + if (file.size > maxSize) { + alert('File size should not exceed 10 MB.'); + $(this).val(''); + return; + } + } + }); + + + })