function getChecks() { console.log('singles')
var str = '';
var x = '';
var y = '';

var pass = '';
var selected = '';

var forceGen = '';
var chainMode = parent.document.querySelector("input[name='chainMode']:checked").value;

document.getElementById('itemList').textContent = selected;

if (document.getElementById('forceGen').checked) {
forceGen = "yes";
}

var checkboxes = document.querySelectorAll('input[type=checkbox]');
var checkedCount = 0;
checkboxes.forEach(function(checkbox) {
if (checkbox.checked) { checkedCount++;
var nameAttr = checkbox.getAttribute('name');
if (nameAttr !== null) {
x = nameAttr.split("-");
str += '../output/reports/<?= $_REQUEST['clientnumber'] ?>/' + x[0] + '_' + x[1] + '.pdf,';
selected += (nameAttr + '|');
var val = nameAttr.split('|');
fileset.push({
source: 'output/reports/<?= $_REQUEST['clientnumber'] ?>',
file: val[0] + '_' + val[1] + '.pdf',
type: 'pdf'
});

if (checkbox.getAttribute('data-status') === "URGENT") {
y = nameAttr.split("-");
hse += '../output/reports/<?= $_REQUEST['clientnumber'] ?>/' + y[0] + '_' + y[1] + '.pdf,';
errordel += (nameAttr + '|');
}
}
}

//DEBUG ITEMS
document.getElementById('itemList').textContent = selected;
});

if (selected === "") {
showResponse('warning', 'No Items Selected');
} else {
if (checkedCount > 1) {
loadModalContent(
'<h3 class="text-center">Do you wish to manually sort the reports?</h3>',
"multiBox",
"modal-xl",
1060,
"true",
'Manual Sort',
'sortReports',
'singleContinue(\'' + selected + '\',\'' + errordel + '\',\'' + forceGen + '\',\'' + hse + '\',\'' +
chainMode + '\')',
'manualSortSingle(\'' + selected + '\',\'' + errordel + '\',\'' + forceGen + '\',\'' + hse + '\',\'' + chainMode + '\')'
);
}
else{
if (chainMode === "merge") {
genFiles(selected, errordel, forceGen, hse);
}
if (chainMode === "split") {
splitter(selected, errordel, forceGen, hse);
}
}
}
}

function singleContinue(selected, errordel, forceGen, hse, chainMode) {
document.getElementById('multiBox').style.display = 'none';
killAllModals()
if (chainMode === "merge") {
genFiles(selected, errordel, forceGen, hse);
}
if (chainMode === "split") {
splitter(selected, errordel, forceGen, hse);
}
}