-
Notifications
You must be signed in to change notification settings - Fork 1
/
progreso.php
103 lines (91 loc) · 4.81 KB
/
progreso.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title>MotoFitness</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div class="container">
<nav class='navbar navbar-light bg-light row'>
<?php
session_start();
include "daoMySQL.php";
if ($_SESSION['resLogin'] == "cliente" || $_SESSION['resLogin'] == "empleado") {
$plan = getPlan($_SESSION['dni']);
if ($plan != null && ($plan == "pro" || $plan == "entrenamiento")) {
$linktabla = "<a class='navbar-brand' href='tablas.php'>Tabla de ejercicios</a>";
} else {
$linktabla = "";
}
print("
<a class='navbar-brand' href='index.php'>Inicio</a>
<a class='navbar-brand' href='resumen.php'>Resumen</a>");
if ($_SESSION['resLogin'] == "cliente") {
print("<a class='navbar-brand' href='dietas.php'>Dietas</a>");
}
print(" $linktabla
");
if ($_SESSION['resLogin'] == "empleado") {
print("<a class='navbar-brand' href='admin.php'>Administracion</a>");
}
if ($_SESSION['resLogin'] == "cliente") {
print("<a class='navbar-brand' href='ampliarplan.php'>Ampliar plan</a>"
. "<a class='navbar-brand' href='logout.php'>Logout</a>");
} else {
print("<a class='navbar-brand' href='logout.php'>Logout</a>");
}
}
?>
</nav>
<?php
if (isset($_SESSION['resProgreso']) && $_SESSION['resProgreso'] == "Error en la insercion") {
print("Error en la insercion");
}
?>
<div class="row">
<div class="col-md-6 login-form-1">
<h3>Inserte progreso</h3>
<form action="insertprogreso.php" method="post" enctype="multipart/form-data">
<label>Tu peso actual:</label>
<div class="form-group">
<input type="number" class="form-control" name="peso" placeholder="Tu peso" value="<?php
if (isset($_SESSION['insertProgreso']['peso'])) {
print($_SESSION['insertProgreso']['peso']);
}
?>" /><?php if (isset($_SESSION['erroresProgreso']['peso'])) print("<p style='color: #FF0000;'>" . $_SESSION['erroresProgreso']['peso'] . "</p>"); ?>
</div>
<label>Tus medidas actuales:</label>
<label>¿No sabes como medirte? <a href="https://es.wikihow.com/calcular-la-grasa-corporal-con-una-cinta-m%C3%A9trica" target="_blank">Aqui tienes una guia de como hacerlo</a></label>
<div class="form-group">
<input type="text" class="form-control" name="medidas" placeholder="Tus medidas Cuello/Cintura/Cadera" value="<?php
if (isset($_SESSION['insertProgreso']['medidas'])) {
print($_SESSION['insertProgreso']['medidas']);
}
?>" /><?php if (isset($_SESSION['erroresProgreso']['medidas'])) print("<p style='color: #FF0000;'>" . $_SESSION['erroresProgreso']['medidas'] . "</p>"); ?>
</div>
<label>Foto de tu progreso fisico:</label>
<div class="form-group">
<input type="file" class="form-control" name="img" value="" />
</div>
<div class="form-group">
<input type="submit" class="btnSubmit" value="Subir progreso" />
</div>
</form>
</div>
</div>
<?php
if (isset($_SESSION['erroresProgreso'])) {
unset($_SESSION['erroresProgreso']);
}
?>
</div>
</body>
</html>