{"id":2306,"date":"2024-10-17T17:39:34","date_gmt":"2024-10-17T22:39:34","guid":{"rendered":"https:\/\/atleticonortefc.com\/?page_id=2306"},"modified":"2024-10-17T18:54:29","modified_gmt":"2024-10-17T23:54:29","slug":"sorteo","status":"publish","type":"page","link":"https:\/\/atleticonortefc.com\/index.php\/sorteo\/","title":{"rendered":"Sorteo"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"es\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Sorteo de Jugadores<\/title>\n<\/head>\n<body>\n    <h1>Sorteo de Jugadores<\/h1>\n\n    <!-- Ingresar la cantidad de equipos -->\n    <form id=\"teamForm\">\n        <label for=\"teams\">Cantidad de equipos:<\/label>\n        <input type=\"number\" id=\"teams\" name=\"teams\" min=\"1\" required>\n        <button type=\"submit\">Seleccionar<\/button>\n    <\/form>\n\n    <br>\n\n    <!-- Subir archivo de jugadores -->\n    <form id=\"uploadForm\" enctype=\"multipart\/form-data\" style=\"display:none;\">\n        <h2>Subir archivo de jugadores<\/h2>\n        <input type=\"file\" name=\"file\" accept=\".csv,.xlsx\" required>\n        <button type=\"submit\">Subir archivo<\/button>\n    <\/form>\n\n    <script>\n        let teams;\n\n        \/\/ Cuando se selecciona la cantidad de equipos\n        document.getElementById('teamForm').addEventListener('submit', function(event) {\n            event.preventDefault();\n            teams = document.getElementById('teams').value;\n            document.getElementById('uploadForm').style.display = 'block'; \/\/ Mostrar el formulario de subida de jugadores\n        });\n\n        \/\/ Cuando se sube el archivo de jugadores\n        document.getElementById('uploadForm').addEventListener('submit', function(event) {\n            event.preventDefault();\n            const formData = new FormData(this);\n            formData.append('teams', teams); \/\/ A\u00f1adir la cantidad de equipos\n\n            fetch('\/upload', {\n                method: 'POST',\n                body: formData\n            }).then(response => response.json()).then(data => {\n                alert(data.message);\n            }).catch(error => console.error('Error:', error));\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Sorteo de Jugadores Sorteo de Jugadores Cantidad de equipos: Seleccionar Subir archivo de jugadores Subir archivo<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2306","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/pages\/2306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/comments?post=2306"}],"version-history":[{"count":7,"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/pages\/2306\/revisions"}],"predecessor-version":[{"id":2315,"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/pages\/2306\/revisions\/2315"}],"wp:attachment":[{"href":"https:\/\/atleticonortefc.com\/index.php\/wp-json\/wp\/v2\/media?parent=2306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}