Team 4 (Mother Forum) Speciality , msl code readonly
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m44s
Details
This commit is contained in:
parent
8ed9f607ae
commit
6d96a86e3f
|
|
@ -80,59 +80,32 @@
|
||||||
|
|
||||||
|
|
||||||
@case('dropdown')
|
@case('dropdown')
|
||||||
@php
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" data-initial-value="{{ isset($question->value) ? $question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
|
|
||||||
$submittedMonths = [];
|
|
||||||
if (isset($submissions) && is_array($submissions)) {
|
|
||||||
foreach ($submissions as $sub) {
|
|
||||||
|
|
||||||
if (isset($id) && $id && isset($sub->id) && $sub->id == $id) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$monthVal = $sub->month ?? ($sub->data->month ?? null);
|
|
||||||
if ($monthVal) {
|
|
||||||
$submittedMonths[] = trim($monthVal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<select class="form-control"
|
|
||||||
id="field-{{ $question->code }}"
|
|
||||||
name="{{ $question->code }}"
|
|
||||||
data-initial-value="{{ isset($question->value) ? $question->value : '' }}"
|
|
||||||
{{ $question->required == 'yes' ? 'required' : '' }}>
|
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
|
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
@php
|
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
||||||
$optVal = trim($option->value);
|
|
||||||
|
|
||||||
$isAlreadySubmitted = ($question->code == 'month' && in_array($optVal, $submittedMonths));
|
|
||||||
$isSelected = (isset($question->value) && trim($question->value) == $optVal);
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor')
|
|
||||||
<option value="{{ $option->value }}"
|
<option value="{{ $option->value }}"
|
||||||
@if($isSelected) selected @endif
|
@if(isset($question->value) && $question->value == $option->value) selected @endif
|
||||||
msl_code="{{ $option->contact->msl_code ?? '' }}"
|
@if($question->code == 'contact_id')
|
||||||
speciality="{{ $option->contact->speciality ?? '' }}">
|
msl_code="{{ (isset($option->contact->msl_code) ? $option->contact->msl_code : '') }}"
|
||||||
|
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
|
||||||
|
@endif
|
||||||
|
>
|
||||||
{{ $option->display }}
|
{{ $option->display }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
@elseif($question->code != 'contact_id')
|
||||||
<option value="{{ $option->value }}"
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'pcode= ' . (isset($option->contact->pcode)?$option->contact->pcode:'') . ' ' : '' }} {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
|
||||||
{{ $isSelected ? 'selected' : '' }}
|
{{ $option->display }}
|
||||||
{{ $isAlreadySubmitted ? 'disabled' : '' }}
|
|
||||||
{{ $question->code == 'contact_id' ? 'pcode=' . ($option->contact->pcode ?? '') : '' }}
|
|
||||||
{{ $question->code == 'contact_id' ? 'speciality=' . ($option->contact->speciality ?? '') : '' }}>
|
|
||||||
{{ $option->display }} {{ $isAlreadySubmitted ? ' (Already Submitted)' : '' }}
|
|
||||||
</option>
|
</option>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
@break
|
|
||||||
|
|
||||||
@break
|
@break
|
||||||
@case('checkbox')
|
@case('checkbox')
|
||||||
@foreach($question->options as $option)
|
@foreach($question->options as $option)
|
||||||
|
|
@ -348,6 +321,8 @@
|
||||||
applySelect2ToDoctorDropdowns();
|
applySelect2ToDoctorDropdowns();
|
||||||
|
|
||||||
|
|
||||||
|
$("[id^='field-msl_code'], [id^='field-speciality']").prop('readonly', true);
|
||||||
|
|
||||||
$("[id^='field-contact_id']").each(function() {
|
$("[id^='field-contact_id']").each(function() {
|
||||||
var select = $(this);
|
var select = $(this);
|
||||||
var existingVal = select.attr('data-initial-value');
|
var existingVal = select.attr('data-initial-value');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue