From 47dde3c499743a4027812cc46ddd68a73b39f148 Mon Sep 17 00:00:00 2001 From: Farhan Pathan Date: Wed, 2 Sep 2026 17:55:43 +0530 Subject: [PATCH] Team3 : Doctor Activities for Neb 2 changes 1 --- ...e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php | 101 +++++++++++++++--- 1 file changed, 84 insertions(+), 17 deletions(-) diff --git a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php index 53c07b80..dd543459 100644 --- a/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php +++ b/resources/views/form/rapport-team3/1655458541-00d0e7c9-c60e-410e-ada7-8e0fef8e6ac1.blade.php @@ -61,10 +61,10 @@ {{-- Team Name --}} Type of meeting Execution Date - Name of speaker + {{-- Name of speaker --}} MSL Code Speciality - No. og Doctors/Paramedics attended + No. of Doctors/Paramedics attended @@ -86,7 +86,7 @@ {{-- {{ $sub->formdata->team_name }} --}} {{ $sub->formdata->type_of_meeting }} {{ $sub->formdata->record_date }} - {{ $sub->formdata->name_of_the_speaker }} + {{-- {{$sub->formdata->name_of_the_speaker }} --}} {{ $sub->formdata->msl_code }} {{ $sub->formdata->speciality }} {{ $sub->formdata->attendence }} @@ -116,7 +116,7 @@ @endif @foreach ($questions as $question) - @if (in_array($question->code, ['record_date', 'name_of_the_speaker', 'msl_code', 'attendence','speciality','honorarium_amount','other_expenses','total_eas','no_of_patients_on_duolin','no_of_units_duolin_respules'])) + @if (in_array($question->code, ['record_date', 'name_of_the_speaker', 'msl_code', 'attendence','speciality','honorarium_amount','other_expenses','total_eas','no_of_patients_on_duolin','no_of_units_duolin_respules','other_msl_code','other_speciality'])) @continue @endif
@@ -234,15 +234,27 @@ @break @case('dropdown') - + @break @case('checkbox') @@ -368,10 +380,31 @@ $('.edit-btn').click(function() { let selected = JSON.parse($(this).attr('plan_details')) - for (let k of Object.keys(selected)) { + /*for (let k of Object.keys(selected)) { if (selected[k] != '') $('#execution-' + k).val(selected[k]); - } + }*/ + for (let k of Object.keys(selected)) { + if (selected[k] != '') { + if (k == 'name_of_the_speaker') { + console.log('cc',selected[k]); + $('#execution-name_of_the_speaker').val($("#execution-name_of_the_speaker option:contains(" + + selected[k] + ")").attr('value')); + } else { + $('#execution-' + k).val(selected[k]); + } + } + } + + let docid = $('#execution-name_of_the_speaker option').map(function() { + if ($(this).text().trim() == selected['name_of_the_speaker']) return this; + }).attr('value') + + $('#execution-name_of_the_speaker').val(docid) + $('#execution-id').val(selected['id']) + + + $('#execution-id').val(selected['id']) $('#form-wrapper').hide() $('#execution-form-wrapper').show() @@ -395,6 +428,10 @@ } }) + $('#execution-other_msl_code,#execution-other_speciality').parent().hide(); + $('#execution-other_msl_code,#execution-other_speciality').attr('required',false); + + let type_of_meet=$('#execution-type_of_meeting').val(); console.log("Type of Meet without change",type_of_meet); @@ -410,7 +447,33 @@ $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); } + + $('#execution-name_of_the_speaker').change(function() { + $('#execution-msl_code').val($('option:selected', this).attr('msl_code')) + }) + + $('#execution-name_of_the_speaker').change(function() { + $('#execution-speciality').val($('option:selected', this).attr('speciality')) + }) }) + $('#execution-msl_code,#execution-speciality').attr('readonly',true); + + $('#execution-name_of_the_speaker').change(function() { + let value=$(this).val(); + if(value==='other'){ + $('#execution-other_msl_code,#execution-other_speciality').parent().show(); + $('#execution-other_msl_code,#execution-other_speciality').attr('required',true); + + $('#execution-msl_code,#execution-speciality').parent().hide(); + $('#execution-msl_code,#execution-speciality').attr('required',false); + } + else{ + $('#execution-other_msl_code,#execution-other_speciality').parent().hide(); + $('#execution-other_msl_code,#execution-other_speciality').attr('required',false); + $('#execution-msl_code,#execution-speciality').parent().show(); + $('#execution-msl_code,#execution-speciality').attr('required',true); + } + }) jQuery(document).ready(function($) { $('#field-user_id').change(function(){ @@ -431,11 +494,11 @@ $('#field-contact_id').append($("").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality)); } - $('#field-contact_id').change(function() { + $('#field-name_of_the_speaker').change(function() { $('#field-msl_code').val($('option:selected', this).attr('msl_code')) }) - $('#field-contact_id').change(function() { + $('#field-name_of_the_speaker').change(function() { $('#field-speciality').val($('option:selected', this).attr('speciality')) }) }, @@ -443,6 +506,10 @@ console.log(hierarchy) }) + + + + $('#report-form').on('submit', function(event) { event.preventDefault(); $("#pageloader").fadeIn();