diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index 649eca19..5d4e8c6d 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -1138,12 +1138,14 @@ class FormController extends Controller 'fb_live_dr', 'ecme_dr', 'rtm_dr', + 'absi_camp', ]; foreach ($contactAttributes as $attr) { if (isset($post[$attr]) && $post[$attr] !== '') { $contactdata[$attr] = $post[$attr]; } } + if (count($contactdata) > 4) { LambdaRequest::postrequest('contact', 'contact/update', $contactdata, $token[0]->access_token); } diff --git a/resources/views/form/rapport-copd/1789539434-fd05787a-184d-4089-872b-8ff009e95320.blade.php b/resources/views/form/rapport-copd/1789539434-fd05787a-184d-4089-872b-8ff009e95320.blade.php index 8dcd04b7..4aac62da 100644 --- a/resources/views/form/rapport-copd/1789539434-fd05787a-184d-4089-872b-8ff009e95320.blade.php +++ b/resources/views/form/rapport-copd/1789539434-fd05787a-184d-4089-872b-8ff009e95320.blade.php @@ -248,9 +248,19 @@ this.value = this.value.replace(/[^0-9]/g, ''); }); + + + $('#report-form').on('submit', function(event){ event.preventDefault(); $("#pageloader").fadeIn(); + + var brandSku = $('#field-select_duolin_sku').val(); + + var slug = brandSku.toLowerCase().trim().replace(/[^a-z0-9]+/g, '_').replace(/^-+|-+$/g, ''); + + $('#report-form').append(''); + $.ajax({ type: "POST", url: '/form/ajaxsubmit', @@ -264,7 +274,10 @@ title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }) + + }).then(() => { + location.reload(); // 🔥 page refresh here + }); $('#report-form').trigger("reset"); } else { Swal.fire({ diff --git a/resources/views/form/rapport-iva/1778666430-5f5eac47-e017-4fb1-b00a-429dbb2ce6ce.blade.php b/resources/views/form/rapport-iva/1778666430-5f5eac47-e017-4fb1-b00a-429dbb2ce6ce.blade.php index 79075761..382b3f1c 100644 --- a/resources/views/form/rapport-iva/1778666430-5f5eac47-e017-4fb1-b00a-429dbb2ce6ce.blade.php +++ b/resources/views/form/rapport-iva/1778666430-5f5eac47-e017-4fb1-b00a-429dbb2ce6ce.blade.php @@ -334,7 +334,9 @@ title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }) + }).then(() => { + location.reload(); // 🔥 page refresh here + }); $('#report-form').trigger("reset"); } else { Swal.fire({ diff --git a/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php b/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php index 647a62ff..af53609d 100644 --- a/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php +++ b/resources/views/form/rapport-iva/1778666440-156131bf-03ef-4a05-aecc-5be58c7b0354.blade.php @@ -331,7 +331,9 @@ title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }) + }).then(() => { + location.reload(); // 🔥 page refresh here + }); $('#report-form').trigger("reset"); } else { Swal.fire({ diff --git a/resources/views/form/rapport-iva/1781611760-316ed831-b02a-49f1-8724-e60f9d966fb5.blade.php b/resources/views/form/rapport-iva/1781611760-316ed831-b02a-49f1-8724-e60f9d966fb5.blade.php index 93d034d8..2f9ac123 100644 --- a/resources/views/form/rapport-iva/1781611760-316ed831-b02a-49f1-8724-e60f9d966fb5.blade.php +++ b/resources/views/form/rapport-iva/1781611760-316ed831-b02a-49f1-8724-e60f9d966fb5.blade.php @@ -358,7 +358,11 @@ title: 'Great!', text: 'Your data is successfully submitted!', icon: 'success' - }) + }).then(() => { + location.reload(); // 🔥 page refresh here + }); + + $('#report-form').trigger("reset"); } else { Swal.fire({ diff --git a/resources/views/form/rapport-lifemankind/1789635594-dc2b7e4f-8617-410f-acb9-408d13f7e0b0.blade.php b/resources/views/form/rapport-lifemankind/1789635594-dc2b7e4f-8617-410f-acb9-408d13f7e0b0.blade.php index 04ae867c..3de2261c 100644 --- a/resources/views/form/rapport-lifemankind/1789635594-dc2b7e4f-8617-410f-acb9-408d13f7e0b0.blade.php +++ b/resources/views/form/rapport-lifemankind/1789635594-dc2b7e4f-8617-410f-acb9-408d13f7e0b0.blade.php @@ -48,6 +48,11 @@ $employeeCodes = []; foreach ($submissions as $submission) { + + if (isset($id) && !empty($id) && isset($submission->id) && $submission->id == $id) { + continue; + } + if (isset($submission->formdata->employee_code)) { $employeeCodes[] = $submission->formdata->employee_code; } @@ -329,7 +334,7 @@ $('#field-employee_code').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); // Maximum 8 digits @@ -342,7 +347,7 @@ $('#field-position_code').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); // Maximum 8 digits @@ -354,7 +359,7 @@ $('#field-emp_code_of_previous_employee').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); // Maximum 8 digits @@ -366,7 +371,7 @@ $('#field-l1_manager_code_emp_code').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); // Maximum 8 digits @@ -378,10 +383,10 @@ $('#field-l2_manager_emp_code').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); - // Maximum 8 digits + value = value.substring(0, 8); $(this).val(value); @@ -392,7 +397,7 @@ $('#field-email_id').on('input', function () { let email = $(this).val().trim(); - // @mankindpharma.com सोडून दुसरा domain असल्यास validation + if (email !== '' && !/@mankindpharma\.com$/i.test(email)) { this.setCustomValidity('Email must end with @mankindpharma.com'); } else { @@ -403,10 +408,10 @@ $('#field-mobile_number').on('input', function () { let value = $(this).val(); - // फक्त numbers + value = value.replace(/\D/g, ''); - // Maximum 10 digits + value = value.substring(0, 10); $(this).val(value); @@ -447,7 +452,7 @@ } // Exactly 8 digits आणि first digit 1-4 - if (!/^[1-4][0-9]{7}$/.test(emp_code_of_previous_employee)) { + if (emp_code_of_previous_employee !== '' && !/^[1-4][0-9]{7}$/.test(emp_code_of_previous_employee)) { event.preventDefault(); alert('Previous Employee Code must be exactly 8 digits and must start with 1, 2, 3, or 4.'); diff --git a/resources/views/form/rapport-lifemankind/1789720913-7a40c0f0-2aef-4fd4-9c6c-355f8cb40322.blade.php b/resources/views/form/rapport-lifemankind/1789720913-7a40c0f0-2aef-4fd4-9c6c-355f8cb40322.blade.php new file mode 100644 index 00000000..8604ca77 --- /dev/null +++ b/resources/views/form/rapport-lifemankind/1789720913-7a40c0f0-2aef-4fd4-9c6c-355f8cb40322.blade.php @@ -0,0 +1,389 @@ + + + + @include('layouts.shared/title-meta', ['title' => "Form"]) + @include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? '']) + + + +
+ processing... +
+ +
+
+
+
+
+
+ + @if(Session::has('error'))
{{Session::get('error')}}
+
@endif + @if(session('success'))
{{ session('success') }} +
+
@endif +
+

{{$form->title}}

+
+ @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) +
+ @if($form->link_type == 'form') + View History + @else + Back + @endif +
+ @endif + @if(isset($form->user_info)) +
+
Submitted By: {{$form->user_info->name}}
+
+ @endif + + +
+ + + + @csrf + @if($id) + + @endif + @if(isset($form->manager_can_submit) && $form->manager_can_submit == true) +
+ + + +
+ @endif + + + @foreach($questions as $question) +
+ + @switch($question->type) + @case('hidden') + + @break + @case('text') + @case('email') + @case('tel') + @case('date') + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}"> + @break + @case('number') + required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}"> + @break + @case('textarea') + + @break + @case('dropdown') + + @break + @case('checkbox') + @foreach($question->options as $option) +
+ value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}> + +
+ @endforeach + @break + @case('file') + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) + required == 'yes'?'required':'' }}> + @elseif(isset($question->value)) + + @endif + + @break + @case('multitextbox') +
+ @foreach($question->options as $option) +
{{$option->display}}
+
+ +
+ @endforeach +
+ @break + + @case('time') + required == 'yes' ? 'required' : ''}} + value="{{isset($question->value) ? $question->value : ''}}"> + @break + + @endswitch +
+ @endforeach + @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) +
+ +
+ @endif +
+ +
+
+ + + + +
+
+ +
+ +
+ + +@include('layouts.shared/footer-script') + + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-zenova/1788239728-6f7f3c27-c5dc-4e6e-a042-aefd5681af3a.blade.php b/resources/views/form/rapport-zenova/1788239728-6f7f3c27-c5dc-4e6e-a042-aefd5681af3a.blade.php index e5a06fce..9e4a0b6f 100644 --- a/resources/views/form/rapport-zenova/1788239728-6f7f3c27-c5dc-4e6e-a042-aefd5681af3a.blade.php +++ b/resources/views/form/rapport-zenova/1788239728-6f7f3c27-c5dc-4e6e-a042-aefd5681af3a.blade.php @@ -98,7 +98,8 @@ adboard_dr="{{ (isset($option->contact->adboard_dr) ? $option->contact->adboard_dr : '') }}" fb_live_dr="{{ (isset($option->contact->fb_live_dr) ? $option->contact->fb_live_dr : '') }}" ecme_dr="{{ (isset($option->contact->ecme_dr) ? $option->contact->ecme_dr : '') }}" - rtm_dr="{{ (isset($option->contact->rtm_dr) ? $option->contact->rtm_dr : '') }}" + rtm_dr="{{ (isset($option->contact->rtm_dr) ? $option->contact->rtm_dr : '') }}" + absi_camp="{{ (isset($option->contact->absi_camp) ? $option->contact->absi_camp : '') }}" @endif @@ -217,7 +218,7 @@ $('#field-contact_id').html('') $('#field-contact_id').append($("").attr("value",'').text('-- Select --')); for (let itm of data) { - $('#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').append($("").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality).attr("absi_camp", itm.contact.absi_camp || '')); } $('#field-contact_id').change(function() { @@ -274,6 +275,12 @@ $('#field-rtm_dr').val($('option:selected', this).attr('rtm_dr')) }) + $('#field-contact_id').change(function() { + $('#field-absi_camp').val( + $('option:selected', this).attr('absi_camp') || '' + ); + }); + $('#field-msl_code,#field-speciality').attr('readonly',true); @@ -283,7 +290,7 @@ '#field-pen_rx_count','#field-vial_rx_count','#field-pen_pob_units', '#field-vial_pob_units','#field-sankalp_lead_received_penvial', '#field-pmos_dr','#field-qbs_dr','#field-adboard_dr', - '#field-fb_live_dr','#field-ecme_dr','#field-rtm_dr', + '#field-fb_live_dr','#field-ecme_dr','#field-rtm_dr','#field-absi_camp', '#field-sankalp_lead_enrolled_penvial','#field-upload_glipiq_rxn' ].join(','); @@ -320,6 +327,12 @@ else if(value==='Existing Prescriber'){ $('#report-form input[name="glipiq_existing_conversion"]').val(1); + } + else{ + $('#report-form input[name="glipiq_new_conversion"]').val(0); + $('#report-form input[name="glipiq_existing_conversion"]').val(0); + + } }); @@ -329,13 +342,51 @@ $('#report-form').append(''); $('#report-form').append(''); + + $('#field-sankalp_lead_received_penvial').val("") + + $('#field-sankalp_lead_enrolled_penvial').val("") + + + $('#field-pmos_dr').val("") + + $('#field-qbs_dr').val("") + + $('#field-adboard_dr').val("") + + $('#field-fb_live_dr').val("") + + $('#field-ecme_dr').val("") + + $('#field-rtm_dr').val("") + + $('#field-absi_camp').val(""); + $('#report-form input[name="glipiq_new_conversion"]').val(0); + $('#report-form input[name="glipiq_existing_conversion"]').val(0); + + + + $('#field-conversion_status').on('change',function(){ let value=$(this).val(); if(value==='New Conversion'){ $('#report-form input[name="sitazit_new_conversion"]').val(1); + $('#report-form input[name="glipiq_new_conversion"]').val(0); + $('#report-form input[name="glipiq_existing_conversion"]').val(0); } else if(value==='Existing Prescriber'){ $('#report-form input[name="sitazit_existing_conversion"]').val(1); + $('#report-form input[name="glipiq_new_conversion"]').val(0); + $('#report-form input[name="glipiq_existing_conversion"]').val(0); + + } + else{ + $('#report-form input[name="sitazit_new_conversion"]').val(0); + $('#report-form input[name="sitazit_existing_conversion"]').val(0); + + $('#report-form input[name="glipiq_new_conversion"]').val(0); + $('#report-form input[name="glipiq_existing_conversion"]').val(0); + } }); @@ -541,6 +592,11 @@ return; } + // Doctor contact attribute is the source of truth + if (fieldCode === 'absi_camp') { + return; + } + // Don't populate file inputs if (field.attr('type') === 'file') { return;