Titans Form Changes - Core HCP Connect Drive
Specific Folder FTP Upload / ftp-deploy (push) Successful in 49s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 49s
Details
This commit is contained in:
parent
d0765b9a8c
commit
5592a34619
|
|
@ -169,6 +169,13 @@
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
|
<!-- Drive Count Fields -->
|
||||||
|
<input type="hidden" name="Count of Plans_LHC" id="count-plans-lhc" value="0">
|
||||||
|
<input type="hidden" name="Count of Execution_LHC" id="count-execution-lhc" value="0">
|
||||||
|
<input type="hidden" name="Count of Plans_Novel" id="count-plans-novel" value="0">
|
||||||
|
<input type="hidden" name="Count of Execution_Novel" id="count-execution-novel" value="0">
|
||||||
|
|
||||||
@if ($id)
|
@if ($id)
|
||||||
<input type="hidden" name="id" value="{{ $id }}">
|
<input type="hidden" name="id" value="{{ $id }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
@ -285,7 +292,24 @@
|
||||||
enctype="multipart/form-data">
|
enctype="multipart/form-data">
|
||||||
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
<input type="hidden" name="form_id" value="{{ $form_id }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="id" value="" id="execution-id">
|
<input type="hidden" name="id" value="" id="execution-id">
|
||||||
|
<input type="hidden" name="execution_mode" id="execution-mode" value="no">
|
||||||
|
|
||||||
|
<!-- Drive Count Fields -->
|
||||||
|
<input type="hidden" name="Count of Plans_LHC"
|
||||||
|
id="execution-count-plans-lhc" value="0">
|
||||||
|
|
||||||
|
<input type="hidden" name="Count of Execution_LHC"
|
||||||
|
id="execution-count-execution-lhc" value="0">
|
||||||
|
|
||||||
|
<input type="hidden" name="Count of Plans_Novel"
|
||||||
|
id="execution-count-plans-novel" value="0">
|
||||||
|
|
||||||
|
<input type="hidden" name="Count of Execution_Novel"
|
||||||
|
id="execution-count-execution-novel" value="0">
|
||||||
|
|
||||||
{{-- <input type="hidden" name="execution_done" value="yes"> --}}
|
{{-- <input type="hidden" name="execution_done" value="yes"> --}}
|
||||||
@foreach ($questions as $question)
|
@foreach ($questions as $question)
|
||||||
<div class="col-md-12 mb-2">
|
<div class="col-md-12 mb-2">
|
||||||
|
|
@ -421,6 +445,66 @@
|
||||||
$('#execution-no_of_patients_screened').closest('.col-md-12').hide();
|
$('#execution-no_of_patients_screened').closest('.col-md-12').hide();
|
||||||
$('#execution-no_of_patients_screened').prop('required', false);
|
$('#execution-no_of_patients_screened').prop('required', false);
|
||||||
|
|
||||||
|
// =====================================================
|
||||||
|
// DRIVE COUNT FUNCTIONS
|
||||||
|
// =====================================================
|
||||||
|
|
||||||
|
// Plan Filling
|
||||||
|
function setPlanDriveCount() {
|
||||||
|
|
||||||
|
const activity = ($('#field-activity').val() || '').trim().toUpperCase();
|
||||||
|
|
||||||
|
$('#drive-count-plans-lhc').val('0');
|
||||||
|
$('#drive-count-execution-lhc').val('0');
|
||||||
|
$('#drive-count-plans-novel').val('0');
|
||||||
|
$('#drive-count-execution-novel').val('0');
|
||||||
|
|
||||||
|
if (activity === 'LHC') {
|
||||||
|
|
||||||
|
$('#drive-count-plans-lhc').val('1');
|
||||||
|
|
||||||
|
} else if (activity === 'NOVEL') {
|
||||||
|
|
||||||
|
$('#drive-count-plans-novel').val('1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
function setExecutionDriveCount() {
|
||||||
|
|
||||||
|
const activity = ($('#execution-activity').val() || '').trim().toUpperCase();
|
||||||
|
|
||||||
|
$('#execution-drive-count-plans-lhc').val('0');
|
||||||
|
$('#execution-drive-count-execution-lhc').val('0');
|
||||||
|
$('#execution-drive-count-plans-novel').val('0');
|
||||||
|
$('#execution-drive-count-execution-novel').val('0');
|
||||||
|
|
||||||
|
if (activity === 'LHC') {
|
||||||
|
|
||||||
|
$('#execution-drive-count-execution-lhc').val('1');
|
||||||
|
|
||||||
|
} else if (activity === 'NOVEL') {
|
||||||
|
|
||||||
|
$('#execution-drive-count-execution-novel').val('1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Activity change - Plan
|
||||||
|
$('#field-activity').on('change.driveCount', function() {
|
||||||
|
setPlanDriveCount();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Activity change - Execution
|
||||||
|
$('#execution-activity').on('change.driveCount', function() {
|
||||||
|
setExecutionDriveCount();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Initialize Plan count
|
||||||
|
setPlanDriveCount();
|
||||||
|
|
||||||
|
|
||||||
$('#add-camp-btn').click(function() {
|
$('#add-camp-btn').click(function() {
|
||||||
|
|
@ -433,6 +517,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
$('.edit-btn').click(function() {
|
$('.edit-btn').click(function() {
|
||||||
|
$('#execution-mode').val('yes');
|
||||||
$('#execution-form-wrapper').show(100, () => {
|
$('#execution-form-wrapper').show(100, () => {
|
||||||
$('#add-camp-btn').hide(0);
|
$('#add-camp-btn').hide(0);
|
||||||
})
|
})
|
||||||
|
|
@ -498,6 +583,10 @@
|
||||||
|
|
||||||
$('#execution-contact_id').val(docid)
|
$('#execution-contact_id').val(docid)
|
||||||
$('#execution-id').val(selected['id'])
|
$('#execution-id').val(selected['id'])
|
||||||
|
|
||||||
|
// Set execution drive count
|
||||||
|
setExecutionDriveCount();
|
||||||
|
|
||||||
// Show Patients Screened only for LHC during Execution
|
// Show Patients Screened only for LHC during Execution
|
||||||
const selectedActivity = ($('#execution-activity').val() || '').trim().toUpperCase();
|
const selectedActivity = ($('#execution-activity').val() || '').trim().toUpperCase();
|
||||||
|
|
||||||
|
|
@ -627,6 +716,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#execution-activity').on('change.driveCount', function() {
|
||||||
|
setExecutionDriveCount();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
let docid = $('#execution-contact_id option').map(function() {
|
let docid = $('#execution-contact_id option').map(function() {
|
||||||
if ($(this).text().trim() == selected['contact_id'] || $(this).val().trim() == selected['cont_id']) return this;
|
if ($(this).text().trim() == selected['contact_id'] || $(this).val().trim() == selected['cont_id']) return this;
|
||||||
}).attr('value')
|
}).attr('value')
|
||||||
|
|
@ -732,35 +827,66 @@
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event) {
|
$('#report-form').on('submit', function(event) {
|
||||||
|
|
||||||
event.preventDefault();
|
// Get the currently selected activity
|
||||||
$("#pageloader").fadeIn();
|
const activity = ($('#field-activity').val() || '').trim().toUpperCase();
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: '/form/ajaxsubmit',
|
|
||||||
data: new FormData($('#report-form')[0]),
|
|
||||||
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'
|
|
||||||
})
|
|
||||||
window.location.reload();
|
|
||||||
//$('#report-form').trigger("reset");
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'error',
|
|
||||||
title: 'Data not submitted',
|
|
||||||
text: 'Something went wrong, please try again after some time!'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
// Reset all Plan/Execution counters
|
||||||
|
$('#count-plans-lhc').val('0');
|
||||||
|
$('#count-execution-lhc').val('0');
|
||||||
|
$('#count-plans-novel').val('0');
|
||||||
|
$('#count-execution-novel').val('0');
|
||||||
|
|
||||||
|
// Set Plan counter based on selected Activity
|
||||||
|
if (activity === 'LHC') {
|
||||||
|
|
||||||
|
$('#count-plans-lhc').val('1');
|
||||||
|
|
||||||
|
} else if (activity === 'NOVEL') {
|
||||||
|
|
||||||
|
$('#count-plans-novel').val('1');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debug - check before submitting
|
||||||
|
console.log('Plan Activity:', activity);
|
||||||
|
console.log('Count of Plans_LHC:', $('#count-plans-lhc').val());
|
||||||
|
console.log('Count of Plans_Novel:', $('#count-plans-novel').val());
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: '/form/ajaxsubmit',
|
||||||
|
data: new FormData($('#report-form')[0]),
|
||||||
|
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'
|
||||||
|
});
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Data not submitted',
|
||||||
|
text: 'Something went wrong, please try again after some time!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#field-core_value').parent().hide();
|
$('#field-core_value').parent().hide();
|
||||||
|
|
@ -783,6 +909,8 @@
|
||||||
$('#field-core_value').val($('option:selected', this).attr('core_value'))
|
$('#field-core_value').val($('option:selected', this).attr('core_value'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#field-msl_code').prop('readonly', true);
|
$('#field-msl_code').prop('readonly', true);
|
||||||
$('#field-speciality').prop('readonly', true);
|
$('#field-speciality').prop('readonly', true);
|
||||||
|
|
||||||
|
|
@ -829,62 +957,134 @@
|
||||||
|
|
||||||
$('#execution-form').on('submit', function(event) {
|
$('#execution-form').on('submit', function(event) {
|
||||||
|
|
||||||
const activity = ($('#execution-activity').val() || '').trim().toUpperCase();
|
const activity = ($('#execution-activity').val() || '')
|
||||||
|
.trim()
|
||||||
|
.toUpperCase();
|
||||||
|
|
||||||
if (activity === 'LHC') {
|
const executionMode = $('#execution-mode').val();
|
||||||
|
|
||||||
const patientsScreened = $('#execution-no_of_patients_screened').val();
|
/*
|
||||||
|
* Reset all counters first
|
||||||
|
*/
|
||||||
|
$('#execution-count-plans-lhc').val('0');
|
||||||
|
$('#execution-count-execution-lhc').val('0');
|
||||||
|
$('#execution-count-plans-novel').val('0');
|
||||||
|
$('#execution-count-execution-novel').val('0');
|
||||||
|
|
||||||
if (
|
|
||||||
patientsScreened === '' ||
|
|
||||||
!/^\d+$/.test(patientsScreened)
|
|
||||||
) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
Swal.fire({
|
/*
|
||||||
icon: 'error',
|
* Only set Execution counters when
|
||||||
title: 'Invalid No. of Patients Screened',
|
* this is actual Execution, NOT Edit Plan.
|
||||||
text: 'Please enter a valid whole number. Negative numbers and decimal values are not allowed.'
|
*/
|
||||||
});
|
if (executionMode === 'yes') {
|
||||||
|
|
||||||
$('#execution-no_of_patients_screened').focus();
|
if (activity === 'LHC') {
|
||||||
|
|
||||||
return;
|
$('#execution-count-execution-lhc').val('1');
|
||||||
}
|
|
||||||
}
|
} else if (activity === 'NOVEL') {
|
||||||
|
|
||||||
|
$('#execution-count-execution-novel').val('1');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Patients Screened validation
|
||||||
|
*/
|
||||||
|
if (activity === 'LHC') {
|
||||||
|
|
||||||
|
const patientsScreened =
|
||||||
|
$('#execution-no_of_patients_screened').val();
|
||||||
|
|
||||||
|
if (
|
||||||
|
patientsScreened === '' ||
|
||||||
|
!/^\d+$/.test(patientsScreened)
|
||||||
|
) {
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
$("#pageloader").fadeIn();
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
$.ajax({
|
title: 'Invalid No. of Patients Screened',
|
||||||
type: "POST",
|
text: 'Please enter a valid whole number. Negative numbers and decimal values are not allowed.'
|
||||||
url: '/form/ajaxsubmit',
|
|
||||||
data: new FormData($('#execution-form')[0]),
|
|
||||||
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'
|
|
||||||
}).then(() => {
|
|
||||||
location.reload(); // 🔥 page refresh here
|
|
||||||
});
|
|
||||||
$('#report-form').trigger("reset");
|
|
||||||
} else {
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'error',
|
|
||||||
title: 'Data not submitted',
|
|
||||||
text: 'Something went wrong, please try again after some time!'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#execution-no_of_patients_screened').focus();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Debug before submission
|
||||||
|
*/
|
||||||
|
console.log('Execution Mode:', executionMode);
|
||||||
|
console.log('Execution Activity:', activity);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
'Count of Execution_LHC:',
|
||||||
|
$('#execution-count-execution-lhc').val()
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
'Count of Execution_Novel:',
|
||||||
|
$('#execution-count-execution-novel').val()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Submit
|
||||||
|
*/
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: '/form/ajaxsubmit',
|
||||||
|
data: new FormData($('#execution-form')[0]),
|
||||||
|
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'
|
||||||
|
}).then(() => {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Data not submitted',
|
||||||
|
text: 'Something went wrong, please try again after some time!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function() {
|
||||||
|
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Data not submitted',
|
||||||
|
text: 'Something went wrong, please try again after some time!'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
var dd = String(today.getDate()).padStart(2, '0');
|
var dd = String(today.getDate()).padStart(2, '0');
|
||||||
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue