Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
c5e940fc25 | |||
8df0254271 | |||
6c4c0b1ada |
@@ -2,4 +2,6 @@
|
|||||||
Site-registry of tasks for outsourced employees
|
Site-registry of tasks for outsourced employees
|
||||||
|
|
||||||
From this project i earned **700 000** Russian rubles</br>
|
From this project i earned **700 000** Russian rubles</br>
|
||||||
*As long as commits appear in the repository, this means that i continue paid development*
|
*As long as commits appear in the repository, this means that i continue paid development*</br>
|
||||||
|
</br>
|
||||||
|
I am selling this site to **capitalist scum** for a lot of money, but you, friend, can use my code **for free** ✌️
|
||||||
|
@@ -238,6 +238,7 @@ final class market extends core
|
|||||||
else if (!empty($parameters['account_number']) && strlen($parameters['account_number']) < 11) throw new exception('Несоответствие формату SIM-номера аккаунта представителя');
|
else if (!empty($parameters['account_number']) && strlen($parameters['account_number']) < 11) throw new exception('Несоответствие формату SIM-номера аккаунта представителя');
|
||||||
else if (!empty($parameters['market_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['market_mail']) === 0) throw new exception('Несоответствие формату почты представителя');
|
else if (!empty($parameters['market_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['market_mail']) === 0) throw new exception('Несоответствие формату почты представителя');
|
||||||
else if (!empty($parameters['account_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['account_mail']) === 0) throw new exception('Несоответствие формату почты аккаунта представителя');
|
else if (!empty($parameters['account_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['account_mail']) === 0) throw new exception('Несоответствие формату почты аккаунта представителя');
|
||||||
|
else if (!empty($parameters['market_id']) && model::read('d.id == "' . $parameters['market_id'] . '"', errors: $this->errors['account']) instanceof _document) throw new exception('Уже существует магазин с данным идентификатором');
|
||||||
|
|
||||||
// Универсализация
|
// Универсализация
|
||||||
/* $parameters['market_number'] = (int) $parameters['market_number']; */
|
/* $parameters['market_number'] = (int) $parameters['market_number']; */
|
||||||
@@ -277,7 +278,7 @@ final class market extends core
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Инициализация идентификатора магазина
|
// Инициализация идентификатора магазина
|
||||||
$id = model::id();
|
$id = empty($parameters['market_id']) ? model::id() : $parameters['market_id'];
|
||||||
|
|
||||||
// Запись заголовков ответа
|
// Запись заголовков ответа
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
@@ -306,30 +307,35 @@ final class market extends core
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Создание магазина
|
if (isset($account)) {
|
||||||
$market = model::create(
|
// Инициализирован аккаунт
|
||||||
data: [
|
|
||||||
'id' => $id,
|
// Создание магазина
|
||||||
'name' => [
|
$market = model::create(
|
||||||
'first' => $parameters['market_name_first'],
|
data: [
|
||||||
'second' => $parameters['market_name_second'],
|
'id' => (string) $id,
|
||||||
'last' => $parameters['market_name_last']
|
'name' => [
|
||||||
|
'first' => $parameters['market_name_first'],
|
||||||
|
'second' => $parameters['market_name_second'],
|
||||||
|
'last' => $parameters['market_name_last']
|
||||||
|
],
|
||||||
|
'number' => $parameters['market_number'] === 0 ? '' : $parameters['market_number'],
|
||||||
|
'mail' => $parameters['market_mail'],
|
||||||
|
'type' => $parameters['market_type'],
|
||||||
|
'city' => $parameters['market_city'],
|
||||||
|
'district' => $parameters['market_district'],
|
||||||
|
'address' => $parameters['market_address'],
|
||||||
],
|
],
|
||||||
'number' => $parameters['market_number'] === 0 ? '' : $parameters['market_number'],
|
errors: $this->errors['account']
|
||||||
'mail' => $parameters['market_mail'],
|
);
|
||||||
'type' => $parameters['market_type'],
|
|
||||||
'city' => $parameters['market_city'],
|
|
||||||
'district' => $parameters['market_district'],
|
|
||||||
'address' => $parameters['market_address'],
|
|
||||||
],
|
|
||||||
errors: $this->errors['account']
|
|
||||||
);
|
|
||||||
|
|
||||||
// Проверка существования созданного магазина
|
// Проверка существования созданного магазина
|
||||||
if (empty($market)) throw new exception('Не удалось создать магазин');
|
if (empty($market)) throw new exception('Не удалось создать магазин');
|
||||||
|
|
||||||
// Создание ребра: account -> market
|
// Создание ребра: account -> market
|
||||||
account::connect($account, $market, 'market', $this->errors['account']);
|
account::connect($account, $market, 'market', $this->errors['account']);
|
||||||
|
}
|
||||||
|
throw new exception('Не инициализирован аккаунт');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
// Write to the errors registry
|
// Write to the errors registry
|
||||||
$this->errors['account'][] = [
|
$this->errors['account'][] = [
|
||||||
@@ -397,8 +403,8 @@ final class market extends core
|
|||||||
|
|
||||||
if (!empty($market)) {
|
if (!empty($market)) {
|
||||||
// Найден магазин
|
// Найден магазин
|
||||||
|
|
||||||
// Инициализация параметров (перезапись переданными значениями)
|
// Инициализация параметров (перезапись переданными значениями)
|
||||||
if ($parameters['name_first'] !== $market->name['first']) $market->name = ['first' => $parameters['name_first']] + $market->name;
|
if ($parameters['name_first'] !== $market->name['first']) $market->name = ['first' => $parameters['name_first']] + $market->name;
|
||||||
if ($parameters['name_second'] !== $market->name['second']) $market->name = ['second' => $parameters['name_second']] + $market->name;
|
if ($parameters['name_second'] !== $market->name['second']) $market->name = ['second' => $parameters['name_second']] + $market->name;
|
||||||
if ($parameters['name_last'] !== $market->name['last']) $market->name = ['last' => $parameters['name_last']] + $market->name;
|
if ($parameters['name_last'] !== $market->name['last']) $market->name = ['last' => $parameters['name_last']] + $market->name;
|
||||||
|
@@ -34,7 +34,7 @@ final class task extends core
|
|||||||
/**
|
/**
|
||||||
* Создать
|
* Создать
|
||||||
*
|
*
|
||||||
* @param array $parameters Параметры запроса
|
* @param array $parameters Параметры запроса (json в php://input)
|
||||||
*
|
*
|
||||||
* @return void В буфер вывода JSON-документ с запрашиваемыми параметрами
|
* @return void В буфер вывода JSON-документ с запрашиваемыми параметрами
|
||||||
*/
|
*/
|
||||||
@@ -47,33 +47,50 @@ final class task extends core
|
|||||||
// Инициализация буфера ошибок
|
// Инициализация буфера ошибок
|
||||||
$this->errors['tasks'] ??= [];
|
$this->errors['tasks'] ??= [];
|
||||||
|
|
||||||
// Создание строк
|
if (!empty($json = json_decode(file_get_contents('php://input'), true, 4))) {
|
||||||
for ($i = 0, $parameters['cashiers'] = (int) $parameters['cashiers']; $i < $parameters['cashiers']; ++$i) model::create(work: 'Кассир', market: $this->account->type === 'market' ? account::market($this->account->getId())?->id : null, start: $parameters['start'], end: $parameters['end'], date: $parameters['date'], errors: $this->errors['tasks']);
|
|
||||||
for ($i = 0, $parameters['displayers'] = (int) $parameters['displayers']; $i < $parameters['displayers']; ++$i) model::create(work: 'Выкладчик', market: $this->account->type === 'market' ? account::market($this->account->getId())?->id : null, start: $parameters['start'], end: $parameters['end'], date: $parameters['date'], errors: $this->errors['tasks']);
|
|
||||||
for ($i = 0, $parameters['loaders'] = (int) $parameters['loaders']; $i < $parameters['loaders']; ++$i) model::create(work: 'Грузчик', market: $this->account->type === 'market' ? account::market($this->account->getId())?->id : null, start: $parameters['start'], end: $parameters['end'], date: $parameters['date'], errors: $this->errors['tasks']);
|
|
||||||
for ($i = 0, $parameters['gastronomes'] = (int) $parameters['gastronomes']; $i < $parameters['gastronomes']; ++$i) model::create(work: 'Гастроном', market: $this->account->type === 'market' ? account::market($this->account->getId())?->id : null, start: $parameters['start'], end: $parameters['end'], date: $parameters['date'], errors: $this->errors['tasks']);
|
|
||||||
|
|
||||||
// Запись заголовков ответа
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
header('Content-Encoding: none');
|
|
||||||
header('X-Accel-Buffering: no');
|
|
||||||
|
|
||||||
// Инициализация буфера вывода
|
foreach ($json as $work => $tasks) {
|
||||||
ob_start();
|
// Перебор категорий (колонок)
|
||||||
|
|
||||||
// Генерация ответа
|
foreach ($tasks as $task) {
|
||||||
echo json_encode(
|
// Перебор заявок
|
||||||
[
|
|
||||||
'errors' => self::parse_only_text($this->errors)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Запись заголовков ответа
|
// Создание заявки
|
||||||
header('Content-Length: ' . ob_get_length());
|
model::create(
|
||||||
|
work: model::label($work),
|
||||||
|
market: $this->account->type === 'market' ? account::market($this->account->getId())?->id : null,
|
||||||
|
start: $task['start'],
|
||||||
|
end: $task['end'],
|
||||||
|
date: $task['date'],
|
||||||
|
commentary: $task['commentary'],
|
||||||
|
errors: $this->errors['tasks']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Отправка и деинициализация буфера вывода
|
// Запись заголовков ответа
|
||||||
ob_end_flush();
|
header('Content-Type: application/json');
|
||||||
flush();
|
header('Content-Encoding: none');
|
||||||
|
header('X-Accel-Buffering: no');
|
||||||
|
|
||||||
|
// Инициализация буфера вывода
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
// Генерация ответа
|
||||||
|
echo json_encode(
|
||||||
|
[
|
||||||
|
'errors' => self::parse_only_text($this->errors)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Запись заголовков ответа
|
||||||
|
header('Content-Length: ' . ob_get_length());
|
||||||
|
|
||||||
|
// Отправка и деинициализация буфера вывода
|
||||||
|
ob_end_flush();
|
||||||
|
flush();
|
||||||
|
} else throw new exception('Не удалось инициализировать JSON-документ с данными заявок');
|
||||||
} else throw new exception('Вы не авторизованы');
|
} else throw new exception('Вы не авторизованы');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
// Запись в реестр ошибок
|
// Запись в реестр ошибок
|
||||||
@@ -1758,7 +1775,7 @@ final class task extends core
|
|||||||
// Найдена заявка
|
// Найдена заявка
|
||||||
|
|
||||||
// Инициализация списка работ
|
// Инициализация списка работ
|
||||||
$this->view->works = ['Кассир', 'Выкладчик', 'Грузчик', 'Гастроном'];
|
$this->view->works = ['Кассир', 'Выкладчик', 'Гастроном', 'Бригадир', 'Грузчик', 'Мобильный грузчик', 'Мобильный универсал'];
|
||||||
|
|
||||||
// Проверка на существование записанной в задаче работы в списке существующих работ и запись об этом в глобальную переменную шаблонизатора
|
// Проверка на существование записанной в задаче работы в списке существующих работ и запись об этом в глобальную переменную шаблонизатора
|
||||||
foreach ($this->view->works as $work) if ($this->view->task->work === $work) $this->view->exist = true;
|
foreach ($this->view->works as $work) if ($this->view->task->work === $work) $this->view->exist = true;
|
||||||
|
@@ -39,7 +39,7 @@ final class worker extends core
|
|||||||
// Авторизация
|
// Авторизация
|
||||||
if ($this->account->status() && ($this->account->type === 'administrator' || $this->account->type === 'operator')) {
|
if ($this->account->status() && ($this->account->type === 'administrator' || $this->account->type === 'operator')) {
|
||||||
// Авторизован аккаунт оператора или администратора
|
// Авторизован аккаунт оператора или администратора
|
||||||
|
|
||||||
foreach (['active', 'inactive', 'fined', 'decent', 'hided', 'fired'] as $name) {
|
foreach (['active', 'inactive', 'fined', 'decent', 'hided', 'fired'] as $name) {
|
||||||
// Перебор фильтров статусов
|
// Перебор фильтров статусов
|
||||||
|
|
||||||
@@ -253,6 +253,7 @@ final class worker extends core
|
|||||||
else if (!empty($parameters['account_number']) && strlen($parameters['account_number']) < 11) throw new exception('Несоответствие формату SIM-номера аккаунта сотрудника');
|
else if (!empty($parameters['account_number']) && strlen($parameters['account_number']) < 11) throw new exception('Несоответствие формату SIM-номера аккаунта сотрудника');
|
||||||
else if (!empty($parameters['worker_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['worker_mail']) === 0) throw new exception('Несоответствие формату почты сотрудника');
|
else if (!empty($parameters['worker_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['worker_mail']) === 0) throw new exception('Несоответствие формату почты сотрудника');
|
||||||
else if (!empty($parameters['account_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['account_mail']) === 0) throw new exception('Несоответствие формату почты аккаунта сотрудника');
|
else if (!empty($parameters['account_mail']) && preg_match('/^.+@.+\.\w+$/', $parameters['account_mail']) === 0) throw new exception('Несоответствие формату почты аккаунта сотрудника');
|
||||||
|
else if (!empty($parameters['worker_id']) && model::read('d.id == "' . $parameters['worker_id'] . '"', errors: $this->errors['account']) instanceof _document) throw new exception('Уже существует сотрудник с данным идентификатором');
|
||||||
|
|
||||||
// Универсализация
|
// Универсализация
|
||||||
/* $parameters['worker_number'] = (int) $parameters['worker_number']; */
|
/* $parameters['worker_number'] = (int) $parameters['worker_number']; */
|
||||||
@@ -295,6 +296,9 @@ final class worker extends core
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Инициализация идентификатора сотрудника
|
||||||
|
$id = empty($parameters['worker_id']) ? model::id() : $parameters['worker_id'];
|
||||||
|
|
||||||
// Запись заголовков ответа
|
// Запись заголовков ответа
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
header('Content-Encoding: none');
|
header('Content-Encoding: none');
|
||||||
@@ -322,41 +326,46 @@ final class worker extends core
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Создание сотрудника
|
if (isset($account)) {
|
||||||
$worker = model::create(
|
// Инициализирован аккаунт
|
||||||
data: [
|
|
||||||
'id' => model::id(),
|
|
||||||
'name' => [
|
|
||||||
'first' => $parameters['worker_name_first'],
|
|
||||||
'second' => $parameters['worker_name_second'],
|
|
||||||
'last' => $parameters['worker_name_last']
|
|
||||||
],
|
|
||||||
'number' => $parameters['worker_number'],
|
|
||||||
'mail' => $parameters['worker_mail'],
|
|
||||||
'birth' => $parameters['worker_birth'],
|
|
||||||
'passport' => $parameters['worker_passport'],
|
|
||||||
'issued' => $parameters['worker_issued'],
|
|
||||||
'department' => [
|
|
||||||
'number' => $parameters['worker_department_number'],
|
|
||||||
'address' => $parameters['worker_department_address']
|
|
||||||
],
|
|
||||||
'requisites' => $parameters['worker_requisites'],
|
|
||||||
'payment' => $parameters['worker_payment'],
|
|
||||||
'tax' => $parameters['worker_tax'],
|
|
||||||
'city' => $parameters['worker_city'],
|
|
||||||
'district' => $parameters['worker_district'],
|
|
||||||
'address' => $parameters['worker_address'],
|
|
||||||
'hiring' => $parameters['worker_hiring'],
|
|
||||||
'rating' => 3
|
|
||||||
],
|
|
||||||
errors: $this->errors['account']
|
|
||||||
);
|
|
||||||
|
|
||||||
// Проверка существования созданного сотрудника
|
// Создание сотрудника
|
||||||
if (empty($worker)) throw new exception('Не удалось создать сотрудника');
|
$worker = model::create(
|
||||||
|
data: [
|
||||||
|
'id' => (string) $id,
|
||||||
|
'name' => [
|
||||||
|
'first' => $parameters['worker_name_first'],
|
||||||
|
'second' => $parameters['worker_name_second'],
|
||||||
|
'last' => $parameters['worker_name_last']
|
||||||
|
],
|
||||||
|
'number' => $parameters['worker_number'],
|
||||||
|
'mail' => $parameters['worker_mail'],
|
||||||
|
'birth' => $parameters['worker_birth'],
|
||||||
|
'passport' => $parameters['worker_passport'],
|
||||||
|
'issued' => $parameters['worker_issued'],
|
||||||
|
'department' => [
|
||||||
|
'number' => $parameters['worker_department_number'],
|
||||||
|
'address' => $parameters['worker_department_address']
|
||||||
|
],
|
||||||
|
'requisites' => $parameters['worker_requisites'],
|
||||||
|
'payment' => $parameters['worker_payment'],
|
||||||
|
'tax' => $parameters['worker_tax'],
|
||||||
|
'city' => $parameters['worker_city'],
|
||||||
|
'district' => $parameters['worker_district'],
|
||||||
|
'address' => $parameters['worker_address'],
|
||||||
|
'hiring' => $parameters['worker_hiring'],
|
||||||
|
'rating' => 3
|
||||||
|
],
|
||||||
|
errors: $this->errors['account']
|
||||||
|
);
|
||||||
|
|
||||||
// Создание ребра: account -> worker
|
// Проверка существования созданного сотрудника
|
||||||
account::connect($account, $worker, 'worker', $this->errors['account']);
|
if (empty($worker)) throw new exception('Не удалось создать сотрудника');
|
||||||
|
|
||||||
|
// Создание ребра: account -> worker
|
||||||
|
account::connect($account, $worker, 'worker', $this->errors['account']);
|
||||||
|
}
|
||||||
|
throw new exception('Не инициализирован аккаунт');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
// Write to the errors registry
|
// Write to the errors registry
|
||||||
$this->errors['account'][] = [
|
$this->errors['account'][] = [
|
||||||
@@ -424,7 +433,7 @@ final class worker extends core
|
|||||||
|
|
||||||
if (!empty($worker)) {
|
if (!empty($worker)) {
|
||||||
// Найден сотрудник
|
// Найден сотрудник
|
||||||
|
|
||||||
// Универсализация
|
// Универсализация
|
||||||
if (!empty($parameters['birth'])) $parameters['birth'] = DateTime::createFromFormat('Y-m-d', $parameters['birth'])->getTimestamp();
|
if (!empty($parameters['birth'])) $parameters['birth'] = DateTime::createFromFormat('Y-m-d', $parameters['birth'])->getTimestamp();
|
||||||
if (!empty($parameters['issued'])) $parameters['issued'] = DateTime::createFromFormat('Y-m-d', $parameters['issued'])->getTimestamp();
|
if (!empty($parameters['issued'])) $parameters['issued'] = DateTime::createFromFormat('Y-m-d', $parameters['issued'])->getTimestamp();
|
||||||
|
@@ -135,7 +135,7 @@ final class account extends core
|
|||||||
if (!empty($session->buffer['market']['entry']['password'])) {
|
if (!empty($session->buffer['market']['entry']['password'])) {
|
||||||
// Найден пароль в буфере сессии
|
// Найден пароль в буфере сессии
|
||||||
|
|
||||||
if (($account = market::account(market::read('d.id == "' . $session->buffer['market']['entry']['id'] . '"', amount: 1)?->getId())) instanceof _document) {
|
if (($account = market::account(market::read('d.id == "' . $session->buffer['market']['entry']['id'] . '"', amount: 1)?->getId()) ?? null) instanceof _document) {
|
||||||
// Найден аккаунт (игнорируются ошибки)
|
// Найден аккаунт (игнорируются ошибки)
|
||||||
|
|
||||||
if (sodium_crypto_pwhash_str_verify($account->password, $session->buffer['market']['entry']['password'])) {
|
if (sodium_crypto_pwhash_str_verify($account->password, $session->buffer['market']['entry']['password'])) {
|
||||||
@@ -381,7 +381,7 @@ final class account extends core
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (collection::init(static::$arangodb->session, self::COLLECTION))
|
if (collection::init(static::$arangodb->session, self::COLLECTION))
|
||||||
if ($id = document::write(static::$arangodb->session, self::COLLECTION, $data + ['active' => true])) return $id;
|
if ($id = (string) document::write(static::$arangodb->session, self::COLLECTION, $data + ['active' => true])) return $id;
|
||||||
else throw new exception('Не удалось создать аккаунт');
|
else throw new exception('Не удалось создать аккаунт');
|
||||||
else throw new exception('Не удалось инициализировать коллекцию');
|
else throw new exception('Не удалось инициализировать коллекцию');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
|
@@ -171,18 +171,29 @@ class core extends model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Сгенерировать идентификатор
|
* Generate identifier
|
||||||
*
|
*
|
||||||
* @param array &$errors Реестр ошибок
|
* @param array &$errors Реестр ошибок
|
||||||
*
|
*
|
||||||
* @return int Свободный идентификатор (подразумевается)
|
* @return int Идентиикатор (свободный)
|
||||||
*/
|
*/
|
||||||
public static function id(array &$errors = []): int
|
public static function id(array &$errors = []): int
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (collection::init(static::$arangodb->session, static::COLLECTION))
|
if (collection::init(static::$arangodb->session, static::COLLECTION)) {
|
||||||
return static::count(static::COLLECTION, $errors) ?? 0;
|
// Инициализирована коллекция
|
||||||
else throw new exception('Не удалось инициализировать коллекцию');
|
|
||||||
|
// Exit (success)
|
||||||
|
return collection::search(
|
||||||
|
static::$arangodb->session,
|
||||||
|
sprintf(
|
||||||
|
<<<'AQL'
|
||||||
|
RETURN MAX((FOR d in %s RETURN +d.id))
|
||||||
|
AQL,
|
||||||
|
$collection ?? static::COLLECTION
|
||||||
|
)
|
||||||
|
) + 1;
|
||||||
|
} else throw new exception('Не удалось инициализировать коллекцию');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
// Запись в реестр ошибок
|
// Запись в реестр ошибок
|
||||||
$errors[] = [
|
$errors[] = [
|
||||||
@@ -193,10 +204,10 @@ class core extends model
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exit (fail)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete from ArangoDB
|
* Delete from ArangoDB
|
||||||
*
|
*
|
||||||
|
@@ -40,7 +40,7 @@ final class task extends core
|
|||||||
/**
|
/**
|
||||||
* Create task in ArangoDB
|
* Create task in ArangoDB
|
||||||
*
|
*
|
||||||
* @param ?string $date
|
* @param string|int|null $date
|
||||||
* @param ?string $worker
|
* @param ?string $worker
|
||||||
* @param ?string $work
|
* @param ?string $work
|
||||||
* @param ?string $start
|
* @param ?string $start
|
||||||
@@ -51,22 +51,24 @@ final class task extends core
|
|||||||
* @param bool $hided
|
* @param bool $hided
|
||||||
* @param bool $problematic
|
* @param bool $problematic
|
||||||
* @param bool $completed
|
* @param bool $completed
|
||||||
|
* @param ?string $commentary
|
||||||
* @param array $errors
|
* @param array $errors
|
||||||
*
|
*
|
||||||
* @return ?string Identificator of instance of ArangoDB
|
* @return ?string Identificator of instance of ArangoDB
|
||||||
*/
|
*/
|
||||||
public static function create(
|
public static function create(
|
||||||
?string $date = null,
|
string|int|null $date = null,
|
||||||
?string $worker = null,
|
?string $worker = null,
|
||||||
?string $work = null,
|
?string $work = null,
|
||||||
?string $start = null,
|
?string $start = null,
|
||||||
?string $end = null,
|
?string $end = null,
|
||||||
?string $market = null,
|
?string $market = null,
|
||||||
bool $confirmed = false,
|
bool $confirmed = false,
|
||||||
bool $published = true,
|
bool $published = false,
|
||||||
bool $hided = false,
|
bool $hided = false,
|
||||||
bool $problematic = false,
|
bool $problematic = false,
|
||||||
bool $completed = false,
|
bool $completed = false,
|
||||||
|
?string $commentary = null,
|
||||||
array &$errors = []
|
array &$errors = []
|
||||||
): ?string {
|
): ?string {
|
||||||
try {
|
try {
|
||||||
@@ -90,6 +92,7 @@ final class task extends core
|
|||||||
'hided' => $hided,
|
'hided' => $hided,
|
||||||
'problematic' => $problematic,
|
'problematic' => $problematic,
|
||||||
'completed' => $completed,
|
'completed' => $completed,
|
||||||
|
'commentary' => $commentary,
|
||||||
]);
|
]);
|
||||||
} else throw new exception('Не удалось инициализировать коллекции');
|
} else throw new exception('Не удалось инициализировать коллекции');
|
||||||
} catch (exception $e) {
|
} catch (exception $e) {
|
||||||
@@ -180,4 +183,25 @@ final class task extends core
|
|||||||
// Exit (fail)
|
// Exit (fail)
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate work type label in Russian
|
||||||
|
*
|
||||||
|
* @param string $work Type of work
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function label(string $work): string
|
||||||
|
{
|
||||||
|
return match (mb_strtolower($work)) {
|
||||||
|
'cashiers', 'cashier', 'кассиры', 'кассир' => 'Кассир',
|
||||||
|
'displayers', 'displayer', 'выкладчики', 'выкладчик' => 'Выкладчик',
|
||||||
|
'gastronomes', 'gastronome', 'гастрономы', 'гастроном' => 'Гастроном',
|
||||||
|
'brigadiers', 'brigadier', 'бригадиры', 'бригадир' => 'Бригадир',
|
||||||
|
'loaders', 'loader', 'грузчики', 'грузчик' => 'Грузчик',
|
||||||
|
'loaders_mobile', 'loader_mobile', 'мобильные грузчики', 'мобильный грузчик' => 'Мобильный грузчик',
|
||||||
|
'universals_mobile', 'universal_mobile', 'мобильные универсалы', 'мобильный универсал' => 'Мобильный универсал',
|
||||||
|
default => $work
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -90,45 +90,6 @@ final class worker extends core
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate identifier
|
|
||||||
*
|
|
||||||
* @param array &$errors Реестр ошибок
|
|
||||||
*
|
|
||||||
* @return int Идентиикатор (свободный)
|
|
||||||
*/
|
|
||||||
public static function id(array &$errors = []): int
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
if (collection::init(static::$arangodb->session, static::COLLECTION)) {
|
|
||||||
// Инициализирована коллекция
|
|
||||||
|
|
||||||
// Exit (success)
|
|
||||||
return collection::search(
|
|
||||||
static::$arangodb->session,
|
|
||||||
sprintf(
|
|
||||||
<<<'AQL'
|
|
||||||
RETURN MAX((FOR d in %s RETURN +d.id))
|
|
||||||
AQL,
|
|
||||||
$collection ?? static::COLLECTION
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else throw new exception('Не удалось инициализировать коллекцию');
|
|
||||||
} catch (exception $e) {
|
|
||||||
// Запись в реестр ошибок
|
|
||||||
$errors[] = [
|
|
||||||
'text' => $e->getMessage(),
|
|
||||||
'file' => $e->getFile(),
|
|
||||||
'line' => $e->getLine(),
|
|
||||||
'stack' => $e->getTrace()
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit (fail)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Записать
|
* Записать
|
||||||
*
|
*
|
||||||
|
@@ -302,12 +302,14 @@ label * {
|
|||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
|
--padding-x: 12px;
|
||||||
|
--padding-y: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: calc(100% - 24px);
|
min-width: calc(100% - 24px);
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
max-width: calc(100% - 24px);
|
max-width: calc(100% - 24px);
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
padding: 8px 12px;
|
padding: var(--padding-y, 8px) var(--padding-x, 12px);
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@@ -44,9 +44,12 @@ div#popup>section.calculated {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div#popup>section.list {
|
div#popup>section.list {
|
||||||
|
max-width: max(70vw, 1300px);
|
||||||
|
max-height: max(62vh, 600px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
|
overflow-y: scroll;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,17 +68,30 @@ div#popup>section.list h4 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div#popup>section.list>section.main {
|
div#popup>section.list>section.main {
|
||||||
|
--gap: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 15px;
|
flex-flow: row wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: var(--gap, 15px);
|
||||||
}
|
}
|
||||||
|
|
||||||
div#popup>section.list>section.main>div.column {
|
div#popup>section.list>section.main>div.column {
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#popup>section.list>section.main.flow>div.column:not(:only-child) {
|
||||||
|
width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#popup>section.list>section.main>div.column:not(:only-child)[data-column="buttons"]:last-of-type {
|
||||||
|
margin-left: auto;
|
||||||
|
justify-content: end;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
div#popup>section.list>section.main>div.column:only-child {
|
div#popup>section.list>section.main>div.column:only-child {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -140,7 +156,21 @@ div#popup>section.list>section.main>div.column> :is(div, select).row.buttons {
|
|||||||
|
|
||||||
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons, .stretchable, .endless),
|
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons, .stretchable, .endless),
|
||||||
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons, .stretchable, .endless)>button {
|
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons, .stretchable, .endless)>button {
|
||||||
height: 29px;
|
--height: 29px;
|
||||||
|
height: var(--height, 29px);
|
||||||
|
}
|
||||||
|
|
||||||
|
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons .endless).stretchable,
|
||||||
|
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons, .endless).stretchable>button {
|
||||||
|
--height: 29px;
|
||||||
|
height: max(var(--height, 29px), fit-content);
|
||||||
|
}
|
||||||
|
|
||||||
|
div#popup>section.list>section.main>div.column> :is(div, select).row:not(.buttons .endless).stretchable>textarea {
|
||||||
|
/* min-height: calc(var(--height, 29px) - var(--padding-y, 8ox) * 2); */
|
||||||
|
min-height: 1rem;
|
||||||
|
max-height: 3rem;
|
||||||
|
height: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#popup>section.list>section.main>div.column>:is(div, section).row:not(.merged)+:is(div, section).row.merged {
|
div#popup>section.list>section.main>div.column>:is(div, section).row:not(.merged)+:is(div, section).row.merged {
|
||||||
|
@@ -119,6 +119,7 @@ if (typeof window.markets !== "function") {
|
|||||||
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
||||||
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
||||||
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
||||||
|
* @param {HTMLElement} market_id Идентификатор магазина <input>
|
||||||
* @param {HTMLElement} market_type Тип магазина <select>
|
* @param {HTMLElement} market_type Тип магазина <select>
|
||||||
* @param {HTMLElement} market_city Город магазина <select>
|
* @param {HTMLElement} market_city Город магазина <select>
|
||||||
* @param {HTMLElement} market_district Регион магазина <input>
|
* @param {HTMLElement} market_district Регион магазина <input>
|
||||||
@@ -140,6 +141,7 @@ if (typeof window.markets !== "function") {
|
|||||||
market_name_last,
|
market_name_last,
|
||||||
market_number,
|
market_number,
|
||||||
market_mail,
|
market_mail,
|
||||||
|
market_id,
|
||||||
market_type,
|
market_type,
|
||||||
market_city,
|
market_city,
|
||||||
market_district,
|
market_district,
|
||||||
@@ -158,6 +160,7 @@ if (typeof window.markets !== "function") {
|
|||||||
market_name_last.setAttribute("readonly", true);
|
market_name_last.setAttribute("readonly", true);
|
||||||
market_number.setAttribute("readonly", true);
|
market_number.setAttribute("readonly", true);
|
||||||
market_mail.setAttribute("readonly", true);
|
market_mail.setAttribute("readonly", true);
|
||||||
|
market_id.setAttribute("readonly", true);
|
||||||
market_type.setAttribute("readonly", true);
|
market_type.setAttribute("readonly", true);
|
||||||
market_city.setAttribute("readonly", true);
|
market_city.setAttribute("readonly", true);
|
||||||
market_district.setAttribute("readonly", true);
|
market_district.setAttribute("readonly", true);
|
||||||
@@ -181,6 +184,7 @@ if (typeof window.markets !== "function") {
|
|||||||
market_name_last,
|
market_name_last,
|
||||||
market_number,
|
market_number,
|
||||||
market_mail,
|
market_mail,
|
||||||
|
market_id,
|
||||||
market_type,
|
market_type,
|
||||||
market_city,
|
market_city,
|
||||||
market_district,
|
market_district,
|
||||||
@@ -204,6 +208,7 @@ if (typeof window.markets !== "function") {
|
|||||||
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
||||||
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
||||||
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
||||||
|
* @param {HTMLElement} market_id Идентификатор магазина <input>
|
||||||
* @param {HTMLElement} market_type Тип магазина <select>
|
* @param {HTMLElement} market_type Тип магазина <select>
|
||||||
* @param {HTMLElement} market_city Город магазина <select>
|
* @param {HTMLElement} market_city Город магазина <select>
|
||||||
* @param {HTMLElement} market_district Регион магазина <input>
|
* @param {HTMLElement} market_district Регион магазина <input>
|
||||||
@@ -226,6 +231,7 @@ if (typeof window.markets !== "function") {
|
|||||||
market_name_last,
|
market_name_last,
|
||||||
market_number,
|
market_number,
|
||||||
market_mail,
|
market_mail,
|
||||||
|
market_id,
|
||||||
market_type,
|
market_type,
|
||||||
market_city,
|
market_city,
|
||||||
market_district,
|
market_district,
|
||||||
@@ -246,6 +252,7 @@ if (typeof window.markets !== "function") {
|
|||||||
market_name_last.removeAttribute("readonly");
|
market_name_last.removeAttribute("readonly");
|
||||||
market_number.removeAttribute("readonly");
|
market_number.removeAttribute("readonly");
|
||||||
market_mail.removeAttribute("readonly");
|
market_mail.removeAttribute("readonly");
|
||||||
|
market_id.removeAttribute("readonly");
|
||||||
market_type.removeAttribute("readonly");
|
market_type.removeAttribute("readonly");
|
||||||
market_city.removeAttribute("readonly");
|
market_city.removeAttribute("readonly");
|
||||||
market_district.removeAttribute("readonly");
|
market_district.removeAttribute("readonly");
|
||||||
@@ -275,7 +282,7 @@ if (typeof window.markets !== "function") {
|
|||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
body:
|
body:
|
||||||
`market_name_first=${market_name_first.value}&market_name_second=${market_name_second.value}&market_name_last=${market_name_last.value}&market_number=${market_number.mask.unmaskedValue}&market_mail=${market_mail.value}&market_type=${market_type.value}&market_city=${market_city.value}&market_district=${market_district.value}&market_address=${market_address.value}&account_name_first=${account_name_first.value}&account_name_second=${account_name_second.value}&account_name_last=${account_name_last.value}&account_number=${account_number.mask.unmaskedValue}&account_mail=${account_mail.value}&account_password=${account_password.value}&account_commentary=${account_commentary.value}`,
|
`market_name_first=${market_name_first.value}&market_name_second=${market_name_second.value}&market_name_last=${market_name_last.value}&market_number=${market_number.mask.unmaskedValue}&market_mail=${market_mail.value}&market_id=${market_id.value}&market_type=${market_type.value}&market_city=${market_city.value}&market_district=${market_district.value}&market_address=${market_address.value}&account_name_first=${account_name_first.value}&account_name_second=${account_name_second.value}&account_name_last=${account_name_last.value}&account_number=${account_number.mask.unmaskedValue}&account_mail=${account_mail.value}&account_password=${account_password.value}&account_commentary=${account_commentary.value}`,
|
||||||
})
|
})
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
@@ -513,6 +520,29 @@ if (typeof window.markets !== "function") {
|
|||||||
market_mail_input.setAttribute("title", "Почта представителя магазина");
|
market_mail_input.setAttribute("title", "Почта представителя магазина");
|
||||||
market_mail_input.setAttribute("placeholder", "name@server");
|
market_mail_input.setAttribute("placeholder", "name@server");
|
||||||
|
|
||||||
|
// Инициализация строки
|
||||||
|
const market_id = document.createElement("div");
|
||||||
|
market_id.classList.add("row", "merged");
|
||||||
|
|
||||||
|
// Инициализация оболочки для строки
|
||||||
|
const market_id_label = document.createElement("label");
|
||||||
|
market_id_label.setAttribute("id", "market_id");
|
||||||
|
|
||||||
|
// Инициализация заголовка для поля ввода
|
||||||
|
const market_id_title = document.createElement("b");
|
||||||
|
market_id_title.classList.add("separated", "right", "unselectable");
|
||||||
|
market_id_title.innerText = "Идентификатор:";
|
||||||
|
|
||||||
|
// Инициализация поля ввода
|
||||||
|
const market_id_input = document.createElement("input");
|
||||||
|
market_id_input.classList.add("large");
|
||||||
|
market_id_input.setAttribute("name", "id");
|
||||||
|
market_id_input.setAttribute("type", "text");
|
||||||
|
market_id_input.setAttribute("minlength", "1");
|
||||||
|
market_id_input.setAttribute("maxlength", "3");
|
||||||
|
market_id_input.setAttribute("title", "Идентификатор магазина");
|
||||||
|
market_id_input.setAttribute("placeholder", "000");
|
||||||
|
|
||||||
// Инициализация строки
|
// Инициализация строки
|
||||||
const market_type = document.createElement("div");
|
const market_type = document.createElement("div");
|
||||||
market_type.classList.add("row", "divided", "merged");
|
market_type.classList.add("row", "divided", "merged");
|
||||||
@@ -958,6 +988,11 @@ if (typeof window.markets !== "function") {
|
|||||||
market_mail.appendChild(market_mail_label);
|
market_mail.appendChild(market_mail_label);
|
||||||
market.appendChild(market_mail);
|
market.appendChild(market_mail);
|
||||||
|
|
||||||
|
market_id_label.appendChild(market_id_title);
|
||||||
|
market_id_label.appendChild(market_id_input);
|
||||||
|
market_id.appendChild(market_id_label);
|
||||||
|
market.appendChild(market_id);
|
||||||
|
|
||||||
market_type_label.appendChild(market_type_title);
|
market_type_label.appendChild(market_type_title);
|
||||||
market_type_select.appendChild(market_type_option_1);
|
market_type_select.appendChild(market_type_option_1);
|
||||||
market_type_select.appendChild(market_type_option_2);
|
market_type_select.appendChild(market_type_option_2);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -119,6 +119,7 @@ if (typeof window.workers !== "function") {
|
|||||||
* @param {HTMLElement} worker_name_last Отчество сотрудника <input>
|
* @param {HTMLElement} worker_name_last Отчество сотрудника <input>
|
||||||
* @param {HTMLElement} worker_number SIM-номер сотрудника <input>
|
* @param {HTMLElement} worker_number SIM-номер сотрудника <input>
|
||||||
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
||||||
|
* @param {HTMLElement} worker_id Идентификатор сотрудника <input>
|
||||||
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
||||||
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
||||||
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
||||||
@@ -148,6 +149,7 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_name_last,
|
worker_name_last,
|
||||||
worker_number,
|
worker_number,
|
||||||
worker_mail,
|
worker_mail,
|
||||||
|
worker_id,
|
||||||
worker_birth,
|
worker_birth,
|
||||||
worker_passport,
|
worker_passport,
|
||||||
worker_issued,
|
worker_issued,
|
||||||
@@ -174,6 +176,7 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_name_last.setAttribute("readonly", true);
|
worker_name_last.setAttribute("readonly", true);
|
||||||
worker_number.setAttribute("readonly", true);
|
worker_number.setAttribute("readonly", true);
|
||||||
worker_mail.setAttribute("readonly", true);
|
worker_mail.setAttribute("readonly", true);
|
||||||
|
worker_id.setAttribute("readonly", true);
|
||||||
worker_birth.setAttribute("readonly", true);
|
worker_birth.setAttribute("readonly", true);
|
||||||
worker_passport.setAttribute("readonly", true);
|
worker_passport.setAttribute("readonly", true);
|
||||||
worker_issued.setAttribute("readonly", true);
|
worker_issued.setAttribute("readonly", true);
|
||||||
@@ -205,6 +208,7 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_name_last,
|
worker_name_last,
|
||||||
worker_number,
|
worker_number,
|
||||||
worker_mail,
|
worker_mail,
|
||||||
|
worker_id,
|
||||||
worker_birth,
|
worker_birth,
|
||||||
worker_passport,
|
worker_passport,
|
||||||
worker_issued,
|
worker_issued,
|
||||||
@@ -236,6 +240,7 @@ if (typeof window.workers !== "function") {
|
|||||||
* @param {HTMLElement} worker_name_last Отчество сотрудника <input>
|
* @param {HTMLElement} worker_name_last Отчество сотрудника <input>
|
||||||
* @param {HTMLElement} worker_number SIM-номер сотрудника <input>
|
* @param {HTMLElement} worker_number SIM-номер сотрудника <input>
|
||||||
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
||||||
|
* @param {HTMLElement} worker_id Идентификатор сотрудника <input>
|
||||||
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
||||||
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
||||||
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
||||||
@@ -266,6 +271,7 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_name_last,
|
worker_name_last,
|
||||||
worker_number,
|
worker_number,
|
||||||
worker_mail,
|
worker_mail,
|
||||||
|
worker_id,
|
||||||
worker_birth,
|
worker_birth,
|
||||||
worker_passport,
|
worker_passport,
|
||||||
worker_issued,
|
worker_issued,
|
||||||
@@ -294,6 +300,7 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_name_last.removeAttribute("readonly");
|
worker_name_last.removeAttribute("readonly");
|
||||||
worker_number.removeAttribute("readonly");
|
worker_number.removeAttribute("readonly");
|
||||||
worker_mail.removeAttribute("readonly");
|
worker_mail.removeAttribute("readonly");
|
||||||
|
worker_id.removeAttribute("readonly");
|
||||||
worker_birth.removeAttribute("readonly");
|
worker_birth.removeAttribute("readonly");
|
||||||
worker_passport.removeAttribute("readonly");
|
worker_passport.removeAttribute("readonly");
|
||||||
worker_issued.removeAttribute("readonly");
|
worker_issued.removeAttribute("readonly");
|
||||||
@@ -331,7 +338,7 @@ if (typeof window.workers !== "function") {
|
|||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
body:
|
body:
|
||||||
`worker_name_first=${worker_name_first.value}&worker_name_second=${worker_name_second.value}&worker_name_last=${worker_name_last.value}&worker_number=${worker_number.mask.unmaskedValue}&worker_mail=${worker_mail.value}&worker_birth=${worker_birth.value}&worker_birth=${worker_birth.value}&worker_passport=${worker_passport.value}&worker_issued=${worker_issued.value}&worker_department_number=${worker_department_number.value}&worker_department_address=${worker_department_address.value}&worker_requisites=${worker_requisites.value}&worker_payment=${worker_payment.value}&worker_tax=${worker_tax.value}&worker_city=${worker_city.value}&worker_district=${worker_district.value}&worker_address=${worker_address.value}&worker_hiring=${worker_hiring.value}&account_name_first=${account_name_first.value}&account_name_second=${account_name_second.value}&account_name_last=${account_name_last.value}&account_number=${account_number.mask.unmaskedValue}&account_mail=${account_mail.value}&account_password=${account_password.value}&account_commentary=${account_commentary.value}`,
|
`worker_name_first=${worker_name_first.value}&worker_name_second=${worker_name_second.value}&worker_name_last=${worker_name_last.value}&worker_number=${worker_number.mask.unmaskedValue}&worker_mail=${worker_mail.value}&worker_id=${worker_id.value}&worker_birth=${worker_birth.value}&worker_birth=${worker_birth.value}&worker_passport=${worker_passport.value}&worker_issued=${worker_issued.value}&worker_department_number=${worker_department_number.value}&worker_department_address=${worker_department_address.value}&worker_requisites=${worker_requisites.value}&worker_payment=${worker_payment.value}&worker_tax=${worker_tax.value}&worker_city=${worker_city.value}&worker_district=${worker_district.value}&worker_address=${worker_address.value}&worker_hiring=${worker_hiring.value}&account_name_first=${account_name_first.value}&account_name_second=${account_name_second.value}&account_name_last=${account_name_last.value}&account_number=${account_number.mask.unmaskedValue}&account_mail=${account_mail.value}&account_password=${account_password.value}&account_commentary=${account_commentary.value}`,
|
||||||
})
|
})
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
@@ -561,6 +568,29 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_mail_input.setAttribute("title", "Почта сотрудника");
|
worker_mail_input.setAttribute("title", "Почта сотрудника");
|
||||||
worker_mail_input.setAttribute("placeholder", "name@server");
|
worker_mail_input.setAttribute("placeholder", "name@server");
|
||||||
|
|
||||||
|
// Инициализация строки
|
||||||
|
const worker_id = document.createElement("div");
|
||||||
|
worker_id.classList.add("row", "merged");
|
||||||
|
|
||||||
|
// Инициализация оболочки для строки
|
||||||
|
const worker_id_label = document.createElement("label");
|
||||||
|
worker_id_label.setAttribute("id", "worker_id");
|
||||||
|
|
||||||
|
// Инициализация заголовка для поля ввода
|
||||||
|
const worker_id_title = document.createElement("b");
|
||||||
|
worker_id_title.classList.add("separated", "right", "unselectable");
|
||||||
|
worker_id_title.innerText = "Идентификатор:";
|
||||||
|
|
||||||
|
// Инициализация поля ввода
|
||||||
|
const worker_id_input = document.createElement("input");
|
||||||
|
worker_id_input.classList.add("large");
|
||||||
|
worker_id_input.setAttribute("name", "id");
|
||||||
|
worker_id_input.setAttribute("type", "text");
|
||||||
|
worker_id_input.setAttribute("minlength", "1");
|
||||||
|
worker_id_input.setAttribute("maxlength", "6");
|
||||||
|
worker_id_input.setAttribute("title", "Идентификатор сотрудника");
|
||||||
|
worker_id_input.setAttribute("placeholder", "000000");
|
||||||
|
|
||||||
// Инициализация строки
|
// Инициализация строки
|
||||||
const worker_birth = document.createElement("div");
|
const worker_birth = document.createElement("div");
|
||||||
worker_birth.classList.add("row", "divided");
|
worker_birth.classList.add("row", "divided");
|
||||||
@@ -1205,6 +1235,11 @@ if (typeof window.workers !== "function") {
|
|||||||
worker_mail.appendChild(worker_mail_label);
|
worker_mail.appendChild(worker_mail_label);
|
||||||
worker.appendChild(worker_mail);
|
worker.appendChild(worker_mail);
|
||||||
|
|
||||||
|
worker_id_label.appendChild(worker_id_title);
|
||||||
|
worker_id_label.appendChild(worker_id_input);
|
||||||
|
worker_id.appendChild(worker_id_label);
|
||||||
|
worker.appendChild(worker_id);
|
||||||
|
|
||||||
worker_birth_label.appendChild(worker_birth_title);
|
worker_birth_label.appendChild(worker_birth_title);
|
||||||
worker_birth_label.appendChild(worker_birth_input);
|
worker_birth_label.appendChild(worker_birth_input);
|
||||||
worker_birth.appendChild(worker_birth_label);
|
worker_birth.appendChild(worker_birth_label);
|
||||||
|
Reference in New Issue
Block a user