-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusuarios.php
114 lines (82 loc) · 3.08 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>NutriFit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="css/style.css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="js/index.js"></script>
</head>
<header class="header">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">NutriFit</a>
</div>
<ul >
<li><a href="home.html">Home <span class="sr-only">(current)</span></a></li>
<li class="active" ><a href="#">Usuarios</a></li>
<li><a href="dietas.php">Dietas</a></li>
<li><a href="rutinas.php">Rutinas</a></li>
</ul>
</div>
</nav>
</header>
<body>
<div class="cuerpo">
<h1>Usuarios</h1>
<?php
$dbhost = "localhost";
$dbuser = "codelink";
$dbpass = "Martinn1.";
$db = "nutrifit";
// Create connection
$conn = new mysqli($dbhost, $dbuser, $dbpass, $db);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$id = $_GET['id'];
$query = "SELECT * FROM `usuarios` WHERE tipo='User';";
$result = $conn->query($query);
if ($result->num_rows > 0) {
?>
<ul class="list-group">
<?php
while($row = $result->fetch_assoc()) {
?>
<a href="<?php echo "usuario.php?id={$row['id']}"?>"><li class="list-group-item"> <?php echo $row['nombre']?></li></a><br>
<?php
}
?>
</ul>
<?php
}
$conn->close();
?>
</div>
<div class="formulario">
<form action="/api/add_datos.php">
<label for="id">ID del usuario</label>
<input type="number" id="id_user" name="id_user">
<label for="cintura">Cintura</label>
<input type="text" id="cintura" name="cintura">
<label for="abdomen">Abdomen</label>
<input type="text" id="abdomen" name="abdomen">
<label for="peso">Peso</label>
<input type="text" id="peso" name="peso">
<label for="estatura">Estatura</label>
<input type="text" id="estatura" name="estatura">
<label for="grasa">Grasa</label>
<input type="text" id="grasa" name="grasa">
<label for="masa_muscular">Masa muscular</label>
<input type="text" id="masa_muscular" name="masa_muscular">
<button type="submit" >Submit</button>
</form>
</div>
</body>
</html>