Commit 772d8ed4 authored by Deep Dey's avatar Deep Dey

feat: add dashboard button to download templates

parent db630f46
......@@ -49,7 +49,7 @@
<div class="book-appointment-box mt-3">
<div style="display: flex; gap: 4px;">
<button id="summary-popup-btn" class="btn btn-success btn-sm">Download Score Sheets</button>
<button class="btn btn-success btn-sm">Download Interaction Sheet</button>
<button id="download-interaction-sheet-btn" class="btn btn-success btn-sm">Download Interaction Sheet</button>
<button id="download-admission-data-btn" class="btn btn-success btn-sm">Download Admission Data</button>
</div>
<button id="bookAppointmentBtn" class="btn btn-primary btn-sm">Schedule Appointment</button>
......@@ -137,8 +137,8 @@
</div>
</div>
<div class="book-appointment-box2">
<button class="btn btn-primary btn-sm">Interaction Scoring Sheet</button>
<button class="btn btn-secondary btn-sm">Counsellor Scoring Sheet</button>
<button id="interactionScoring" class="btn btn-primary btn-sm">Interaction Scoring Sheet</button>
<button id="counsellorScoring" class="btn btn-secondary btn-sm">Counsellor Scoring Sheet</button>
</div>
</div>
</div>
......
......@@ -52,7 +52,11 @@ $(document).ready(function () {
queryData.interactionDate = interactionDate;
}
if (interactionTime) {
queryData.interactionTime = interactionTime;
let currentDate = new Date().toISOString().split('T')[0];
var selectedDateTime = new Date(
currentDate + 'T' + interactionTime
);
queryData.interactionTime = formatAMPM(selectedDateTime);
}
$.ajax({
......@@ -234,4 +238,82 @@ $(document).ready(function () {
$('#summary-popup-btn').click(function () {
$('#reportModal').modal('show');
});
$('#counsellorScoring').click(function () {
let schoolName = $('#schoolFilterReport').val();
let interactionDate = $('#dateFilterReport').val();
if (!schoolName || !interactionDate) {
$('#messageModal .modal-title').text('Error');
$('#messageModal .modal-body').text(
'Please select school and date to download counsellor scoring sheet.'
);
$('#messageModal').modal('show');
}
window
.open(
BASE_URL_LAMARTIN +
`/admission-form/download-counsellor-scoring-template?apikey=${
loginData.apiKey
}&schoolName=${schoolName}&interactionDate=${interactionDate}`,
'_blank'
)
.focus();
});
$('#interactionScoring').click(function () {
let schoolName = $('#schoolFilterReport').val();
let interactionDate = $('#dateFilterReport').val();
if (!schoolName || !interactionDate) {
$('#messageModal .modal-title').text('Error');
$('#messageModal .modal-body').text(
'Please select school and date to download interaction scoring sheet.'
);
$('#messageModal').modal('show');
}
window
.open(
BASE_URL_LAMARTIN +
`/admission-form/download-interaction-scoring-template?apikey=${
loginData.apiKey
}&schoolName=${schoolName}&interactionDate=${interactionDate}`,
'_blank'
)
.focus();
});
$('#download-interaction-sheet-btn').click(function () {
let schoolFilter = $('#schoolFilter').val();
let dateFilter = $('#dateFilter').val();
let timeFilter = $('#timeFilter').val();
if (!schoolFilter || !dateFilter || !timeFilter) {
$('#messageModal .modal-title').text('Error');
$('#messageModal .modal-body').text(
'Please select school and date and time from filter to download interaction sheet.'
);
$('#messageModal').modal('show');
}
var selectedDateTime = new Date(
dateFilter + 'T' + timeFilter
);
window
.open(
BASE_URL_LAMARTIN +
`/admission-form/download-master-interaction-template?apikey=${
loginData.apiKey
}&schoolName=${
schoolFilter
}&interactionDate=${
dateFilter
}&interactionTime=${formatAMPM(selectedDateTime)}`,
'_blank'
)
.focus();
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment