123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php
- /*
- * Copyright (C) 2021 Echedey López Romero <elr@disroot.org>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- class Person {
- private $Id;
- private $Name;
- private $Profile;
- private $Gender;
- private $Birthday;
- private $Origin;
- private $Biography;
- private $ImageURL;
- private $DefaultImage;
- public function __construct($Id, $Name, $Profile, $Gender, $Birthday,
- $Origin, $Biography, $ImageURL, $DefaultImage) {
- $this->Id = $Id;
- $this->Name = $Name;
- $this->Profile = $Profile;
- $this->Gender = $Gender;
- $this->Birthday = $Birthday;
- $this->Origin = $Origin;
- $this->Biography = $Biography;
- $this->ImageURL = $ImageURL;
- $this->DefaultImage = $DefaultImage;
- }
- public function RenderContent() {
- $HTML = '';
- $HTML .= '<div class="col-lg-10 col-12 mx-auto px-0">' . PHP_EOL;
- $HTML .= '<div class="container-fluid border border-primary rounded">'
- . PHP_EOL;
- $HTML .= '<div class="row my-3">' . PHP_EOL;
- $HTML .= '<div class="col"></div>' . PHP_EOL;
- $HTML .= '<h2 class="col-xl-6 col-lg-4 col-md-5 col-12 mb-lg-0 mb-2 '
- . 'text-center">Person</h2>' . PHP_EOL;
- $HTML .= '<div class="col text-center">' . PHP_EOL;
- $HTML .= '<a class="h-100 btn btn-block btn-secondary t-large" '
- . 'href=".">Return</a>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="row">' . PHP_EOL;
- $HTML .= '<div class="col-lg-4 col-md-6 col-12 mx-auto mb-3">'
- . PHP_EOL;
- if ($this->Profile !== null && $this->Profile !== '') {
- $HTML .= '<img src="' . $this->ImageURL . $this->Profile . '" '
- . 'class="d-block w-100 mx-auto" alt="' . $this->Name
- . '"/>' . PHP_EOL;
- } else {
- $HTML .= '<img src="' . $this->DefaultImage . '" class="d-block '
- . 'w-100 mx-auto" alt="Not specified"/>' . PHP_EOL;
- }
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="col-lg-8 col-12 mb-3">' . PHP_EOL;
- $HTML .= '<div class="container-fluid border border-secondary '
- . 'rounded">' . PHP_EOL;
- $HTML .= '<div class="row my-3">' . PHP_EOL;
- $HTML .= '<h3 class="col-12 mb-0">' . PHP_EOL;
- $HTML .= $this->Name . PHP_EOL;
- $HTML .= '</h3>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="row mb-3">' . PHP_EOL;
- $HTML .= '<span class="col-sm-6 col-12 mb-sm-0 mb-3"><span '
- . 'class="t-large">Gender:</span> ' . PHP_EOL;
- $HTML .= $this->Gender . PHP_EOL;
- $HTML .= '</span>' . PHP_EOL;
- $HTML .= '<span class="col-sm-6 col-12"><span class="t-large">'
- . 'Birthday:</span> ' . PHP_EOL;
- if ($this->Birthday !== null && $this->Birthday !== '') {
- $HTML .= date("d/m/Y",
- strtotime(str_replace('-"', '/', $this->Birthday)))
- . PHP_EOL;
- } else {
- $HTML .= 'Not specified' . PHP_EOL;
- }
- $HTML .= '</span>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="row mb-3">' . PHP_EOL;
- $HTML .= '<span class="col-12"><span class="t-large">Origin:</span> '
- . PHP_EOL;
- if ($this->Origin !== null && $this->Origin !== '') {
- $HTML .= $this->Origin . PHP_EOL;
- } else {
- $HTML .= 'Not specified' . PHP_EOL;
- }
- $HTML .= '</span>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="row mb-3">' . PHP_EOL;
- $HTML .= '<div class="col-12">' . PHP_EOL;
- $HTML .= '<div class="container">' . PHP_EOL;
- $HTML .= '<div class="row mb-2">' . PHP_EOL;
- $HTML .= '<h4 class="col-12 mb-0 px-0">Biography</h4>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '<div class="row">' . PHP_EOL;
- $HTML .= '<p class="col-12 mb-0 px-0">' . PHP_EOL;
- if ($this->Biography !== null && $this->Biography !== '') {
- $HTML .= $this->Biography . PHP_EOL;
- } else {
- $HTML .= 'Not specified' . PHP_EOL;
- }
- $HTML .= '</p>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- $HTML .= '</div>' . PHP_EOL;
- return $HTML;
- }
- }
|