Team 3 Form changes View Channel Partner Input Reporting Form (Neb 2)
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:
parent
d21ae98997
commit
66a1d9b862
|
|
@ -54,8 +54,11 @@
|
|||
@endforeach
|
||||
</select>
|
||||
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
||||
|
||||
</div>
|
||||
@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)
|
||||
<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
|
||||
$('#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();
|
||||
$("#pageloader").fadeIn();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/form/ajaxsubmit',
|
||||
data: new FormData($('#report-form')[0]),
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function( data ) {
|
||||
$("#pageloader").fadeOut();
|
||||
if(data.status == 'success') {
|
||||
Swal.fire({
|
||||
title: 'Great!',
|
||||
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!'
|
||||
})
|
||||
}
|
||||
},
|
||||
success: function(data) {
|
||||
|
||||
console.log("SERVER RESPONSE:", data);
|
||||
|
||||
$("#pageloader").fadeOut();
|
||||
|
||||
if(data.status == 'success') {
|
||||
Swal.fire({
|
||||
title: 'Great!',
|
||||
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!'
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue