-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
67 lines (57 loc) · 1.24 KB
/
profile.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
<?php
/**
* MercadoLibre hackaton profile user
* @author mezalejandro
* @copyright 2013
*/
require_once 'includes/header.inc.php';
if (!$userId)
{
header("Location:index.php");
die();
}
$body .= headerHtml($user_view);
/**
* Datos
*/
$usuario = $user['json']['nickname'];
$fecha_registro = $user['json']['registration_date'];
$email = $user['json']['email'];
$nombre = $user['json']['first_name'];
$apellido = $user['json']['last_name'];
/**
* Documento
*/
$dni = $user['json']['identification']['number'];
/**
* Direccion
*/
$ciudad = $user['json']['address']['city'];
$direccion = $user['json']['address']['address'];
/**
* Telefono
*/
$phone = $user['json']['phone']['number'];
if(isset($_GET['profile']) && $_GET['profile'] == 'misdatos')
{
$body .= displayMisDatos($usuario,$fecha_registro,$nombre,$apellido,$email);
}
else if(isset($_GET['profile']) && $_GET['profile'] == 'dni')
{
$body .= displayDNI($dni);
}
else if(isset($_GET['profile']) && $_GET['profile'] == 'address')
{
$body .= displayAddress($ciudad,$direccion);
}
else if(isset($_GET['profile']) && $_GET['profile'] == 'phone')
{
$body .= displayPhone($phone);
}
else
{
$body .= displayMenuProfile();
}
$body .= FooterHtml();
print $body;
?>