diff --git a/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php b/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php index c801644c..e20687a1 100644 --- a/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php +++ b/resources/views/form/rapport-titans/1790753526-37d85bd1-442d-4226-bacf-5f12e647373d.blade.php @@ -171,11 +171,9 @@ @csrf - - - - - + + + @if ($id) @endif @@ -298,17 +296,9 @@ - - - - - - - + + + {{-- --}} @foreach ($questions as $question) @@ -445,66 +435,30 @@ $('#execution-no_of_patients_screened').closest('.col-md-12').hide(); $('#execution-no_of_patients_screened').prop('required', false); - // ===================================================== - // DRIVE COUNT FUNCTIONS - // ===================================================== - - // Plan Filling - function setPlanDriveCount() { - - const activity = ($('#field-activity').val() || '').trim().toUpperCase(); - - $('#drive-count-plans-lhc').val('0'); - $('#drive-count-execution-lhc').val('0'); - $('#drive-count-plans-novel').val('0'); - $('#drive-count-execution-novel').val('0'); - - if (activity === 'LHC') { - - $('#drive-count-plans-lhc').val('1'); - - } else if (activity === 'NOVEL') { - - $('#drive-count-plans-novel').val('1'); - } - } - - - // Execution - function setExecutionDriveCount() { - - const activity = ($('#execution-activity').val() || '').trim().toUpperCase(); - - $('#execution-drive-count-plans-lhc').val('0'); - $('#execution-drive-count-execution-lhc').val('0'); - $('#execution-drive-count-plans-novel').val('0'); - $('#execution-drive-count-execution-novel').val('0'); - - if (activity === 'LHC') { - - $('#execution-drive-count-execution-lhc').val('1'); - - } else if (activity === 'NOVEL') { - - $('#execution-drive-count-execution-novel').val('1'); - } - } + // Activity change - Plan - $('#field-activity').on('change.driveCount', function() { - setPlanDriveCount(); + $('#field-activity').on('change', function() { + let activity=$(this).val(); + console.log("Activity selected in Plan:",activity); + + if (activity === 'Oscar Screening Camps') { + $('#count-plans-lhc').val('1'); + } + else if (activity === 'Novel') { + $('#count-plans-novel').val('1'); + } + else{ + + $('#count-plans-lhc').val('0'); + $('#count-plans-novel').val('0'); + } }); // Activity change - Execution - $('#execution-activity').on('change.driveCount', function() { - setExecutionDriveCount(); - }); - - - // Initialize Plan count - setPlanDriveCount(); + $('#add-camp-btn').click(function() { @@ -585,12 +539,12 @@ $('#execution-id').val(selected['id']) // Set execution drive count - setExecutionDriveCount(); + // Show Patients Screened only for LHC during Execution const selectedActivity = ($('#execution-activity').val() || '').trim().toUpperCase(); - if (selectedActivity === 'LHC') { + if (selectedActivity === 'Oscar Screening Camps') { $('#execution-no_of_patients_screened') .closest('.col-md-12') .show(); @@ -611,7 +565,7 @@ const activity = ($(this).val() || '').trim().toUpperCase(); - if (activity === 'LHC') { + if (activity === 'Oscar Screening Camps') { $('#execution-no_of_patients_screened') .closest('.col-md-12') @@ -665,6 +619,21 @@ }) + let activityName=$('#execution-activity').val(); + console.log("Activity selected in Execution:",activityName); + if(activityName==='Oscar Screening Camps'){ + $('#execution-count-execution-lhc').val('1'); + $('#execution-count-execution-novel').val('0'); + } + else if(activityName==='Novel'){ + $('#execution-count-execution-lhc').val('0'); + $('#execution-count-execution-novel').val('1'); + } + else{ + $('#execution-count-execution-lhc').val('0'); + $('#execution-count-execution-novel').val('0'); + } + }) @@ -717,9 +686,7 @@ - $('#execution-activity').on('change.driveCount', function() { - setExecutionDriveCount(); - }); + let docid = $('#execution-contact_id option').map(function() { @@ -779,31 +746,13 @@ - /* $('#execution-plan_date').on('change', function () { - const monthNames = [ - "Oct-26", "Nov-26", "Dec-26" - ]; - const selectedDateVal = $(this).val(); // e.g. "2026-10-15" - - if (selectedDateVal) { - // 'YYYY-MM-DD' split karun month extract karane (timezone issue yet nahi) - const parts = selectedDateVal.split('-'); - const monthNumber = parts[1]; // "10", "11", किंवा "12" - const targetMonth = monthNames[monthNumber] || ''; - - // Dropdown madhe toh month select karne - $('#execution-month_of_engagement').val(monthNames).trigger('change'); - } else { - // Jar user ne date clear keli tar dropdown reset karne - $('#execution-month_of_engagement').val('').trigger('change'); - } - }); */ + $('#execution-plan_date').on('change', function () { const monthNames = [ - "Oct-26", // Index 0 (10 व्या महिन्यासाठी) - "Nov-26", // Index 1 (11 व्या महिन्यासाठी) - "Dec-26" // Index 2 (12 व्या महिन्यासाठी) + "Oct-26", // Index 0 + "Nov-26", // Index 1 + "Dec-26" // Index 2 ]; const selectedDateVal = $(this).val(); // e.g. "2026-10-15" @@ -812,7 +761,7 @@ const parts = selectedDateVal.split('-'); const monthNumber = parseInt(parts[1], 10); // 10, 11, किंवा 12 - // 10 वजा करून 0, 1, 2 इंडेक्स मिळवणे + const targetMonth = monthNames[monthNumber - 10] || ''; // Dropdown madhe targetMonth select karne @@ -827,29 +776,7 @@ $('#report-form').on('submit', function(event) { - // Get the currently selected activity - const activity = ($('#field-activity').val() || '').trim().toUpperCase(); - - // Reset all Plan/Execution counters - $('#count-plans-lhc').val('0'); - $('#count-execution-lhc').val('0'); - $('#count-plans-novel').val('0'); - $('#count-execution-novel').val('0'); - - // Set Plan counter based on selected Activity - if (activity === 'LHC') { - - $('#count-plans-lhc').val('1'); - - } else if (activity === 'NOVEL') { - - $('#count-plans-novel').val('1'); - } - - // Debug - check before submitting - console.log('Plan Activity:', activity); - console.log('Count of Plans_LHC:', $('#count-plans-lhc').val()); - console.log('Count of Plans_Novel:', $('#count-plans-novel').val()); + event.preventDefault(); @@ -921,9 +848,9 @@ $(document).ready(function () { const monthNames = [ - "Oct-26", // index 0 (10 व्या महिन्यासाठी) - "Nov-26", // index 1 (11 व्या महिन्यासाठी) - "Dec-26" // index 2 (12 व्या महिन्यासाठी) + "Oct-26", // index 0 + "Nov-26", // index 1 + "Dec-26" // index 2 ]; $('#field-plan_date').on('change', function () { @@ -966,33 +893,20 @@ /* * Reset all counters first */ - $('#execution-count-plans-lhc').val('0'); - $('#execution-count-execution-lhc').val('0'); - $('#execution-count-plans-novel').val('0'); - $('#execution-count-execution-novel').val('0'); + /* * Only set Execution counters when * this is actual Execution, NOT Edit Plan. */ - if (executionMode === 'yes') { - - if (activity === 'LHC') { - - $('#execution-count-execution-lhc').val('1'); - - } else if (activity === 'NOVEL') { - - $('#execution-count-execution-novel').val('1'); - } - } + /* * Patients Screened validation */ - if (activity === 'LHC') { + if (activity === 'Oscar Screening Camps') { const patientsScreened = $('#execution-no_of_patients_screened').val(); @@ -1017,26 +931,7 @@ } - /* - * Debug before submission - */ - console.log('Execution Mode:', executionMode); - console.log('Execution Activity:', activity); - - console.log( - 'Count of Execution_LHC:', - $('#execution-count-execution-lhc').val() - ); - - console.log( - 'Count of Execution_Novel:', - $('#execution-count-execution-novel').val() - ); - - - /* - * Submit - */ + event.preventDefault(); $("#pageloader").fadeIn();