Compare commits

...

2 Commits

Author SHA1 Message Date
Farhan Pathan 1e33ce82bf Titans - Ciphaler Form changes and Molecule Identification form (first change for Unique Doctor)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m57s Details
2026-06-18 13:10:41 +05:30
Farhan Pathan aa81e6e90f Titans - Ciphaler Form changes 2026-06-18 13:10:41 +05:30
2 changed files with 69 additions and 6 deletions

View File

@ -339,7 +339,12 @@
<div class="col-md-12 mt-3">
<div class="card">
<div class="card-header">
<h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5>
{{-- <h5 class="mb-0">{{ ucwords($categoryLabel) }}</h5> --}}
<h5 class="mb-0">
{{ $categoryLabel == 'nac + acebrophylline'
? 'NAC + Acebrophylline'
: ucwords($categoryLabel) }}
</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
@ -539,7 +544,7 @@ select option:disabled {
});
}
function updateDoctorDropdowns($tbody) {
/* function updateDoctorDropdowns($tbody) {
let selectedDoctors = [];
$tbody.find('.doctor-select').each(function() {
@ -574,7 +579,47 @@ select option:disabled {
});
});
}
*/
function updateDoctorDropdowns() {
let selectedDoctors = [];
$('.doctor-select').each(function() {
let value = $(this).val();
if (value) {
selectedDoctors.push(value);
}
});
$('.doctor-select').each(function() {
let currentDropdown = $(this);
let currentValue = currentDropdown.val();
currentDropdown.find('option').each(function() {
let option = $(this);
let originalText = option.data('original-text') || option.text();
option.data('original-text', originalText);
option.text(originalText);
option.prop('disabled', false);
let optionValue = option.val();
if (
optionValue &&
optionValue !== currentValue &&
selectedDoctors.includes(optionValue)
) {
option.prop('disabled', true);
option.text(originalText + ' (Already Added)');
}
});
});
}
function updateOtherMoleculeDropdowns($tbody) {
let sectionMolecule = $tbody.data('molecule-use');
@ -663,8 +708,11 @@ select option:disabled {
return fd;
}
$(document).on('change', '.doctor-select', function() {
/*$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns($(this).closest('.doctor-table-body'));
});*/
$(document).on('change', '.doctor-select', function() {
updateDoctorDropdowns();
});
$('.doctor-select').select2({
@ -675,12 +723,18 @@ select option:disabled {
prefillAllDoctorTables();
$('.doctor-table-body').each(function() {
/* $('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
updateDoctorDropdowns($tbody);
}); */
$('.doctor-table-body').each(function() {
let $tbody = $(this);
updateOtherMoleculeDropdowns($tbody);
});
updateDoctorDropdowns();
$('#report-form').on('submit', function(event) {
event.preventDefault();

View File

@ -90,7 +90,10 @@
</option>
@endif
@endforeach
<option value="others">Others</option>
<option value="others"
{{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>
Others
</option>
@else
@foreach ($question->options as $option)
<option value="{{ $option->value }}" pcode="{{isset($option->contact->pcode)?$option->contact->pcode:''}}" msl_code="{{isset($option->contact->msl_code)?$option->contact->msl_code:''}}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
@ -181,6 +184,12 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
if($('#field-contact_id').val() === 'others'){
$('#field-name_of_other_hcp,#field-p_code_of_other_hcp')
.parent().show();
$('#field-msl_code').parent().hide();
}
var today = new Date().toISOString().split('T')[0];
$('#field-record_date').attr('max', today);