-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathasistencias.php
42 lines (37 loc) · 1.07 KB
/
asistencias.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
session_start();
require_once("gestionBD.php");
$conexion = crearConexionBD();
if (isset($_GET)) {
$id = $_GET["id"];
if ($_GET["table"] == "reuniones") {
$query = "SELECT nombre, apellidos FROM ASISTENCIAS NATURAL JOIN ATLETAS WHERE idReunion=:id";
} else {
$query = "SELECT nombre, apellidos FROM RESULTADOS NATURAL JOIN ATLETAS WHERE idCompeticion=:id";
}
try {
$stmt = $conexion->prepare($query);
$stmt->bindParam(':id', $id);
$stmt->execute();
$result = $stmt->fetchAll();
} catch (PDOException $e) {
echo $e;
$result = null;
}
if ($result != null) {
echo "<table>
<tr>
<th>Atleta</th>
</tr>";
foreach ($result as $atleta) {
echo "<tr>";
echo "<td>" . $atleta["NOMBRE"] . " " . $atleta["APELLIDOS"] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<p> NO HAY PARTICIPANTES </p>";
}
}
cerrarConexionBD($conexion);
unset($_GET["id"]);