-
Notifications
You must be signed in to change notification settings - Fork 1
/
ctClients.php
316 lines (302 loc) · 14 KB
/
ctClients.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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE HTML>
<?php include "php/AuthenticationAdmin.php";?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Spinning Fit Web</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<!-- Facebook and Twitter integration -->
<meta property="og:title" content=""/>
<meta property="og:image" content=""/>
<meta property="og:url" content=""/>
<meta property="og:site_name" content=""/>
<meta property="og:description" content=""/>
<meta name="twitter:title" content="" />
<meta name="twitter:image" content="" />
<meta name="twitter:url" content="" />
<meta name="twitter:card" content="" />
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,700,900" rel="stylesheet">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/icomoon.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/flexslider.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
<link rel="stylesheet" href="fonts/flaticon/font/flaticon.css">
<link rel="stylesheet" type="text/css" href="css/pushbar.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/fontello.css">
<link rel="shortcut icon" type="image/x-icon" href="images/LOGO.png">
<script src="js/modernizr-2.6.2.min.js"></script>
</head>
<body>
<div class="colorlib-loader"></div>
<?php if (isset($_GET["repetidos"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("Los datos de usuario y correo ya estan registrados en otras cuentas, por favor elija otros."); };
</script>
<?php } ?>
<?php if (isset($_GET["errorusuario"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("Este nombre de usuario ya existe, por favor escoja otro."); };
</script>
<?php } ?>
<?php if (isset($_GET["errorcorreo"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("Este correo ya ha sido ingresado, por favor ingrese otro."); };
</script>
<?php } ?>
<?php if (isset($_GET["errorcontra"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("Las contraseñas no coinciden."); };
</script>
<?php } ?>
<?php if (isset($_GET["editado"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("Las datos se han cambiado correctamente."); };
</script>
<?php } ?>
<?php if (isset($_GET["error"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("A ocurrido un error al intentar realizar esta acción:\n\n <?php echo $_GET['m'] ?>"); };
</script>
<?php } ?>
<?php if (isset($_GET["eliminado"])){ ?>
<script type="text/javascript">
window.onload = function(){ window.alert("El registro ha sido eliminado."); };
</script>
<?php } ?>
<div id="page">
<nav class="colorlib-nav" role="navigation" style="background: #25282a;">
<div class="top-menu">
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="colorlib-logo"><a href="index.php">Spinning Fit</a></div>
</div>
<div class="col-md-9 text-center menu-1">
<ul>
<li><a href="index.php">Inicio</a></li>
<li><a href="schedule.html">Horarios</a></li>
<li><a href="trainers.html">Instructores</a></li>
<li><a href="info.html">Acerca de</a></li>
<li><a href="contact.html">Contacto</a></li>
<?php include "php/SessionButtons.php"; ?>
</ul>
</div>
</div>
</div>
</div>
<?php include "php/UserMenus.php"; ?>
</nav>
<div id="colorlib-main" style="background-image: url(images/img_bg_5.jpg);" data-stellar-background-ratio="0.5">
<div class="container-fluid">
<div class="row">
<div class="col-12 mt-5 bg-white rounded">
<div class="mt-5 text-center colorlib-heading animate-box">
<!-- CABECERA DE CATALOGO -->
<div class="row mb-3">
<h3 class="text-dark font-weight-bold mx-3 my-auto col-auto">Alumnos</h3>
<form action="" method="GET" class="form-inline my-2 col-auto m-auto">
<input class="form-control mr-sm-2" placeholder="Buscar" type="text" name="buscar">
<button class="btn btn-outline-primary my-2" type="submit"><i class="icon-search2 mx-2"></i></button>
</form>
<a class="btn btn-success my-auto ml-auto mr-3 text-white" href="registration.php">
Agregar registro
</a>
</div>
<?php
$re2 = $mysqli->query("SELECT * FROM `alumno`");
$cantidad_resultados = 15;
if (isset($_GET["page"]) && is_numeric($_GET["page"])) {
if ($_GET["page"] != 1) {
$pagina = $_GET["page"];
} else {
$pagina = 1;
}
} else {
$pagina = 1;
}
$empieza = ($pagina-1) * $cantidad_resultados;
$total_registros = mysqli_num_rows($re2);
$total_paginas = ceil($total_registros / $cantidad_resultados);
if(isset($_GET['buscar'])){
$re = $mysqli->query("SELECT * FROM alumno WHERE `usuario_alumno` LIKE '%".$_GET['buscar']."%' ORDER BY `idalumno` ASC LIMIT $empieza, $cantidad_resultados");
} else {
$re = $mysqli->query("SELECT * FROM alumno ORDER BY `idalumno` ASC LIMIT $empieza, $cantidad_resultados");
}
if ((mysqli_num_rows($re))!=0) {
?>
<!-- TABLA DE REGISTROS -->
<table class="table table-striped table-bordered table-sm table-hover">
<thead class="thead-dark bg-dark text-white">
<th class="text-center col-auto">ID</th>
<th class="text-center col-auto">Usuario</th>
<th class="text-center col-auto">Nombre</th>
<th class="text-center col-auto">Apellido</th>
<th class="text-center col-auto">Dirección</th>
<th class="text-center col-auto">Correo</th>
<th class="text-center col-auto">telefono</th>
<th class="text-center col-auto">Editar</th>
<th class="text-center col-auto">Eliminar</th>
</thead>
<?php
while ($f=mysqli_fetch_array($re)) {
?>
<tr>
<td class="text-center"><?php echo $f['idalumno']; ?></td>
<td class="text-center"><?php echo $f['usuario_alumno']; ?></td>
<td class="text-center"><?php echo $f['nombre_alumno']; ?></td>
<td class="text-center"><?php echo $f['apellido_alumno']; ?></td>
<td class="text-center"><?php echo $f['direccion_alumno']; ?></td>
<td class="text-center"><?php echo $f['correo_alumno']; ?></td>
<td class="text-center"><?php echo $f['telefono_alumno']; ?></td>
<td class="text-center">
<form action="EditClients.php" method="POST">
<button type="submit" class="btn btn-info btn-sm" name="id" value="<?php echo $f['idalumno']; ?>">
<i class="icon-edit" aria-hidden="true"></i>
</button>
</form>
</td>
<td class="text-center">
<form action="php/DeleteClient.php" method="POST">
<button type="submit" class="btn btn-danger btn-sm" name="id" value="<?php echo $f['idalumno']; ?>">
<i class="icon-trash" aria-hidden="true"></i>
</button>
</form>
</td>
</tr>
<?php
}
?>
</table>
<!-- PAGINACION -->
<nav class="mt-4" aria-label="Page navigation example">
<ul class="pagination justify-content-center">
<li class="page-item <?php if($pagina==1){ echo "disabled";} ?>">
<a class="page-link" href="?page=<?php echo ($pagina-1); ?>" tabindex="-1"><i class="icon-arrow-left2"></i></a>
</li>
<?php
if ($pagina<4) {
$i = 1;
} else {
$i = $pagina-2;
}
if ($total_paginas<=5) {
$Muestra_paginas = $total_paginas;
} else {
if ($pagina==1 || $pagina==2) {
$Muestra_paginas = 5;
} elseif ($pagina==($total_paginas-1)) {
$Muestra_paginas = $pagina+1;
$i = $pagina-3;
} elseif ($pagina==$total_paginas) {
$Muestra_paginas = $pagina;
$i = $pagina-4;
} else {
$Muestra_paginas = $pagina+2;
}
}
for ($i; $i<=$Muestra_paginas; $i++) {
print '<li class="page-item ';
if($pagina==$i){print 'disabled';}
echo '"><a class="page-link" href="?page='.$i.'">'.$i.'</a></li>';
};
?>
<li class="page-item <?php if($pagina==$total_paginas){ echo "disabled";} ?>">
<a class="page-link" href="?page=<?php echo ($pagina+1); ?>""><i class="icon-arrow-right2"></i></a>
</li>
</ul>
</nav>
<?php
} else {
echo "<div class='col-12 m-5'><center><strong>No hay registros</strong></center></div>";
}
?>
</div>
</div>
</div>
</div>
</div>
<footer id="colorlib-footer">
<div class="container">
<div class="row row-pb-md">
<div class="col-md-3 colorlib-widget">
<h4>Acerca de Spinning Fit </h4>
<!-- Cambiar el siguiente texto -->
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur minima nam soluta provident numquam. Aspernatur laborum aliquid, esse accusamus libero asperiores, nemo nobis excepturi quas veniam commodi at eaque quidem.</p>
<p>
<ul class="colorlib-social-icons">
<!-- Agregar enlaces a redes sociales, o dejar en blanco -->
<li><a href="#"><i class="icon-twitter"></i></a></li>
<li><a href="#"><i class="icon-facebook"></i></a></li>
<li><a href="#"><i class="icon-linkedin"></i></a></li>
<li><a href="#"><i class="icon-dribbble"></i></a></li>
</ul>
</p>
</div>
<div class="col-md-3 colorlib-widget">
<h4>Links</h4>
<p>
<ul class="colorlib-footer-links">
<li><a href="info.html"><i class="icon-check"></i> Acerca de</a></li>
<li><a href="schedule.html"><i class="icon-check"></i> Horarios</a></li>
<li><a href="trainers.html"><i class="icon-check"></i> Instructores</a></li>
<li><a href="contact.html"><i class="icon-check"></i> Contacto</a></li>
</ul>
</p>
</div>
<div class="col-md-3 colorlib-widget">
<h4>Info de contacto</h4>
<ul class="colorlib-footer-links">
<li>Calle Hidalgo #910-Col. concordia Santa Catarina<br> CP. 66168- Local #906 </li>
<li><a href="tel://1234567920"><i class="icon-phone"></i> + 1235 2355 98</a></li>
<!-- Agregar un correo de contacto -->
<li><a href="mailto:[email protected]"><i class="icon-envelope"></i> [email protected]</a></li>
<li><a href="http://luxehotel.com"><i class="icon-location4"></i> spinningfitweb.com</a></li>
</ul>
</div>
</div>
</div>
<div class="copy">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<p>
<small class="block">©
Copyright ©<script>document.write(new Date().getFullYear());</script> All rights reserved
</p>
</div>
</div>
</div>
</div>
</footer>
<div class="gototop js-top">
<a href="#" class="js-gotop"><i class="icon-up-big"></i></a>
</div>
<?php include "php/UserMenus2.php"; ?>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.waypoints.min.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script src="js/jquery.flexslider-min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/magnific-popup-options.js"></script>
<script src="js/jquery.countTo.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript" src="js/pushbar.js"></script>
<script type="text/javascript">
var pushbar = new Pushbar({
blur:true,
overlay:true,
});
</script>
</body>
</html>