Team 2 (Purview Doctor Tagging)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 51s Details

This commit is contained in:
zeeshan 2026-10-08 13:31:44 +05:30
parent 914a319b3f
commit 48344bf0b1
1 changed files with 4 additions and 67 deletions

View File

@ -94,7 +94,7 @@
$isContact = str_starts_with($question->code, 'contact_id');
@endphp
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<option value=""> -- Select -- </option>
@foreach ($question->options as $option)
@if($isContact && isset($option->contact->type) && $option->contact->type == 'doctor' )
@ -350,7 +350,7 @@
}
/* $("select[id^='field-contact_id']").each(function() {
$("select[id^='field-contact_id']").each(function() {
var select = $(this);
// Clear previous options
select.html('');
@ -411,74 +411,11 @@
// Enable search on doctor dropdowns
applySelect2ToDoctorDropdowns();
$("#pageloader").fadeOut();
}); */
// contacts लोड झाल्यानंतर:
contacts = contacts.filter(function(itm) { return itm.value !== 'sample'; });
$("select[id^='field-contact_id']").each(function() {
var select = $(this);
// जर आधी Select2 लागलेले असेल तर ते आधी नष्ट (destroy) करा
if (select.hasClass("select2-hidden-accessible")) {
select.select2('destroy');
}
// जुने ऑप्शन्स रिकामे करा
select.empty();
// डिफॉल्ट सिलेक्ट पर्याय जोडा
select.append($("<option></option>").attr("value", '').text('-- Select --'));
// डॉक्टरांची यादी जोडा
contacts.forEach(function(itm) {
var option = $("<option></option>")
.attr("value", itm.value)
.text(itm.display);
if (itm.contact && itm.contact.msl_code) {
option.attr("msl_code", itm.contact.msl_code);
}
if (itm.contact && itm.contact.speciality) {
option.attr("speciality", itm.contact.speciality);
}
select.append(option);
});
// आता Select2 लागू करा
select.select2({
width: "100%",
placeholder: "-- Select --",
allowClear: true
});
// Change event बांधा
select.off('change').on('change', function () {
var selected = $(this).find(':selected');
var selectId = $(this).attr('id');
var match = selectId.match(/^field-contact_id(_\d+)?$/);
var suffix = match && match[1] ? match[1] : '';
var mslCodeField = $('#field-msl_code' + suffix);
var specialityField = $('#field-speciality' + suffix);
if (mslCodeField.length) {
mslCodeField.val(selected.attr('msl_code') || '');
}
if (specialityField.length) {
specialityField.val(selected.attr('speciality') || '');
}
// डुप्लिकेट डॉक्टर निवडणे थांबवा
enforceUniqueDoctorSelections();
});
});
$("#pageloader").fadeOut();
});
@endif
@endif