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 5d6cfb48..08a17280 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 @@ -75,7 +75,7 @@ {{-- Team Name --}} Type of meeting Execution Date - {{-- Name of speaker --}} + Name of speaker MSL Code Speciality No. of Doctors/Paramedics attended @@ -106,7 +106,7 @@ - + @@ -114,6 +114,8 @@ + + @else @@ -134,7 +136,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 }} @@ -642,6 +644,9 @@ }); } + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false); + $('#execution-type_of_meeting').on('change',function(){ let type_of_meet=$('#execution-type_of_meeting').val(); console.log("Type of Meet",type_of_meet); @@ -650,18 +655,29 @@ $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); - + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false); } + + else if(type_of_meet==='Other'){ + $('#execution-other_type_of_meeting').parent().show(); + $('#execution-other_type_of_meeting').attr('required',true); + + } + + else{ $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false); } }) $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide(); $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false); - + let type_of_meet=$('#execution-type_of_meeting').val(); console.log("Type of Meet without change",type_of_meet); @@ -670,8 +686,10 @@ $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); - + } + + else{ $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); @@ -681,6 +699,133 @@ }) + + $('.edit-plan-btn').click(function() { + let selected = JSON.parse($(this).attr('plan_details')) + let hierarchy = selected['hierarchy_id'] || ''; + if (!hierarchy && selected['user_id']) { + hierarchy = $('#field-user_id option[value="' + selected['user_id'] + '"]').attr('hierarchy') || ''; + } + + for (let k of Object.keys(selected)) { + if (selected[k] != '') { + if (k == 'name_of_the_speaker' || k == 'other_speaker_name') { + continue; + } else { + $('#execution-' + k).val(selected[k]); + } + } + } + + $('#execution-id').val(selected['id']) + if (selected['user_id'] && $('#execution-user_id').length) { + $('#execution-user_id').val(selected['user_id']) + } + if ($('#execution-hierarchy_id').length) { + $('#execution-hierarchy_id').val(hierarchy) + } + + + + $('#execution-id').val(selected['id']) + $('#form-wrapper').hide() + $('#execution-form-wrapper').show() + $('#table-wrapper').hide() + $('#execution-no_of_patients_on_duolin').attr('max',10); + + function setExecutionSpeakers(data) { + fillSpeakerDropdown($('#execution-name_of_the_speaker'), data, true); + if ($('#execution-other_speaker_name').length) { + fillOtherSpeakerDropdown($('#execution-other_speaker_name'), data); + } + applySpeakerValue($('#execution-name_of_the_speaker'), selected['name_of_the_speaker']); + applySpeakerValue($('#execution-other_speaker_name'), selected['other_speaker_name']); + } + + if (hierarchy) { + $("#pageloader").fadeIn(); + $.ajax({ + type: "GET", + url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy, + processData: false, + contentType: false, + success: function(data) { + $("#pageloader").fadeOut(); + setExecutionSpeakers(data); + }, + error: function() { + $("#pageloader").fadeOut(); + } + }); + } + + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false); + + + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('#execution-record_date,#execution-attendence,#execution-honorarium_amount,#execution-other_expenses,#execution-total_eas').parent().hide(); + $('#execution-record_date,#execution-attendence,#execution-honorarium_amount,#execution-other_expenses,#execution-total_eas').attr('required',false); + + + $('#execution-type_of_meeting').on('change',function(){ + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("Type of Meet",type_of_meet); + + if(type_of_meet==='GNP Camp'){ + /*$('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().show(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',true); + $('label[for="execution-name_of_the_speaker"]').html('Name of the Speaker (Pedia or GP only) '); + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false);*/ + } + + else if(type_of_meet==='Other'){ + $('#execution-other_type_of_meeting').parent().show(); + $('#execution-other_type_of_meeting').attr('required',true); + + } + + + else{ + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').parent().hide(); + $('#execution-no_of_patients_on_duolin,#execution-no_of_units_duolin_respules').attr('required',false); + $('label[for="execution-name_of_the_speaker"]').html('Name of the speaker'); + $('#execution-other_type_of_meeting').parent().hide(); + $('#execution-other_type_of_meeting').attr('required',false); + } + }) + + $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').parent().hide(); + $('#execution-other_msl_code,#execution-other_speciality,#execution-other_speaker_name').attr('required',false); + + + let type_of_meet=$('#execution-type_of_meeting').val(); + console.log("Type of Meet without change",type_of_meet); + + $('#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-other_speaker_name').change(function() { + $('#execution-other_msl_code').val($('option:selected', this).attr('msl_code')) + }) + + $('#execution-other_speaker_name').change(function() { + $('#execution-other_speciality').val($('option:selected', this).attr('speciality')) + }) + + + }) + + + + $('#execution-msl_code,#execution-speciality,#execution-other_msl_code,#execution-other_speciality').attr('readonly',true); $('#execution-name_of_the_speaker').change(function() {