/
single-user.php
80 lines (58 loc) · 1.88 KB
/
single-user.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
<?php
require_once('includes/travel-setup.inc.php');
include ('includes/functions.php');
function outputUserInfo($dbAdapter) {
$gateTravelUserDetails = new TravelUserDetailsTableGateway($dbAdapter);
$result = $gateTravelUserDetails->findById($_GET['id']);
$name = $result->FirstName . ' '. $result->LastName;
echo utf8_encode('<ol class="breadcrumb">
<li><a href="index.php">Home</a></li>
<li><a href="browse.php">Browse</a></li>
<li><a href="browse-users.php">Users</a></li>
<li class="active">'.$name.'</li>
</ol>');
echo '<div class="panel panel-default">
<div class="panel-body">';
echo utf8_encode('<h2>'.$name.'</h2>
<p>Address: <b>'.$result->Address .'</b></p>
<p>City, Country: <b>'.$result->City .', '.$result->Country .'</b></p>
<p>Email: <b>'.$result->Email .'</b></p>');
echo '</div>
</div>';
echo utf8_encode('<div class="panel panel-primary">
<div class="panel-heading">Images From '.$name.'</div>
<div class="panel-body">');
outputUserImages($dbAdapter);
echo '</div>
</div>';
}
function outputUserImages($dbAdapter) {
$gateTravelImage = new TravelImageTableGateway($dbAdapter);
$result = $gateTravelImage->findForUser($_GET['id']);
OutputImages($result);
}
?>
<!DOCTYPE html>
<?php queryErrorHandlingID(); ?>
<html lang="en">
<head>
<title>Share your Travels Assignment 1</title>
<?php include 'includes/travel-head.inc.php'; ?>
</head>
<body>
<?php include 'includes/travel-header.inc.php'; ?>
<div class="container">
<div class="row">
<div class="col-md-3">
<?php include 'includes/travel-left-rail.inc.php'; ?>
</div>
<div class="col-md-9"> <!-- start main content column -->
<?php outputUserInfo($dbAdapter);?>
</div>
</div>
</div>
<?php include 'includes/travel-footer.inc.php'; ?>
<?php include 'includes/javascript.php'; ?>
<?php $dbAdapter->closeConnection(); ?>
</body>
</html>