43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
||
session_start();
|
||
include_once 'config.php';
|
||
|
||
$login = urldecode($_SERVER['QUERY_STRING']) ?? '';
|
||
$userInfo = new UserInfo($login);
|
||
$presentsModel = new PresentsModel($userInfo->id);
|
||
$presentsList = $presentsModel->getAllPresents();
|
||
$userInfo->watcher_id = $userInfo->id ?? null;
|
||
if (empty($userInfo->id)): ?>
|
||
<!doctype html>
|
||
<html lang="ru">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>Ошибка</title>
|
||
</head>
|
||
<body style="color: #666; background-color: #d5d5d5; text-align: center; font-family: Consolas,monospace;">
|
||
Ошибка: персонаж <em><?= $login ?></em> не найден...
|
||
<p><a style="color: #99f" href="javascript:window.history.go(-1);">←назад</a></p>
|
||
</body>
|
||
</html>
|
||
<?php exit(); endif; ?>
|
||
|
||
<html lang="ru">
|
||
<head>
|
||
<title>Информация о <?= $userInfo->login ?></title>
|
||
<meta charset=UTF-8"/>
|
||
<link href="css/main.css" rel="stylesheet">
|
||
</head>
|
||
<body>
|
||
<?php
|
||
|
||
try {
|
||
$userInfo->showUserInfo();
|
||
|
||
} catch (Exception $e_showUserInfo) {
|
||
echo "<div class='debug'>Ошибка генератора showUserInfo() в User.php: {$e_showUserInfo}</div>";
|
||
}
|
||
|
||
include_once 'views/presents-list.php';
|
||
?>
|
||
</body>
|
||
</html>
|