registration: Added field birthday

This commit is contained in:
0x7d5 2021-10-10 13:41:38 +05:00
parent 81e5f2ae2c
commit dcdca45045
2 changed files with 13 additions and 1 deletions

View file

@ -93,6 +93,9 @@ final class AuthPresenter extends OpenVKPresenter
if(!$chUser)
$this->flashFail("err", "Не удалось зарегистрироваться", "Пользователь с таким email уже существует.");
if (!strtotime($this->postParam("birthday")) < time())
$this->flashFail("err", "Неверная дата рождения", "Дату рождения, которую вы ввели, не является корректным.");
$user = new User;
$user->setUser($chUser->getId());
$user->setFirst_Name($this->postParam("first_name"));
@ -101,6 +104,7 @@ final class AuthPresenter extends OpenVKPresenter
$user->setEmail($this->postParam("email"));
$user->setSince(date("Y-m-d H:i:s"));
$user->setRegistering_Ip(CONNECTING_IP);
$user->setBirthday(strtotime($this->postParam("birthday")));
$user->save();
if(!is_null($referer)) {

View file

@ -24,7 +24,7 @@
</p>
<form method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="40%" border="0" align="center">
<table cellspacing="7" cellpadding="0" width="52%" border="0" align="center">
<tbody>
<tr>
<td>
@ -54,6 +54,14 @@
</select>
</td>
</tr>
<tr>
<td>
<span>{_"birth_date"}: </span>
</td>
<td>
<input max={date('Y-m-d')} name="birthday" type="date"/>
</td>
</tr>
<tr></tr>
<tr>
<td>