Team 4 Form changes MONTAIR LC Kid 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
1481c718ef
commit
9813100164
|
|
@ -93,8 +93,14 @@
|
||||||
@case('email')
|
@case('email')
|
||||||
@case('tel')
|
@case('tel')
|
||||||
@case('date')
|
@case('date')
|
||||||
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:''}}">
|
<input type="{{$question->type}}"
|
||||||
@break
|
id="field-{{$question->code}}"
|
||||||
|
name="{{$question->code}}"
|
||||||
|
class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}
|
||||||
|
value="{{isset($question->value)?$question->value:''}}"
|
||||||
|
{{$question->code == 'legacy_code' ? 'readonly' : ''}}>
|
||||||
|
@break
|
||||||
@case('number')
|
@case('number')
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
|
|
@ -361,7 +367,7 @@ function preventDuplicateDoctors() {
|
||||||
$("<option></option>")
|
$("<option></option>")
|
||||||
.attr("value", itm.value)
|
.attr("value", itm.value)
|
||||||
.text(itm.display)
|
.text(itm.display)
|
||||||
.attr("legacy_code", itm.contact.legacy_code)
|
.attr("msl_code", itm.contact.legacy_code)
|
||||||
.attr("speciality", itm.contact.speciality)
|
.attr("speciality", itm.contact.speciality)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -374,45 +380,49 @@ function preventDuplicateDoctors() {
|
||||||
console.log(hierarchy);
|
console.log(hierarchy);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$("#pageloader").fadeIn();
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: '/form/ajaxsubmit',
|
|
||||||
data: new FormData($('#report-form')[0]),
|
|
||||||
processData: false,
|
|
||||||
contentType: false,
|
|
||||||
success: function(data) {
|
|
||||||
|
|
||||||
console.log("FULL DOCTOR DATA:", data);
|
$("#pageloader").fadeIn();
|
||||||
|
|
||||||
/*for (let itm of data) {
|
$.ajax({
|
||||||
console.log("DOCTOR:", itm);
|
type: "POST",
|
||||||
console.log("LEGACY CODE:", itm.legacy_code);
|
url: '/form/ajaxsubmit',
|
||||||
console.log("CONTACT:", itm.contact);
|
data: new FormData($('#report-form')[0]),
|
||||||
console.log("CONTACT LEGACY CODE:", itm.contact ? itm.contact.legacy_code : 'NO CONTACT');
|
processData: false,
|
||||||
}*/
|
contentType: false,
|
||||||
|
|
||||||
$("#pageloader").fadeOut();
|
success: function(data) {
|
||||||
|
|
||||||
$('#field-contact_id').html('');
|
$("#pageloader").fadeOut();
|
||||||
$('#field-contact_id').append(
|
|
||||||
$("<option></option>")
|
|
||||||
.attr("value", '')
|
|
||||||
.text('-- Select --')
|
|
||||||
);
|
|
||||||
|
|
||||||
for(let itm of data) {
|
if(data.status == 'success') {
|
||||||
$('#field-contact_id').append(
|
|
||||||
$("<option></option>")
|
Swal.fire({
|
||||||
.attr("value", itm.value)
|
title: 'Great!',
|
||||||
.text(itm.display)
|
text: 'Your data is successfully submitted!',
|
||||||
);
|
icon: 'success'
|
||||||
}
|
});
|
||||||
},
|
|
||||||
});
|
$('#report-form').trigger("reset");
|
||||||
});
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: data.hasOwnProperty('message')
|
||||||
|
? 'You are not mapped to any position code'
|
||||||
|
: 'Data not submitted',
|
||||||
|
|
||||||
|
text: data.hasOwnProperty('message')
|
||||||
|
? 'for resolution please email Position code, L1 Manager and L2 Manager details to support1@stratawiz.com'
|
||||||
|
: 'Something went wrong, please try again after some time!'
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#field-contact_id').change(function() {
|
$('#field-contact_id').change(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue