Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 44s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 44s
Details
This commit is contained in:
commit
85b023e3d8
|
|
@ -54,8 +54,11 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
<input type="hidden" name="SAFARI_TROLLEY_BAG_METRIC" id="safari_trolley_bag_metric" value="0">
|
||||||
|
<input type="hidden" name="SAVLON_KIT_METRIC" id="savlon_kit_metric" value="0">
|
||||||
|
|
||||||
@foreach($questions as $question)
|
@foreach($questions as $question)
|
||||||
<div class="col-md-12 mb-2">
|
<div class="col-md-12 mb-2">
|
||||||
|
|
@ -278,6 +281,34 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Input Name - Safari Trolley Bag / Savlon Kit
|
||||||
|
$('#field-input_name').on('change', function () {
|
||||||
|
|
||||||
|
var selectedInput = $(this).val();
|
||||||
|
|
||||||
|
// Reset both metrics to 0
|
||||||
|
$('input[name="SAFARI_TROLLEY_BAG_METRIC"]').val('0');
|
||||||
|
$('input[name="SAVLON_KIT_METRIC"]').val('0');
|
||||||
|
|
||||||
|
// Selected option = 1
|
||||||
|
if (selectedInput === 'Safari Trolley Bag') {
|
||||||
|
|
||||||
|
$('input[name="SAFARI_TROLLEY_BAG_METRIC"]').val('1');
|
||||||
|
|
||||||
|
} else if (selectedInput === 'Savlon Kit') {
|
||||||
|
|
||||||
|
$('input[name="SAVLON_KIT_METRIC"]').val('1');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
'Input Name:', selectedInput,
|
||||||
|
'Safari:', $('input[name="SAFARI_TROLLEY_BAG_METRIC"]').val(),
|
||||||
|
'Savlon:', $('input[name="SAVLON_KIT_METRIC"]').val()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
// bag_distribution_photo_jpgjpegpng_max_upto_10_mb
|
// bag_distribution_photo_jpgjpegpng_max_upto_10_mb
|
||||||
$('#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb').on('change', function () {
|
$('#field-bag_distribution_photo_jpgjpegpng_max_upto_10_mb').on('change', function () {
|
||||||
|
|
||||||
|
|
@ -374,32 +405,60 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var selectedInput = $('#field-input_name').val();
|
||||||
|
|
||||||
|
var formData = new FormData($('#report-form')[0]);
|
||||||
|
|
||||||
|
// Always reset both
|
||||||
|
formData.set('SAFARI_TROLLEY_BAG_METRIC', '0');
|
||||||
|
formData.set('SAVLON_KIT_METRIC', '0');
|
||||||
|
|
||||||
|
// Selected one = 1
|
||||||
|
if (selectedInput === 'Safari Trolley Bag') {
|
||||||
|
|
||||||
|
formData.set('SAFARI_TROLLEY_BAG_METRIC', '1');
|
||||||
|
|
||||||
|
} else if (selectedInput === 'Savlon Kit') {
|
||||||
|
|
||||||
|
formData.set('SAVLON_KIT_METRIC', '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '/form/ajaxsubmit',
|
url: '/form/ajaxsubmit',
|
||||||
data: new FormData($('#report-form')[0]),
|
data: formData,
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function( data ) {
|
success: function(data) {
|
||||||
$("#pageloader").fadeOut();
|
|
||||||
if(data.status == 'success') {
|
console.log("SERVER RESPONSE:", data);
|
||||||
Swal.fire({
|
|
||||||
title: 'Great!',
|
$("#pageloader").fadeOut();
|
||||||
text: 'Your data is successfully submitted!',
|
|
||||||
icon: 'success'
|
if(data.status == 'success') {
|
||||||
})
|
Swal.fire({
|
||||||
$('#report-form').trigger("reset");
|
title: 'Great!',
|
||||||
} else {
|
text: 'Your data is successfully submitted!',
|
||||||
Swal.fire({
|
icon: 'success'
|
||||||
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!'
|
$('#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!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue