diff --git a/resources/views/form/rapport-team3/1780482240-add652c4-0e79-4524-8ec1-fc3c8bb2b9e0.blade.php b/resources/views/form/rapport-team3/1780482240-add652c4-0e79-4524-8ec1-fc3c8bb2b9e0.blade.php index acec3302..05ff0e97 100644 --- a/resources/views/form/rapport-team3/1780482240-add652c4-0e79-4524-8ec1-fc3c8bb2b9e0.blade.php +++ b/resources/views/form/rapport-team3/1780482240-add652c4-0e79-4524-8ec1-fc3c8bb2b9e0.blade.php @@ -261,9 +261,35 @@ ); $('#execution-total_camp_rx').val(total) - }) + }) + + $('#field-upload_invoice_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') + .attr('accept', '.jpg,.jpeg,.png,.pdf'); - $('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () { + $('#field-bag_distribution_photo') + .attr('accept', '.jpg,.jpeg,.png'); + + const maxSize = 10 * 1024 * 1024; // 10 MB + + $('#field-upload_invoice_photo,#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') + .on('change', function () { + + const file = this.files[0]; + if (!file) return; + + if (file.size > maxSize) { + + Swal.fire({ + icon: 'error', + title: 'File Too Large', + text: 'Maximum file size allowed is 10 MB.' + }); + + $(this).val(''); + } + }); + + /* $('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () { let file = this.files[0]; if (file) { @@ -284,7 +310,7 @@ return; } } - }); + }); */ $('#field-phone_no_of_staff') .closest('.col-md-12') diff --git a/resources/views/form/rapport-team3/1780486861-23784b46-4c61-41e1-87a8-fc54f8bbdd4e.blade.php b/resources/views/form/rapport-team3/1780486861-23784b46-4c61-41e1-87a8-fc54f8bbdd4e.blade.php index 5bbca866..14be7985 100644 --- a/resources/views/form/rapport-team3/1780486861-23784b46-4c61-41e1-87a8-fc54f8bbdd4e.blade.php +++ b/resources/views/form/rapport-team3/1780486861-23784b46-4c61-41e1-87a8-fc54f8bbdd4e.blade.php @@ -261,9 +261,38 @@ ); $('#execution-total_camp_rx').val(total) - }) + }) + - $('#field-upload_invoice_photo,#field-bag_distribution_photo ').on('change', function () { + $('#field-upload_invoice_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') + .attr('accept', '.jpg,.jpeg,.png,.pdf'); + + + $('#field-bag_distribution_photo') + .attr('accept', '.jpg,.jpeg,.png,.pdf'); + + const maxSize = 10 * 1024 * 1024; // 10 MB + + $('#field-upload_invoice_photo,#field-bag_distribution_photo,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') + .on('change', function () { + + const file = this.files[0]; + if (!file) return; + + if (file.size > maxSize) { + + Swal.fire({ + icon: 'error', + title: 'File Too Large', + text: 'Maximum file size allowed is 10 MB.' + }); + + $(this).val(''); + } + }); + + + /*$('#field-upload_invoice_photo,#field-bag_distribution_photo,').on('change', function () { let file = this.files[0]; if (file) { @@ -284,7 +313,7 @@ return; } } - }); + });*/ $(document).ready(function () { $('#field-contact_id').trigger('change'); diff --git a/resources/views/form/rapport-team3/1780548606-6544d930-7144-4b75-b769-560752809662.blade.php b/resources/views/form/rapport-team3/1780548606-6544d930-7144-4b75-b769-560752809662.blade.php index 8e44de3f..9f455616 100644 --- a/resources/views/form/rapport-team3/1780548606-6544d930-7144-4b75-b769-560752809662.blade.php +++ b/resources/views/form/rapport-team3/1780548606-6544d930-7144-4b75-b769-560752809662.blade.php @@ -300,7 +300,7 @@ $(this).val(''); } }); - $('#field-upload_invoice_photo_max_10_mb') + $('#field-upload_invoice_photo_max_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') .attr('accept', '.jpg,.jpeg,.png,.pdf'); /* @@ -309,11 +309,11 @@ accept: 'image/*', }); */ $('#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb') - .attr('accept', '.jpg,.jpeg,.png,.pdf'); + .attr('accept', '.jpg,.jpeg,.png'); const maxSize = 10 * 1024 * 1024; // 10 MB - $('#field-upload_invoice_photo_max_10_mb, #field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb') + $('#field-upload_invoice_photo_max_10_mb,#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3') .on('change', function () { const file = this.files[0]; diff --git a/resources/views/form/rapport-team3/1782966054-92912886-1991-4160-8224-9eb025c237fe.blade.php b/resources/views/form/rapport-team3/1782966054-92912886-1991-4160-8224-9eb025c237fe.blade.php index 8e2920ae..5bd0815b 100644 --- a/resources/views/form/rapport-team3/1782966054-92912886-1991-4160-8224-9eb025c237fe.blade.php +++ b/resources/views/form/rapport-team3/1782966054-92912886-1991-4160-8224-9eb025c237fe.blade.php @@ -250,7 +250,7 @@ }); - $('#field-upload_invoice_photo_max_10_mb').on('change', function () { + $('#field-upload_invoice_photo_max_10_mb,#field-upload_invoice_photo_2,#field-upload_invoice_photo_3').on('change', function () { const file = this.files[0]; if (!file) return; @@ -305,6 +305,8 @@ }); + + /* $('#field-input_name,#field-input_given_count').on('change',function(){ $('#report-form input.dynamic-hidden').remove(); $('#report-form').append('')