From b2cc08c95768622b27ed0d9e8014fb87cf54bca7 Mon Sep 17 00:00:00 2001 From: Ravi Gulhane Date: Mon, 12 Oct 2026 16:53:08 +0530 Subject: [PATCH] Changes --- ...58a6-d509-4ac0-9b18-6d366a74965e.blade.php | 29 ++++++++++++------- .../partials/doctor-chemist-chemist.blade.php | 2 +- .../partials/doctor-chemist-doctor.blade.php | 5 ++-- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php b/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php index dacf6508..a9d8ed1e 100644 --- a/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php +++ b/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php @@ -109,17 +109,10 @@ $(function () { var doctorFormId = '1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e'; var chemistFormId = '1790230856-704c97b6-61f7-4eda-901a-2cb4ff6f293d'; - var dateInput = document.getElementById('field-record_date'); - var today = new Date(); - var month = String(today.getMonth() + 1).padStart(2, '0'); - var day = String(today.getDate()).padStart(2, '0'); - dateInput.min = '2026-09-01'; - dateInput.max = today.getFullYear() + '-' + month + '-' + day; var surveyContacts = []; var submittedIdentities = []; var contactsReady = false; - // Dev only: open every section. Set to false to lock later sections until the previous step is complete. - var unlockAllSections = true; + var unlockAllSections = false; var savedAnswers = @json($savedAnswers); var photoFields = ['visiting_card', 'rx_pad', 'doctor_board', 'chemist_board']; @@ -499,6 +492,7 @@ $(function () { } showSavedPhoto(field, savedAnswers[code]); }); + syncStatusFields(root); } function selectSavedOption(select, label) { @@ -549,8 +543,17 @@ $(function () { }); } + function syncStatusFields(root) { + $(root || '#report-form').find('select.status-source').each(function () { + $(this).siblings('input.status-value').val(this.value === 'Yes' ? '1' : '0'); + }); + } + $('#field-doctor_name').on('input', lockDoctorPrefix); - $('#doctor-fields').on('change', '.product-choice', syncProductUnits); + $('#doctor-fields').on('change', '.product-choice', function () { + syncProductUnits(); + syncStatusFields(this.parentNode); + }); $('#chemist-fields').on('input', '.stockist-other-name', function () { $(this).closest('.stockist-block').find('.stockist-name').val(this.value); }); @@ -561,6 +564,9 @@ $(function () { $('#chemist-fields').on('change', '.service-choice', syncServiceFields); $('#field-degree, #field-specialty').on('change', syncOtherFields); + $('#report-form').on('change', 'select.status-source', function () { + syncStatusFields(this.parentNode); + }); function fail(text) { Swal.fire({ icon: 'error', title: 'Please check the form', text: text }); @@ -663,8 +669,8 @@ $(function () { event.preventDefault(); var type = $('#field-visit_type').val(); var recordDate = $('#field-record_date').val(); - if (!recordDate || recordDate < dateInput.min || recordDate > dateInput.max) { - fail('Date must be from 1 Sep 2026 through today.'); + if (!recordDate) { + fail('Date is required.'); return; } if (type === 'doctor') { @@ -817,6 +823,7 @@ $(function () { return !this.files || !this.files.length; }); emptyFiles.prop('disabled', true); + syncStatusFields(activeRoot()); $('#pageloader').css('display', 'flex').hide().fadeIn(); $.ajax({ type: 'POST', diff --git a/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php b/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php index ef5f970c..97be56ac 100644 --- a/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php +++ b/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php @@ -24,7 +24,7 @@ $services = ['BP Monitoring' => 'chemist_bp_monitoring','Weighing Machine' => 'c
-
+
diff --git a/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php b/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php index 8b8bfa14..d0d396ef 100644 --- a/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php +++ b/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php @@ -22,7 +22,7 @@ $products = ['Asthalin Inhaler' => 'asthalin_inhaler','Asthalin Rotacap' => 'ast
-
+
@@ -40,7 +40,8 @@ $products = ['Asthalin Inhaler' => 'asthalin_inhaler','Asthalin Rotacap' => 'ast @foreach($products as $label => $code)
- + +