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 PostByPanel($UID, $dbAdapter)
{
    $gateTravelUserDetails = new TravelUserDetailsTableGateway($dbAdapter);
    $result = $gateTravelUserDetails->findById($UID);
    echo '<div class="panel panel-info">
				<div class="panel-heading">Posted By</div>
				<div class="panel-body">
					<a href="single-user.php?id=' . $UID . '">' . utf8_encode($result->FirstName) . ' ' . utf8_encode($result->LastName) . '</a>';
}
function outputPostRows($dbAdapter)
{
    $gateTravelPost = new TravelPostTableGateway($dbAdapter);
    $gateTravelImage = new TravelImageTableGateway($dbAdapter);
    $gateTravelUserDetails = new TravelUserDetailsTableGateway($dbAdapter);
    $gateTravelPostImage = new TravelPostImagesTableGateway($dbAdapter);
    $result = $gateTravelPost->findAll();
    foreach ($result as $row) {
        $postId = $row->PostID;
        $userId = $row->UID;
        $imageId = $gateTravelPostImage->findById($postId)->ImageID;
        $thumb = $gateTravelImage->findById($imageId)->Path;
        $title = $row->Title;
        $firstName = $gateTravelUserDetails->findById($userId)->FirstName;
        $lastName = $gateTravelUserDetails->findById($userId)->LastName;
        $userName = utf8_encode($firstName . $lastName);
        $excerpt = substr($row->Message, 0, 200) . "...";
        $date = substr($row->PostTime, 0, 10);
        echo utf8_encode('<div class="row">
		               <div class="col-md-2">
								<a href="single-image.php?id=' . $imageId . '" class="">
								<img src="travel-images/square-medium/' . $thumb . '" alt="' . $title . '" class="img-thumbnail"/>
								</a>
		               </div>
		              <div class="col-md-10">
		                  <h2>' . $title . '</h2>
		                  <div class="details">
		                    Posted by <a href="single-user.php?id=' . $userId . '" class="">' . $userName . '</a>
		                    <span class="pull-right">' . $date . '</span>
		                  </div>
		                  <p class="excerpt">' . $excerpt . '</p>
						  <p><a href="single-post.php?id=' . $postId . '" class="btn btn-primary btn-sm">Read more</a></p>
		               </div>
		           </div>
		           <hr/>');
    }
}
function imageByPanel($uid, $dbAdapter)
{
    $gateTravelUserDetails = new TravelUserDetailsTableGateway($dbAdapter);
    $result = $gateTravelUserDetails->findById($uid);
    echo '<div class="panel panel-info">
			<div class="panel-heading">Image By</div>
			<div class="panel-body">';
    echo utf8_encode('<a href="single-user.php?id=' . $result->UID . '">' . $result->FirstName . ' ' . $result->LastName . '</a>');
    echo '</div>
		</div>';
}