Compare commits
2 Commits
1d081195aa
...
5f84b45375
| Author | SHA1 | Date |
|---|---|---|
|
|
5f84b45375 | |
|
|
642c081c58 |
|
|
@ -148,15 +148,11 @@
|
||||||
<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)
|
||||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
|
||||||
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'msl_code= ' . $option->contact->legacy_code . ' ' : '' }} {{ $question->code == 'contact_id' ? 'pcode= ' . $option->contact->msl_code . ' ' : '' }} {{ $question->code == 'doctor_name' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'msl_code= ' . $option->contact->legacy_code . ' ' : '' }} {{ $question->code == 'contact_id' ? 'pcode= ' . $option->contact->msl_code . ' ' : '' }} {{ $question->code == 'doctor_name' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
|
||||||
{{ $option->display }}
|
{{ $option->display }}
|
||||||
</option>
|
</option>
|
||||||
@elseif($question->code != 'contact_id')
|
|
||||||
<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 :'') . ' ' : '' }} >
|
|
||||||
{{ $option->display }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
@break
|
@break
|
||||||
|
|
@ -214,6 +210,7 @@
|
||||||
@if($question->code == 'contact_id')
|
@if($question->code == 'contact_id')
|
||||||
msl_code="{{ (isset($option->contact->legacy_code) ? $option->contact->legacy_code : '') }}"
|
msl_code="{{ (isset($option->contact->legacy_code) ? $option->contact->legacy_code : '') }}"
|
||||||
pcode="{{ (isset($option->contact->msl_code) ? $option->contact->msl_code : '') }}"
|
pcode="{{ (isset($option->contact->msl_code) ? $option->contact->msl_code : '') }}"
|
||||||
|
|
||||||
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
|
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
|
||||||
@endif
|
@endif
|
||||||
>
|
>
|
||||||
|
|
@ -281,7 +278,7 @@
|
||||||
'yes' ) )
|
'yes' ) )
|
||||||
<div class="text-center button-list">
|
<div class="text-center button-list">
|
||||||
@if(!$id)
|
@if(!$id)
|
||||||
<!-- <button class="btn btn-primary" type="button" id="adddoctor-btn"> Add Doctor </button> -->
|
<button class="btn btn-primary" type="button" id="adddoctor-btn"> Add Doctor </button>
|
||||||
@endif
|
@endif
|
||||||
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -337,19 +334,16 @@
|
||||||
$('#field-contact_id').on('change',function(){
|
$('#field-contact_id').on('change',function(){
|
||||||
$('#field-msl_code').val($(this).find(":selected").attr("msl_code"));
|
$('#field-msl_code').val($(this).find(":selected").attr("msl_code"));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').on('change',function(){
|
||||||
|
$('#field-pcode').val($(this).find(":selected").attr("pcode"));
|
||||||
|
})
|
||||||
|
|
||||||
$('#field-contact_id').on('change',function(){
|
$('#field-contact_id').on('change',function(){
|
||||||
$('#field-speciality').val($(this).find(":selected").attr("speciality"));
|
$('#field-speciality').val($(this).find(":selected").attr("speciality"));
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#field-contact_id').on('change',function(){
|
$('#field-msl_code,#field-pcode,#field-speciality').attr('readonly',true);
|
||||||
console.log("Pcode is : ",$(this).find(":selected").attr("pcode"));
|
|
||||||
$('#field-pcode').val($(this).find(":selected").attr("pcode "));
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
$('#field-msl_code,#field-speciality').attr('readonly',true);
|
|
||||||
|
|
||||||
function initializeSelect2() {
|
function initializeSelect2() {
|
||||||
|
|
||||||
|
|
@ -501,18 +495,22 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on('change', 'select[id^="field-contact_id"]', function () {
|
|
||||||
|
|
||||||
|
|
||||||
let selectedOption = $(this).find(':selected');
|
$(document).on('change', 'select[id^="field-contact_id"]', function() {
|
||||||
|
|
||||||
|
var $selected = $(this).find(':selected');
|
||||||
|
|
||||||
let id = $(this).attr('id').split('-').pop(); // get doctor_count dynamically
|
|
||||||
|
var index = this.id.replace('field-contact_id', '');
|
||||||
$('#field-msl_code-' + id).val(selectedOption.attr('msl_code'));
|
|
||||||
$('#field-speciality-' + id).val(selectedOption.attr('speciality'));
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-msl_code' + index).val($selected.attr('msl_code') || '');
|
||||||
|
$('#field-speciality' + index).val($selected.attr('speciality') || '');
|
||||||
|
$('#field-pcode' + index).val($selected.attr('pcode') || '');
|
||||||
preventDuplicateDoctors();
|
preventDuplicateDoctors();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -591,6 +589,8 @@
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$('#field-msl_code-'+doctor_count).attr('readonly',true);
|
$('#field-msl_code-'+doctor_count).attr('readonly',true);
|
||||||
|
$('#field-pcode-'+doctor_count).attr('readonly',true);
|
||||||
|
|
||||||
$('#field-speciality-'+doctor_count).attr('readonly',true);
|
$('#field-speciality-'+doctor_count).attr('readonly',true);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -600,7 +600,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($('.doctor-wrapper').length >= 10) {
|
if ($('.doctor-wrapper').length >=5) {
|
||||||
$('#adddoctor-btn').hide();
|
$('#adddoctor-btn').hide();
|
||||||
} else {
|
} else {
|
||||||
$('#adddoctor-btn').show();
|
$('#adddoctor-btn').show();
|
||||||
|
|
@ -664,8 +664,8 @@
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event) {
|
$('#report-form').on('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (numberOfSubmission !=10) {
|
if (numberOfSubmission !=5) {
|
||||||
alert(`You must submit 10 Doctors for Ciphaler , Current Doctors : ${numberOfSubmission+1}`);
|
alert(`You must submit 5 Doctors for Ciphaler , Current Doctors : ${numberOfSubmission+1}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue