-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathverPerfil.php
74 lines (71 loc) · 2.16 KB
/
verPerfil.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
<?php
namespace es\ucm\fdi\aw;
require_once __DIR__.'/includes/config.php';
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?= $app->resuelve('/css/style.css') ?>" />
<title>Perfil</title>
</head>
<body>
<div id="contenedor">
<?php
$nombreUsuario=htmlspecialchars(trim(strip_tags($_GET['usuario'])));
$usuario=Usuario::buscaUsuario($nombreUsuario);
$app->doInclude('comun/cabecera.php');
//$app->doInclude('comun/sidebarIzq.php');
?>
<div id="contenido">
<?php
if($usuario!=false){
echo "<img src= '" . $usuario->imgPerfil() . "' border='0' width='100' height='100'>";
echo "</br>";
echo 'Nombre: ' . $usuario->username();
echo "</br>";
//echo "Email: " . "$usuario->email()";
//echo "</br>";
echo "Descripción: " . $usuario->descripcion();
echo "</br>";
echo "Fecha nacimiento: " . $usuario->fechaNac();
echo "</br>";
$id = $usuario->id();
$img = archivo::buscarImagenDest($id);
if ($img !== FALSE)
{
$ruta = $img->ruta();
echo "Imagen destacada: ";
echo "<img src= '" . $ruta . "' border='0' width='300' height='300'>";
echo "</br>";
}
else
{
echo $usuario->username() . " no tiene ninguna imagen destacada.";
echo "</br></br>";
}
$numero=10;
$archivos = archivo::buscarMejoresArch($id,$numero);
//var_dump($archivos);
if ($archivos !== FALSE)
{
foreach($archivos as $arch)
{
$archivo = archivo::buscaArchivo($arch);
if($archivo!=false) {
$mostradorArchivo = new \es\ucm\fdi\aw\MostradorArchivo($archivo);
echo $mostradorArchivo->mostrar() . "</br>";
}
}
}
}
else {
echo "<p>No se ha encontrado el usuario</p>";
}
?>
</div>
<?php
$app->doInclude('comun/pie.php');
?>
</div>
</body>
</html>