Files
battles/user_anketa.php
T

42 lines
1.3 KiB
PHP
Raw Normal View History

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