
<style>
    @media print {
        body {
            font-family: Arial, sans-serif;
            line-height: 1.5;
        }
        h1 {
            text-align: center;
            margin-bottom: 20px;
        }
        ul {
            list-style-type: none;
            padding: 0;
        }
        li {
            margin-bottom: 15px;
            border-bottom: 1px solid #ccc;
            padding-bottom: 10px;
        }
    }
</style>

<script>
    document.addEventListener('DOMContentLoaded', function () {
        document.querySelectorAll('.stampa-selezionate').forEach(function (button) {
            button.addEventListener('click', function () {
                const form = button.closest('form');
                const checkedBoxes = form.querySelectorAll('input.seleziona-richiesta:checked');
                if (checkedBoxes.length === 0) {
                    alert('Seleziona almeno una richiesta da stampare.');
                    return;
                }

                let contenutoStampare = '<h1>Richieste Selezionate</h1><ul>';
                checkedBoxes.forEach(function (box) {
                    const parentLi = box.closest('li');
                    contenutoStampare += '<li>' + parentLi.innerHTML + '</li>';
                });
                contenutoStampare += '</ul>';

                const newWindow = window.open('', '_blank', 'width=800,height=600');
                newWindow.document.write('<html><head><title>Stampa Richieste</title></head><body>');
                newWindow.document.write(contenutoStampare);
                newWindow.document.write('</body></html>');
                newWindow.document.close();
                newWindow.print();
            });
        });
    });
	
	
</script>

<script>
    document.addEventListener('DOMContentLoaded', function () {
        document.querySelectorAll('.seleziona-tutte').forEach(function (checkbox) {
            checkbox.addEventListener('change', function () {
                const form = checkbox.closest('form');
                const allCheckboxes = form.querySelectorAll('input.seleziona-richiesta');
                allCheckboxes.forEach(function (box) {
                    box.checked = checkbox.checked;
                });
            });
        });
    });
</script>

{"id":13,"date":"2024-11-04T09:14:34","date_gmt":"2024-11-04T08:14:34","guid":{"rendered":"https:\/\/www.etssecurity.it\/richiestapreventivo\/?page_id=13"},"modified":"2024-12-09T08:51:14","modified_gmt":"2024-12-09T07:51:14","slug":"scegli","status":"publish","type":"page","link":"https:\/\/www.etssecurity.it\/richiestapreventivo\/scegli\/","title":{"rendered":"Scegli"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"template\/Form_Preventivo_Abitazione_Bis.php","meta":{"footnotes":""},"class_list":["post-13","page","type-page","status-publish","hentry","post"],"_links":{"self":[{"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/pages\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":2,"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/pages\/13\/revisions"}],"predecessor-version":[{"id":15,"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/pages\/13\/revisions\/15"}],"wp:attachment":[{"href":"https:\/\/www.etssecurity.it\/richiestapreventivo\/wp-json\/wp\/v2\/media?parent=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}