battles/user_anketa.php

42 lines
1.3 KiB
PHP
Raw Permalink Normal View History

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