/** * Fetch the userId and username of the poster of a pet and return a JSON formatted string with this data * @return string in JSON format */ public static function getPosterInfo() { $get = Core\Input::get(); if (isset($get['petId'])) { $pet = Pet::constructById($get['petId']); $userId = $pet->getUserId(); $user = User::constructById($userId); $userName = $user->getUsername(); return json_encode(array('userId' => $userId, 'userName' => $userName)); } return '{}'; }
<?php $get = Core\Input::get(); $post = Core\Input::post(); ?> <!DOCTYPE html> <html lang="en"> <?php require_once __DIR__ . '/components/head.php'; require_once __DIR__ . '/components/header.php'; ?> <body> <?php $page = 'details'; $referrerPage = isset($get['referrer']) ? $get['referrer'] : 'home'; ?> <div class="container"> <div class="row contactTitleBox"> <div class="col-md-4"> <h4><strong>Manage Your Account</strong></h4> </div> <div class="col-md-8"> <ul class="nav nav-tabs navbar-right"> <li role="presentation"><a href="/~<?php echo USER; ?> /index.php/PetBasket/contactUpdate">Update Info</a></li> <li role="presentation" class="active"><a href="#">My Pets</a></li> <li role="presentation"><a href="/~<?php echo USER; ?>