|
|
|
@ -1,5 +1,36 @@ |
|
|
|
|
|
|
|
|
|
|
|
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('<h1>teste html</h1>') |
|
|
|
|
|
|
|
_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;">') |
|
|
|
_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 (const dbRecord of dbRecords) { |
|
|
|
|
|
|
|
_out.println('<tr style="height: 35px;">') |
|
|
|
_out.println(`<td>${dbRecord.getString("titulo")}</td>`) |
|
|
|
_out.println(`<td>${dbRecord.getString("data")}</td>`) |
|
|
|
_out.println(`<td>${dbRecord.getInt("capacidade")}</td>`) |
|
|
|
_out.println(`<td>${dbRecord.getDouble("preco")}</td>`) |
|
|
|
_out.println(`<td>${dbRecord.getString("categoria")}</td>`) |
|
|
|
_out.println('</tr>') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_out.println('</table>') |
|
|
|
_out.println('</div>') |
|
|
|
_out.println('</div>') |