%- include('header.html', { pageTitle, extraStyles, extraScripts }) %> <% function formatDateLong(date){ if(!date){ date = new Date()} let sdate = date.toLocaleDateString('es-MX', { year: 'numeric', month: 'long', day: 'numeric' }); return sdate } function formatDate(date){ if(!date){ date = new Date()} let sdate = date.toLocaleDateString('es-MX', { year: 'numeric', month: 'short', day: 'numeric' }); return sdate.toUpperCase() } function formatTime(time){ let hh = time.substr(0,2) let mm = time.substr(3,2) let am = parseInt(hh) > 11 ? 'pm' : 'am' let hr = parseInt(hh) hr = hr > 12 ? hr-12 : hr return `${hr.toString().padStart(2,'0')}:${mm} ${am}` } function getAge(date){ const diff = Date.now() - new Date(date).getTime(); const ageDate = new Date(diff); return Math.abs(ageDate.getUTCFullYear() - 1970); } function onlyDate(date=null){ if(!date){ return new Date().toJSON().substr(0,10) } return date.toJSON().substr(0,10) } function getPoints(sport, pickle, padel, beach){ switch(sport){ case 'pickleball': return pickle; case 'padel': return padel; case 'beach_tennis': return beach; default: return 0; } } function getPhase(phase){ const phases = { 'group': 'Fase de Grupos', 'round_of_64': 'Ronda de 64', 'round_of_32': 'Ronda de 32', 'round_of_16': 'Ronda de 16', 'round_of_8': 'Ronda de 8', 'quarter': 'Cuartos de Final', 'semi': 'Semifinal', 'final': 'Final' } return phases[phase] || 'Eliminatorias' } %>
No hay canchas registradas
<% } else { %> <% courts.forEach(function(court) { %>| Nombre | Cédula | Edad | Sexo | Nivel | Puntos | Categoría | Pago | |
|---|---|---|---|---|---|---|---|---|
| <%= p.name %> | <%= p.legal_id %> | <%= getAge(p.date_of_birth) %> | <%= p.sex %> | <%= p.category %> | <%= getPoints(tournament.sport, p.points_pickle, p.points_padel, p.points_beach) %> | <%= p.catname %> | <%= p.exempt ? '---' : (p.payment1+p.payment2+p.payment3+p.payment4) %> | |
| Total Recaudado | <%=paytotal%> | |||||||
No hay equipos registrados
<% } else { %> <% teams.forEach(function(team) { %>No hay fases definidas
<% } else { %> <% phases.forEach(function(phase) { %>No hay partidos en esta fase
| Fecha | Cancha | Equipo 1 | Equipo 2 | Resultado | Estado | |
|---|---|---|---|---|---|---|
|
<%=formatDate(match.scheduled_date)%> <%=formatTime(match.scheduled_time || '17:00')%> |
<%=match.court_name%> |
<%= match.team1_name || 'TBD' %> <%=match.team1_player1%> / <%=match.team1_player2%> |
<%= match.team2_name || 'TBD' %> <%=match.team2_player1%> / <%=match.team2_player2%> |
<% if (match.status === 'finalizado') { %> <%= match.team1_score %> - <%= match.team2_score %> <% } else { %> - <% } %> | <%= match.status %> |
No hay datos en la tabla de posiciones
| # | Grupo | Equipo | Ganados | Perdidos | Sets-G | Sets-P | Puntos-G | Puntos-P |
|---|---|---|---|---|---|---|---|---|
| <%= entry.rank %> | <%= entry.group_name || '-' %> | <%= entry.team_name %> <%=entry.name1%> / <%=entry.name2%> |
<%= entry.wins %> | <%= entry.losses %> | <%= entry.sets_won %> | <%= entry.sets_lost %> | <%= entry.points_for %> | <%= entry.points_against %> |