/
usuarios.php
122 lines (103 loc) · 3.48 KB
/
usuarios.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
<?php
include_once 'dbMySql.php';
$con = new DB_con();
$table = "users";
$res=$con->select($table);
if (isset($_POST['eliminar'])) {
$id=$_POST['id'];
$res=$con->delete($id);
if ($res) {
?>
<script>
alert('Exito al eliminar');
window.location='usuarios.php'
</script>
<?php
}
else{
?>
<script>
alert('Error al eliminar');
window.location='usuarios.php'
</script>
<?php
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Data</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<?php include ("navbar.php"); ?>
<center>
<div id="content" style=" margin-top:60px; float:left; width:80%;">
<table align="center">
<tr>
<th class="title_usuarios" colspan="9">LISTA DE USUARIOS</th>
</tr>
<tr>
<th class="title">Nombre</th>
<th class="title"> Apellido</th>
<th class="title">Email</th>
<th class="title">Lugar</th>
<th class="title" colspan="2">Coordenadas</th>
<th class="title">Imagen</th>
<th class="title" colspan="2">Opciones</th>
</tr>
<?php
while($row=mysql_fetch_row($res))
{
?>
<tr>
<td><?php echo $row[1]; ?></td>
<td><?php echo $row[2]; ?></td>
<td><?php echo $row[3]; ?></td>
<td><?php echo $row[4]; ?></td>
<td><?php echo $row[5]; ?></td>
<td><?php echo $row[6]; ?></td>
<td><img src="imagenes/<?php echo $row[7]; ?>" alt="image" class="imagen"></td>
<td>
<form action="modificar.php" method="post">
<input type="hidden" name="id" value="<?php echo $row[0]; ?>">
<input type="hidden" name="nombre" value="<?php echo $row[1]; ?>">
<input type="hidden" name="apellido" value="<?php echo $row[2]; ?>">
<input type="hidden" name="email" value="<?php echo $row[3]; ?>">
<input type="hidden" name="lugar" value="<?php echo $row[4]; ?>">
<input type="hidden" name="coordenada_x" value="<?php echo $row[5]; ?>">
<input type="hidden" name="coordenada_y" value="<?php echo $row[6]; ?>">
<input type="hidden" name="imagen" value="<?php echo $row[7]; ?>">
<input class="update_delete" type="submit" value="Modificar" name="modificar">
</form>
</td>
<td>
<form action="usuarios.php" method="post">
<input type="hidden" name="id" value="<?php echo $row[0]; ?>">
<input class="update_delete" type="submit" value="Eliminar" name="eliminar">
</form>
</td>
</tr>
<?php
}
?>
</table>
<a href="add_data.php">
<button type="submit"><strong>INGRESAR NUEVO</strong></button>
</a>
</div>
</div>
</center>
<div style="width:100%; float:left;">
<?php include ("footer.php"); ?>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>