{"id":3934,"date":"2025-09-02T21:55:23","date_gmt":"2025-09-02T19:55:23","guid":{"rendered":"https:\/\/www.marenia.net\/raffaelecardone\/?page_id=3934"},"modified":"2026-01-01T20:14:04","modified_gmt":"2026-01-01T19:14:04","slug":"invioelaborati","status":"publish","type":"page","link":"https:\/\/www.marenia.net\/raffaelecardone\/invioelaborati\/","title":{"rendered":"Invio elaborati"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-text-align-center\"><strong>Invio Elaborati<\/strong><\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<!DOCTYPE html>\n<html lang=\"it\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Corso Intelligenza Artificiale &#8211; Invio Lavori<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n            background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);\n            min-height: 100vh;\n            padding: 20px;\n        }\n\n        .container {\n            max-width: auto;\n            margin: 0 auto;\n            background: rgba(255, 255, 255, 0.95);\n            border-radius: 20px;\n            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);\n            overflow: hidden;\n            backdrop-filter: blur(10px);\n        }\n\n        .header {\n            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);\n            color: white;\n            padding: 30px;\n            text-align: center;\n        }\n\n        .header h1 {\n            font-size: 24px;\n            margin-bottom: 10px;\n        }\n\n        .header p {\n            opacity: 0.9;\n            font-size: 16px;\n        }\n\n        .form-container {\n            padding: 40px;\n        }\n\n        .form-group {\n            margin-bottom: 25px;\n        }\n\n        label {\n            display: block;\n            margin-bottom: 8px;\n            color: #374151;\n            font-weight: 600;\n            font-size: 14px;\n        }\n\n        input[type=\"text\"], textarea, input[type=\"file\"] {\n            width: 100%;\n            padding: 12px 16px;\n            border: 2px solid #e5e7eb;\n            border-radius: 10px;\n            font-size: 16px;\n            transition: all 0.3s ease;\n            background: #f9fafb;\n        }\n\n        input[type=\"text\"]:focus, textarea:focus {\n            outline: none;\n            border-color: #4f46e5;\n            background: white;\n            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);\n        }\n\n        textarea {\n            resize: vertical;\n            min-height: 120px;\n            font-family: inherit;\n        }\n\n        .file-input-wrapper {\n            position: relative;\n            overflow: hidden;\n            background: #f3f4f6;\n            border: 2px dashed #d1d5db;\n            border-radius: 10px;\n            padding: 20px;\n            text-align: center;\n            cursor: pointer;\n            transition: all 0.3s ease;\n        }\n\n        .file-input-wrapper:hover {\n            border-color: #4f46e5;\n            background: #f8faff;\n        }\n\n        .file-input-wrapper input[type=\"file\"] {\n            position: absolute;\n            left: -9999px;\n            opacity: 0;\n        }\n\n        .file-info {\n            margin-top: 10px;\n            padding: 10px;\n            background: #e0e7ff;\n            border-radius: 8px;\n            font-size: 14px;\n            color: #4338ca;\n        }\n\n        .submit-btn {\n            width: 100%;\n            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);\n            color: white;\n            padding: 16px;\n            border: none;\n            border-radius: 12px;\n            font-size: 18px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.3s ease;\n            position: relative;\n            overflow: hidden;\n        }\n\n        .submit-btn:hover {\n            transform: translateY(-2px);\n            box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);\n        }\n\n        .submit-btn:disabled {\n            background: #9ca3af;\n            cursor: not-allowed;\n            transform: none;\n        }\n\n        .loading {\n            display: none;\n        }\n\n        .loading.active {\n            display: inline-block;\n            width: 20px;\n            height: 20px;\n            border: 2px solid #ffffff;\n            border-radius: 50%;\n            border-top-color: transparent;\n            animation: spin 1s ease-in-out infinite;\n            margin-right: 10px;\n        }\n\n        @keyframes spin {\n            to { transform: rotate(360deg); }\n        }\n\n        .status-message {\n            margin-top: 20px;\n            padding: 15px;\n            border-radius: 10px;\n            text-align: center;\n            font-weight: 500;\n            display: none;\n        }\n\n        .status-message.success {\n            background: #d1fae5;\n            color: #065f46;\n            border: 1px solid #10b981;\n        }\n\n        .status-message.error {\n            background: #fee2e2;\n            color: #991b1b;\n            border: 1px solid #ef4444;\n        }\n\n        .requirements {\n            background: #fffbeb;\n            border: 1px solid #f59e0b;\n            border-radius: 10px;\n            padding: 20px;\n            margin-bottom: 25px;\n        }\n\n        .requirements h3 {\n            color: #92400e;\n            margin-bottom: 10px;\n        }\n\n        .requirements ul {\n            color: #92400e;\n            margin-left: 20px;\n        }\n\n        .requirements li {\n            margin-bottom: 5px;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        \n        \n        <div class=\"form-container\">\n            <div class=\"requirements\">\n                <h3>\ud83d\udccb Requisiti per l&#8217;invio<\/h3>\n                <ul>\n                    <li>Compilare tutti i campi obbligatori<\/li>\n                    <li>Allegare il file del progetto (max 50MB)<\/li>\n                    <li>Formati supportati: PDF, DOC, DOCX, ZIP, RAR, immagini<\/li>\n                    <li>Descrivere chiaramente il contenuto del lavoro<\/li>\n                <\/ul>\n            <\/div>\n\n            <form id=\"workSubmissionForm\">\n                <div class=\"form-group\">\n                    <label for=\"firstName\">Nome *<\/label>\n                    <input type=\"text\" id=\"firstName\" name=\"firstName\" required placeholder=\"Inserisci il tuo nome\">\n                <\/div>\n\n                <div class=\"form-group\">\n                    <label for=\"lastName\">Cognome *<\/label>\n                    <input type=\"text\" id=\"lastName\" name=\"lastName\" required placeholder=\"Inserisci il tuo cognome\">\n                <\/div>\n\n                <div class=\"form-group\">\n                    <label for=\"description\">Descrizione del lavoro *<\/label>\n                    <textarea id=\"description\" name=\"description\" required placeholder=\"Descrivi il tuo progetto, gli strumenti utilizzati, le metodologie applicate e i risultati ottenuti...\"><\/textarea>\n                <\/div>\n\n                <div class=\"form-group\">\n                    <label for=\"fileInput\">Allegato *<\/label>\n                    <div class=\"file-input-wrapper\" onclick=\"document.getElementById('fileInput').click()\">\n                        <div>\n                            <strong>\ud83d\udcc1 Clicca per selezionare il file<\/strong>\n                            <br><small>Oppure trascina qui il file da caricare<\/small>\n                        <\/div>\n                        <input type=\"file\" id=\"fileInput\" name=\"file\" required>\n                    <\/div>\n                    <div id=\"fileInfo\" class=\"file-info\" style=\"display: none;\"><\/div>\n                <\/div>\n\n                <button type=\"submit\" class=\"submit-btn\" id=\"submitBtn\">\n                    <span class=\"loading\" id=\"loading\"><\/span>\n                    <span id=\"btnText\">\ud83d\udce4 Invia Lavoro<\/span>\n                <\/button>\n            <\/form>\n\n            <div id=\"statusMessage\" class=\"status-message\"><\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        const BOT_TOKEN = '8445698163:AAEsPK8H0xuKmbgHwwJpYs1h_1gH7GUhh2M';\n        const CHAT_ID = '20569023'; \/\/ Sostituire con il tuo chat ID\n        \n        \/\/ Gestione selezione file\n        document.getElementById('fileInput').addEventListener('change', function(e) {\n            const file = e.target.files[0];\n            const fileInfo = document.getElementById('fileInfo');\n            \n            if (file) {\n                const fileSize = (file.size \/ 1024 \/ 1024).toFixed(2);\n                fileInfo.innerHTML = `\n                    <strong>File selezionato:<\/strong> ${file.name}<br>\n                    <strong>Dimensione:<\/strong> ${fileSize} MB<br>\n                    <strong>Tipo:<\/strong> ${file.type || 'Non specificato'}\n                `;\n                fileInfo.style.display = 'block';\n            } else {\n                fileInfo.style.display = 'none';\n            }\n        });\n\n        \/\/ Gestione drag & drop\n        const fileWrapper = document.querySelector('.file-input-wrapper');\n        \n        fileWrapper.addEventListener('dragover', function(e) {\n            e.preventDefault();\n            this.style.borderColor = '#4f46e5';\n            this.style.background = '#f8faff';\n        });\n\n        fileWrapper.addEventListener('dragleave', function(e) {\n            e.preventDefault();\n            this.style.borderColor = '#d1d5db';\n            this.style.background = '#f3f4f6';\n        });\n\n        fileWrapper.addEventListener('drop', function(e) {\n            e.preventDefault();\n            this.style.borderColor = '#d1d5db';\n            this.style.background = '#f3f4f6';\n            \n            const files = e.dataTransfer.files;\n            if (files.length > 0) {\n                document.getElementById('fileInput').files = files;\n                document.getElementById('fileInput').dispatchEvent(new Event('change'));\n            }\n        });\n\n        \/\/ Gestione invio form\n        document.getElementById('workSubmissionForm').addEventListener('submit', async function(e) {\n            e.preventDefault();\n            \n            const submitBtn = document.getElementById('submitBtn');\n            const loading = document.getElementById('loading');\n            const btnText = document.getElementById('btnText');\n            const statusMessage = document.getElementById('statusMessage');\n            \n            \/\/ Disabilita il pulsante e mostra loading\n            submitBtn.disabled = true;\n            loading.classList.add('active');\n            btnText.textContent = 'Invio in corso...';\n            statusMessage.style.display = 'none';\n            \n            try {\n                const formData = new FormData();\n                const firstName = document.getElementById('firstName').value;\n                const lastName = document.getElementById('lastName').value;\n                const description = document.getElementById('description').value;\n                const file = document.getElementById('fileInput').files[0];\n                \n                if (!file) {\n                    throw new Error('Seleziona un file da allegare');\n                }\n\n                \/\/ Prepara il messaggio di testo\n                const message = `\ud83c\udf93 NUOVO LAVORO CORSO IA\\n\\n` +\n                    `\ud83d\udc64 Studente: ${firstName} ${lastName}\\n\\n` +\n                    `\ud83d\udcdd Descrizione:\\n${description}\\n\\n` +\n                    `\ud83d\udcc1 File allegato: ${file.name}\\n` +\n                    `\ud83d\udcca Dimensione: ${(file.size \/ 1024 \/ 1024).toFixed(2)} MB`;\n\n                \/\/ Invia prima il messaggio di testo\n                const textResponse = await fetch(`https:\/\/api.telegram.org\/bot${BOT_TOKEN}\/sendMessage`, {\n                    method: 'POST',\n                    headers: {\n                        'Content-Type': 'application\/json',\n                    },\n                    body: JSON.stringify({\n                        chat_id: CHAT_ID,\n                        text: message,\n                        parse_mode: 'HTML'\n                    })\n                });\n\n                if (!textResponse.ok) {\n                    throw new Error('Errore nell\\'invio del messaggio');\n                }\n\n                \/\/ Poi invia il file\n                formData.append('chat_id', CHAT_ID);\n                formData.append('document', file);\n                formData.append('caption', `Lavoro di ${firstName} ${lastName}`);\n\n                const fileResponse = await fetch(`https:\/\/api.telegram.org\/bot${BOT_TOKEN}\/sendDocument`, {\n                    method: 'POST',\n                    body: formData\n                });\n\n                if (!fileResponse.ok) {\n                    throw new Error('Errore nell\\'invio del file');\n                }\n\n                \/\/ Successo\n                statusMessage.textContent = '\u2705 Lavoro inviato con successo! Riceverai presto un feedback.';\n                statusMessage.className = 'status-message success';\n                statusMessage.style.display = 'block';\n                \n                \/\/ Reset del form\n                document.getElementById('workSubmissionForm').reset();\n                document.getElementById('fileInfo').style.display = 'none';\n                \n            } catch (error) {\n                console.error('Errore:', error);\n                statusMessage.textContent = `\u274c Errore nell'invio: ${error.message}. Riprova o contatta il docente.`;\n                statusMessage.className = 'status-message error';\n                statusMessage.style.display = 'block';\n            } finally {\n                \/\/ Ripristina il pulsante\n                submitBtn.disabled = false;\n                loading.classList.remove('active');\n                btnText.textContent = '\ud83d\udce4 Invia Lavoro';\n            }\n        });\n    <\/script>\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Invio Elaborati Corso Intelligenza Artificiale &#8211; Invio Lavori \ud83d\udccb Requisiti [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nf_dc_page":"","footnotes":""},"class_list":["post-3934","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/pages\/3934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/comments?post=3934"}],"version-history":[{"count":8,"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/pages\/3934\/revisions"}],"predecessor-version":[{"id":4505,"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/pages\/3934\/revisions\/4505"}],"wp:attachment":[{"href":"https:\/\/www.marenia.net\/raffaelecardone\/wp-json\/wp\/v2\/media?parent=3934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}