Admin: Implementation of user editing

This commit is contained in:
veselcraft 2021-09-11 17:39:14 +03:00
parent 87c172c874
commit 8369857e17
2 changed files with 24 additions and 22 deletions

View file

@ -56,6 +56,13 @@ final class AdminPresenter extends OpenVKPresenter
switch($_POST["act"] ?? "info") { switch($_POST["act"] ?? "info") {
default: default:
case "info": case "info":
$user->setFirst_Name($this->postParam("first_name"));
$user->setLast_Name($this->postParam("last_name"));
$user->setPseudo($this->postParam("nickname"));
$user->setStatus($this->postParam("status"));
$user->setVerified(empty($this->postParam("verify") ? 0 : 1));
if($user->onlineStatus() != $this->postParam("online")) $user->setOnline(intval($this->postParam("online")));
$user->save();
break; break;

View file

@ -10,23 +10,7 @@
{block content} {block content}
<div class="aui-tabs horizontal-tabs"> <div class="aui-tabs horizontal-tabs">
<ul class="tabs-menu"> <form class="aui" method="POST">
<li class="menu-item active-tab">
<a href="#info">Информация</a>
</li>
<li class="menu-item">
<a href="#pass">Пароль</a>
</li>
<li class="menu-item">
<a href="#moderation">Модерация</a>
</li>
<li class="menu-item">
<a href="#actions">Операции</a>
</li>
</ul>
<
<form class="aui" method="POST" enctype="multipart/form-data">
<div class="field-group"> <div class="field-group">
<label for="avatar"> <label for="avatar">
Аватарка Аватарка
@ -79,17 +63,28 @@
</label> </label>
<input class="text medium-field" type="email" id="email" name="email" value="{$user->getEmail()}" /> <input class="text medium-field" type="email" id="email" name="email" value="{$user->getEmail()}" />
</div> </div>
<hr>
<div class="field-group"> <div class="field-group">
<label for="tg"> <label for="city">
Telegram Верификация
</label> </label>
<input class="text medium-field" type="text" id="tg" name="tg" value="{$user->getTelegram()}" /> <input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} />
</div> </div>
<div class="field-group"> <div class="field-group">
<label for="city"> <label for="city">
Город Онлайн статус
</label> </label>
<input class="text medium-field" type="text" id="city" name="city" value="{$user->getCity()}" /> <select name="online" class="select">
<option value="0" {if $user->onlineStatus() > 2}selected{/if}>По-умолчанию</option>
<option value="1" {if $user->onlineStatus() == 1}selected{/if}>Инкогнито</option>
<option value="2" {if $user->onlineStatus() == 2}selected{/if}>Юзер умер</option>
</select>
</div>
<div class="buttons-container">
<div class="buttons">
<input type="hidden" name="case" value="info">
<input class="button submit" type="submit" value="Сохранить">
</div>
</div> </div>
</form> </form>