The Playground system provides comprehensive data export capabilities, allowing administrators to extract schedules, reports, and analytics in various formats for external use, backup, and integration with other systems.
function exportarExcel() { var table = document.getElementById("Table"); var wb = XLSX.utils.table_to_book(table); var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'binary' }); function s2ab(s) { var buf = new ArrayBuffer(s.length); var view = new Uint8Array(buf); for (var i = 0; i < s.length; i++) { view[i] = s.charCodeAt(i) & 0xFF; } return buf; } saveAs( new Blob([s2ab(wbout)], { type: "application/octet-stream" }), "Horarios.xlsx" ); cerrarModal();}
1
Open Export Modal
Click the export button to open the format selection modal
2
Select Excel Format
Choose the Excel export option from the modal
3
Download File
The file “Horarios.xlsx” will be downloaded automatically
4
Open in Excel
Open the downloaded file in Microsoft Excel or compatible software
async function exportarIcs() { var nombreAsesor = document.getElementById('AsesorActual').textContent; var prefijo = "Bienvenido/a "; if (nombreAsesor.startsWith(prefijo)) { nombreAsesor = nombreAsesor.substring(prefijo.length); } // Query shift schedules from Firebase var horariosTurnos = {}; var turnosRef = firebase.database().ref('Turnos/'); const snapshot = await turnosRef.once('value'); if (snapshot.exists()) { const turnosData = snapshot.val(); for (const turno in turnosData) { const apertura = turnosData[turno]?.Apertura; const cierre = turnosData[turno]?.Cierre; if (apertura && cierre) { if (apertura === "12:00 AM" && cierre === "12:00 AM") { horariosTurnos[turno] = "Todo el día"; } else { horariosTurnos[turno] = `${apertura} - ${cierre}`; } } } } var cal = ics(); var table = document.getElementById('Table'); // Generate calendar events for (var i = 1, row; row = table.rows[i]; i++) { var nombre = row.cells[0].innerText; if (nombre === nombreAsesor) { for (var j = 1, cell; cell = row.cells[j]; j++) { var turno = cell.innerText.trim(); if (turno === "D") { // Day off event var fecha = new Date(año, mes, j); var start = new Date(fecha.setHours(0, 0, 0)); var end = new Date(fecha.setHours(23, 59, 59)); cal.addEvent( 'Descanso', `Día de descanso para ${nombreAsesor}`, 'Casa', start, end ); } else if (horariosTurnos[turno]) { var horario = horariosTurnos[turno]; if (horario === "Todo el día") { var fecha = new Date(año, mes, j); var start = new Date(fecha.setHours(0, 0, 0)); var end = new Date(fecha.setHours(23, 59, 59)); cal.addEvent( `Turno ${turno}`, `Turno ${turno} para ${nombreAsesor} (Todo el día)`, 'Arus', start, end ); } else if (horario.includes(" - ")) { var fecha = new Date(año, mes, j); var [horaInicio, horaFin] = horario.split(" - "); horaInicio = convertTo24Hour(horaInicio); horaFin = convertTo24Hour(horaFin); var [horaInicioH, horaInicioM] = horaInicio.split(':'); var [horaFinH, horaFinM] = horaFin.split(':'); var start = new Date(fecha.setHours(horaInicioH, horaInicioM)); var end = new Date(fecha.setHours(horaFinH, horaFinM)); cal.addEvent( `Turno ${turno}`, `Turno ${turno} para ${nombreAsesor}`, 'Arus', start, end ); } } } break; } } cal.download(`${nombreAsesor}_horarios`);}
async function ExportaraTexto() { var nombreAsesorActual = localStorage.getItem("nombreAsesorActual"); if (!nombreAsesorActual) { alert("Por favor seleccione un asesor para exportar los datos"); return; } nombreAsesorActual = nombreAsesorActual.replace(/_/g, " "); let texto = ""; var meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]; var mes = document.getElementById("Mes").value; var numeroMes = meses.indexOf(mes); var ano = document.getElementById("Año").value; texto += "Turnos de " + nombreAsesorActual + " en " + mes + ":" + "\n\n"; var tabla = document.getElementById("Table"); var filas = tabla.getElementsByTagName("tr"); var filaAsesor = null; for (var i = 0; i < filas.length; i++) { var celdas = filas[i].getElementsByTagName("td"); if (celdas.length > 0 && celdas[0].textContent === nombreAsesorActual) { filaAsesor = filas[i]; break; } } var celdasDias = filaAsesor.getElementsByTagName("td"); var diasSemana = ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]; for (let i = 1; i <= 31; i++) { var turno = celdasDias[i].textContent.trim(); var dia = i; var fecha = new Date(ano, numeroMes, dia); var diaSemana = diasSemana[fecha.getDay()]; var turnoRef = firebase.database().ref('Turnos/' + turno); var snapshot = await turnoRef.once('value'); var apertura = snapshot.child('Apertura').val(); var cierre = snapshot.child('Cierre').val(); if (apertura === "12:00 AM" || cierre === "12:00 AM") { var descripcion = snapshot.child('Descripcion').val(); texto += `${diaSemana} ${dia}: (${turno}) ${descripcion}\n`; } else { var horario = apertura + " - " + cierre; texto += `${diaSemana} ${dia}: (${turno}) ${horario}\n`; } } await navigator.clipboard.writeText(texto); alert("Datos copiados al portapapeles");}