<?php
	echo '<?xml version="1.0" encoding="utf-8"?>';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>

	<title>XHTML 1.0 STRICT TEMPLATE</title>

	<link rel="stylesheet" type="text/css" href="estilo.css" 
		  media="screen,projection" 
		  />
</head>

<body>

<h1> Cursos del GUL </h1>

<table>


<?php

require_once("Database.php");

$consulta = "select * from cursos";

Database::initialize();
$respuesta = Database::query($consulta);

foreach($respuesta as $row)
{
	$id = $row["id"];
	$name = $row["Titulo"];
	$speaker = $row["Dificultad"];

	echo "
		<tr>
			<td> $id </td> 
			<td> $name </td>
			<td> $speaker </td>
			<td> <a href='votar.php?id=$id'> Votar! </a> </td>
		</tr>
	";
}

?>

</table>

</body>

</html>
