|
|
|
|
|
|
|
|
const dbRecords = _db.query(`
|
|
|
SELECT evento.titulo, evento.data, evento.capacidade,
|
|
|
evento.preco, categoria_evento.nome AS categoria
|
|
|
FROM evento JOIN categoria_evento ON evento.id_categoria = categoria_evento.id
|
|
|
`);
|
|
|
|
|
|
|
|
|
_out.println('<div style="display: flex; justify-content: center; margin-top: 80px; min-height: 585px;">')
|
|
|
_out.println('<div>')
|
|
|
_out.println('<caption><a style="display: flex; justify-content: center; font-weight: bold; font-size: 25px; margin-bottom: 10px;">Eventos</a></caption>')
|
|
|
_out.println('<table style="min-width: 700px; text-align: left;">')
|
|
|
_out.println('<tr style="height: 35px;">')
|
|
|
_out.println('<th>Título</th>')
|
|
|
_out.println('<th>Data</th>')
|
|
|
_out.println('<th>Capacidade</th>')
|
|
|
_out.println('<th>Preço</th>')
|
|
|
_out.println('<th>Categoria</th>')
|
|
|
_out.println('</tr>')
|
|
|
|
|
|
for (let i = 0; i < dbRecords.length; i++) {
|
|
|
|
|
|
_out.println('<tr style="height: 35px;">')
|
|
|
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("titulo")}</td>`)
|
|
|
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("data")}</td>`)
|
|
|
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getInt("capacidade")}</td>`)
|
|
|
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getDouble("preco")}</td>`)
|
|
|
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("categoria")}</td>`)
|
|
|
_out.println('</tr>')
|
|
|
}
|
|
|
|
|
|
|
|
|
_out.println('</table>')
|
|
|
_out.println('</div>')
|
|
|
_out.println('</div>')
|