Team 4 (MONTAIR LC Kid 5 Dr Conversion)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 39s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 39s
Details
This commit is contained in:
parent
accf876be6
commit
2478a7006a
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
@endphp
|
||||
|
||||
@if(count($submissions)<20)
|
||||
{{-- @if(count($submissions)<20) --}}
|
||||
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||
@csrf
|
||||
|
|
@ -118,44 +118,44 @@
|
|||
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
||||
@break
|
||||
@case('dropdown')
|
||||
<select class="form-control"
|
||||
id="field-{{$question->code}}"
|
||||
name="{{$question->code}}"
|
||||
{{$question->required == 'yes'?'required':'' }}>
|
||||
<select class="form-control"
|
||||
id="field-{{$question->code}}"
|
||||
name="{{$question->code}}"
|
||||
{{$question->required == 'yes'?'required':'' }}>
|
||||
|
||||
<option value=""> -- Select -- </option>
|
||||
<option value=""> -- Select -- </option>
|
||||
|
||||
@foreach($question->options as $option)
|
||||
@foreach($question->options as $option)
|
||||
|
||||
{{-- 🔥 NEW: Check whether this doctor was already submitted --}}
|
||||
@php
|
||||
$alreadySubmitted = in_array(
|
||||
(string) $option->value,
|
||||
$historyDoctorIds
|
||||
);
|
||||
@endphp
|
||||
{{-- 🔥 NEW: Check whether this doctor was already submitted --}}
|
||||
@php
|
||||
$alreadySubmitted = in_array(
|
||||
(string) $option->value,
|
||||
$historyDoctorIds
|
||||
);
|
||||
@endphp
|
||||
|
||||
<option value="{{$option->value}}"
|
||||
msl_code="{{ isset($option->contact->legacy_code) ? $option->contact->legacy_code : '' }}"
|
||||
speciality="{{ isset($option->contact->speciality) ? $option->contact->speciality : '' }}"
|
||||
<option value="{{$option->value}}"
|
||||
msl_code="{{ isset($option->contact->legacy_code) ? $option->contact->legacy_code : '' }}"
|
||||
speciality="{{ isset($option->contact->speciality) ? $option->contact->speciality : '' }}"
|
||||
|
||||
{{-- 🔥 NEW --}}
|
||||
{{ $alreadySubmitted ? 'disabled' : '' }}
|
||||
{{-- 🔥 NEW --}}
|
||||
{{ $alreadySubmitted ? 'disabled' : '' }}
|
||||
|
||||
{{isset($question->value) && $question->value == $option->value ? 'selected':''}}>
|
||||
{{isset($question->value) && $question->value == $option->value ? 'selected':''}}>
|
||||
|
||||
{{$option->display}}
|
||||
{{$option->display}}
|
||||
|
||||
{{-- 🔥 NEW --}}
|
||||
@if($alreadySubmitted)
|
||||
(Already Submitted)
|
||||
@endif
|
||||
{{-- 🔥 NEW --}}
|
||||
@if($alreadySubmitted)
|
||||
(Already Submitted)
|
||||
@endif
|
||||
|
||||
</option>
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@case('radio')
|
||||
@foreach($question->options as $option)
|
||||
<div class="form-check mb-2 form-check-success">
|
||||
|
|
@ -250,9 +250,9 @@
|
|||
</div>
|
||||
@endif
|
||||
</form>
|
||||
@else
|
||||
{{-- @else
|
||||
<h4>You have submitted 20 Doctors</h4>
|
||||
@endif
|
||||
@endif --}}
|
||||
</div> <!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
|
@ -298,43 +298,43 @@
|
|||
// 🔥 NEW - Disable doctors that were already submitted
|
||||
// NEW - DEBUG duplicate doctor check
|
||||
// 🔥 NEW - Disable previously submitted doctors
|
||||
function preventDuplicateDoctors() {
|
||||
/* function preventDuplicateDoctors() {
|
||||
|
||||
$('#field-contact_id option').each(function () {
|
||||
$('#field-contact_id option').each(function () {
|
||||
|
||||
let option = $(this);
|
||||
let doctorId = String(option.val());
|
||||
let option = $(this);
|
||||
let doctorId = String(option.val());
|
||||
|
||||
if (!doctorId) {
|
||||
return;
|
||||
}
|
||||
if (!doctorId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove old label first
|
||||
let cleanText = option.text()
|
||||
.replace(' (Already Submitted)', '');
|
||||
// Remove old label first
|
||||
let cleanText = option.text()
|
||||
.replace(' (Already Submitted)', '');
|
||||
|
||||
console.log(
|
||||
"Doctor ID:",
|
||||
doctorId,
|
||||
"History IDs:",
|
||||
historyDoctorIds
|
||||
);
|
||||
console.log(
|
||||
"Doctor ID:",
|
||||
doctorId,
|
||||
"History IDs:",
|
||||
historyDoctorIds
|
||||
);
|
||||
|
||||
if (historyDoctorIds.includes(doctorId)) {
|
||||
if (historyDoctorIds.includes(doctorId)) {
|
||||
|
||||
// 🔥 Disable doctor
|
||||
option.prop('disabled', true);
|
||||
// 🔥 Disable doctor
|
||||
option.prop('disabled', true);
|
||||
|
||||
// 🔥 Show label
|
||||
option.text(cleanText + ' (Already Submitted)');
|
||||
// 🔥 Show label
|
||||
option.text(cleanText + ' (Already Submitted)');
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
option.prop('disabled', false);
|
||||
option.text(cleanText);
|
||||
}
|
||||
});
|
||||
}
|
||||
option.prop('disabled', false);
|
||||
option.text(cleanText);
|
||||
}
|
||||
});
|
||||
} */
|
||||
$('#field-user_id').change(function(){
|
||||
|
||||
let hierarchy = $('option:selected', this).attr('hierarchy');
|
||||
|
|
@ -373,7 +373,7 @@ function preventDuplicateDoctors() {
|
|||
}
|
||||
|
||||
// 🔥 NEW - Disable doctors already submitted by this user
|
||||
preventDuplicateDoctors();
|
||||
/* preventDuplicateDoctors(); */
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue