-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservidor21.php
41 lines (33 loc) · 1.37 KB
/
servidor21.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
<?php
require "conexion.php";
$personas = $_GET['personas'];
$nombre_id = "nombre_id";
$correo_id = "correo_id";
$actualizar = "actualizar";
$borrar = "borrar";
if ($personas === "personas") {
$resultado = mysqli_query($conexion, "SELECT * FROM personas;");
$table = "";
$table .= '<table class = "table table-striped table-bordered">';
$table .= '<tr>';
$table .= '<th>#</th>';
$table .= '<th>Nombre</th>';
$table .= '<th>Correo</th>';
$table .= '<th>Editar Usuario</th>';
$table .= '<th>Borrar Usuario</th>';
$table .= '</tr>';
while ($fila = mysqli_fetch_assoc($resultado)) {
$table .= '<tr>';
$table .= '<td>'.$fila['id'].'</td>';
$table .= '<td id="'.$nombre_id.$fila['id'].'">'.$fila['nombre'].'</td>';
$table .= '<td id="'.$correo_id.$fila['id'].'">'.$fila['correo'].'</td>';
$table .= '<td ><input id="'.$fila['id'].'" onclick = "editar_usuario(this.id)" type = "button" value = "Editar" class = "btn btn-default"></td>';
$table .= '<td ><input id="'.$borrar.$fila['id'].'" type = "button" value = "Borrar" class = "btn btn-danger"></td>';
$table .= '<td ><input id="'.$actualizar.$fila['id'].'" type = "button" value = "Actualizar" class = "btn btn-primary" style="display: none;"></td>';
$table .= '</tr>';
}
}
$table .= '</table>';
echo $table;
mysqli_close($conexion);
?>