2018-03-01 18:43:46 +00:00
|
|
|
<?php
|
2021-02-01 16:42:52 +00:00
|
|
|
|
|
|
|
use Battles\Template;
|
2021-03-10 21:03:59 +00:00
|
|
|
use Battles\User;
|
2021-02-01 16:42:52 +00:00
|
|
|
|
2020-09-30 19:12:34 +00:00
|
|
|
require_once 'functions.php';
|
2018-03-01 19:14:51 +00:00
|
|
|
|
2022-08-09 19:57:43 +00:00
|
|
|
if (isset($_POST['name'])) {
|
|
|
|
User::getInstance()->profile()->setRealname($_POST['name']);
|
2018-01-28 16:40:49 +00:00
|
|
|
}
|
2022-08-09 19:57:43 +00:00
|
|
|
if (isset($_POST['hobbie'])) {
|
|
|
|
User::getInstance()->profile()->setInfo($_POST['hobbie']);
|
2018-03-02 15:31:43 +00:00
|
|
|
}
|
2022-08-09 19:57:43 +00:00
|
|
|
|
|
|
|
if (isset($_POST['oldpsw']) && isset($_POST['newpsw'])) {
|
|
|
|
User::getInstance()->profile()->changePassword($_POST['oldpsw'], $_POST['newpsw']);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($_POST)) {
|
|
|
|
echo User::getInstance()->profile()->save();
|
|
|
|
}
|
|
|
|
|
2021-02-01 16:42:52 +00:00
|
|
|
Template::header('Анкета');
|
2018-01-28 16:40:49 +00:00
|
|
|
?>
|
2018-03-01 18:43:46 +00:00
|
|
|
<a href="main.php">← на главную</a>
|
2022-01-26 23:15:33 +00:00
|
|
|
<h1>Анкета персонажа <?= User::getInstance()->getLogin() ?></h1>
|
2020-09-30 19:12:34 +00:00
|
|
|
<form method="post">
|
2021-03-10 21:47:33 +00:00
|
|
|
<label>
|
2022-08-09 19:57:43 +00:00
|
|
|
<input name="name" placeholder="Реальное имя" value="<?= User::getInstance()->profile()->getRealname() ?>">
|
2021-03-10 21:47:33 +00:00
|
|
|
Реальное имя
|
|
|
|
</label><br>
|
2022-08-09 19:57:43 +00:00
|
|
|
<label>
|
|
|
|
<textarea name="hobbie" placeholder="Хобби"><?= User::getInstance()->profile()->getInfo() ?></textarea>
|
|
|
|
</label><br>
|
2018-03-01 18:43:46 +00:00
|
|
|
<input name="submit" type="submit">
|
|
|
|
</form>
|
2018-03-02 15:31:43 +00:00
|
|
|
<h1>Безопасность</h1>
|
2020-09-30 19:12:34 +00:00
|
|
|
<form method="post">
|
2022-08-09 19:57:43 +00:00
|
|
|
<label><input placeholder="Старый пароль" name="oldpsw"></label>
|
|
|
|
<label><input placeholder="Новый пароль" name="newpsw"></label>
|
2018-03-02 15:31:43 +00:00
|
|
|
<input type="submit">
|
2020-09-30 19:12:34 +00:00
|
|
|
</form>
|