-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv_miHistorial.php
More file actions
174 lines (131 loc) · 6.78 KB
/
v_miHistorial.php
File metadata and controls
174 lines (131 loc) · 6.78 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
@session_start();
require_once '../funciones/sesion.php';
require_once '../controladores/c_usuario.php';
require_once '../controladores/c_tabla.php';
$result = c_usuario::getHistorialDeportistas();
if(isset($_SESSION['userID']) && $_SESSION['userType'] == 'Deportista' && $_SESSION['connected'] == true){
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>GYM-APP</title>
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/navbar2.css" rel="stylesheet">
<link href="../css/botonesGestionar.css" rel="stylesheet">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="../js/bootstrap.min.js"></script>
</head>
<body>
<header>
<!-- DEBE IR BARRA DE NAVEGACION -->
<nav class="navbar navbar-default1">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--EN LA IMAGEN METER A HREF A LA PAG INICIAL DEL ADMIN.-->
<a class="navbar-brand" href="#"><img src="../images/navbar-footer/tiburonlogo.png" style="margin-top:-10px;"></img></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="margin-top: 3px;">
<ul class="nav navbar-nav">
<li class="current"><a href="../vistas/v_deportista.php">Principal</a></li>
<li><a href="../vistas/v_gestionarActividades.php">Actividades</a></li>
<li><a href="../vistas/v_misActividades.php">Mis actividades</a></li>
<li><a href="../vistas/v_misTablas.php">Mis tablas</a></li>
<li><a href="../vistas/v_miHistorial.php">Mi Historial</a></li>
<li><a href="../vistas/v_verPerfil.php" id="botonPerfil"><span class="glyphicon glyphicon-user" aria-hidden="true" style="margin-right: 5px;"></span>Ver Perfil</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<div class="form-group">
<button id="modalButton" type="button" class="btn btn-default1" data-toggle="modal" data-target=".bs-example-modal-sm" style="margin-left: 10px;">Cerrar Sesión</button>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content" id="modalLogin">
<div class="modal-header">
<h4 style="text-align: center; color:white;" class="modal-title">Cerrar Sesión</h4>
</div>
<div class="text-center">
<p style="text-align: center; margin-top: 20px;"><img src="../images/navbar-footer/tiburon2.png"></img></p>
<button type="submit" class="btn btn-default1" id="botonModificar" style="margin-bottom: 10px;" value="Confirmar" onclick = "location='../funciones/cerrar.php'">Cerrar Sesión</button>
</div>
</div>
</div>
</div>
</div>
</ul>
</nav>
</header>
<div class="container">
<!-- --------------------------- ----------------EDITAR TODALA VISTA DENTRO DE ESTE DIV ----------------------- -->
<p style="font-size: -webkit-xxx-large;" id="actividades">Mi Historial de entrenamiento</p>
<div class="table-responsive col-xs-12 col-sm-12 col-md-12 col-lg-12">
<table class="table table-striped">
<thead> <!-- CABECERA DE LA TABLA -->
<tr>
<th><b>Nombre tabla</b></th><!-- EN LA TABLA SOLO QUEREMOS QUE EN LA CABECERA SALGA EL NOMBRE DE ACTIVIDAD
LOS BOTONES SE PUEDEN METES A MAYORES SIN TENER CABECERA PROPIA -->
<th><b>Fecha entrenamiento</b></th>
<th><b>Ejercicios completados</b></th>
</tr>
</thead>
<form id="eliminar" action="../controladores/c_usuario.php?var=6#" method="post">
<input type="hidden" name="submit" value="submit">
</form>
<div class="btn-group col-xs-6 col-sm-4 col-md-4 col-lg-2" role="group" style="margin-top: 10px; margin-bottom: 15px;">
<a href="v_modificarDatos.php" style="text-decoration: none;"><button form="eliminar" type="submit" class="btn btn-default2" id="botonAtras"><span style="margin-right: 5px;"></spanS>Eliminar Historial</button></a>
</div>
<tbody>
<?php
foreach ($result as $reg) {//LA VARIABLE $REG GUARDA LOS REGISTROS devolverDatosTablaDE LA CONSULTA REALIZADA
?>
<tr>
<?php $aux=c_tabla::devolverDatosTabla($reg["Tabla_IDTabla"]); ?>
<td><?php echo $aux['nombre'];?></td>
<td><?php echo date("d-m-Y H:i:s",strtotime($reg['Fecha'])); //Muestra la fecha con formato especificado?></td>
<td><?php echo $reg['NEjercicios']; ?></td>
</tr>
</body>
</html>
<?php
}
}
else
{
if(isset($_SESSION['userID']) && $_SESSION['connected'] == true && $_SESSION['userType'] == 'Administrador')
{
echo "<script>";
echo "alert('No tienes permisos para entrar en esta pagina');";
echo "window.location = '../vistas/v_administrador.php'";
echo "</script>";
exit();
} else{
if(isset($_SESSION['userID']) && $_SESSION['connected'] == true && $_SESSION['userType'] == 'Entrenador')
{
echo "<script>";
echo "alert('No tienes permisos para entrar en esta pagina');";
echo "window.location = '../vistas/v_entrenador.php'";
echo "</script>";
exit();
} else {
// Usuario que no se ha logueado
echo "<script>";
echo "alert('No tienes permisos para entrar en esta pagina');";
echo "window.location = '../vistas/v_principal.php'";
echo "</script>";
exit();
}
}
}
?>