Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
c5e940fc25 | |||
8df0254271 | |||
6c4c0b1ada | |||
5641a686a2 |
@@ -2,4 +2,6 @@
|
||||
Site-registry of tasks for outsourced employees
|
||||
|
||||
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['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['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']; */
|
||||
@@ -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');
|
||||
@@ -306,10 +307,13 @@ final class market extends core
|
||||
flush();
|
||||
|
||||
try {
|
||||
if (isset($account)) {
|
||||
// Инициализирован аккаунт
|
||||
|
||||
// Создание магазина
|
||||
$market = model::create(
|
||||
data: [
|
||||
'id' => $id,
|
||||
'id' => (string) $id,
|
||||
'name' => [
|
||||
'first' => $parameters['market_name_first'],
|
||||
'second' => $parameters['market_name_second'],
|
||||
@@ -330,6 +334,8 @@ final class market extends core
|
||||
|
||||
// Создание ребра: account -> market
|
||||
account::connect($account, $market, 'market', $this->errors['account']);
|
||||
}
|
||||
throw new exception('Не инициализирован аккаунт');
|
||||
} catch (exception $e) {
|
||||
// Write to the errors registry
|
||||
$this->errors['account'][] = [
|
||||
|
@@ -34,7 +34,7 @@ final class task extends core
|
||||
/**
|
||||
* Создать
|
||||
*
|
||||
* @param array $parameters Параметры запроса
|
||||
* @param array $parameters Параметры запроса (json в php://input)
|
||||
*
|
||||
* @return void В буфер вывода JSON-документ с запрашиваемыми параметрами
|
||||
*/
|
||||
@@ -47,11 +47,27 @@ final class task extends core
|
||||
// Инициализация буфера ошибок
|
||||
$this->errors['tasks'] ??= [];
|
||||
|
||||
// Создание строк
|
||||
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']);
|
||||
if (!empty($json = json_decode(file_get_contents('php://input'), true, 4))) {
|
||||
|
||||
|
||||
foreach ($json as $work => $tasks) {
|
||||
// Перебор категорий (колонок)
|
||||
|
||||
foreach ($tasks as $task) {
|
||||
// Перебор заявок
|
||||
|
||||
// Создание заявки
|
||||
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']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Запись заголовков ответа
|
||||
header('Content-Type: application/json');
|
||||
@@ -74,6 +90,7 @@ final class task extends core
|
||||
// Отправка и деинициализация буфера вывода
|
||||
ob_end_flush();
|
||||
flush();
|
||||
} else throw new exception('Не удалось инициализировать JSON-документ с данными заявок');
|
||||
} else throw new exception('Вы не авторизованы');
|
||||
} 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;
|
||||
|
@@ -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['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['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']; */
|
||||
@@ -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-Encoding: none');
|
||||
@@ -322,10 +326,13 @@ final class worker extends core
|
||||
flush();
|
||||
|
||||
try {
|
||||
if (isset($account)) {
|
||||
// Инициализирован аккаунт
|
||||
|
||||
// Создание сотрудника
|
||||
$worker = model::create(
|
||||
data: [
|
||||
'id' => model::id(),
|
||||
'id' => (string) $id,
|
||||
'name' => [
|
||||
'first' => $parameters['worker_name_first'],
|
||||
'second' => $parameters['worker_name_second'],
|
||||
@@ -357,6 +364,8 @@ final class worker extends core
|
||||
|
||||
// Создание ребра: account -> worker
|
||||
account::connect($account, $worker, 'worker', $this->errors['account']);
|
||||
}
|
||||
throw new exception('Не инициализирован аккаунт');
|
||||
} catch (exception $e) {
|
||||
// Write to the errors registry
|
||||
$this->errors['account'][] = [
|
||||
|
@@ -135,7 +135,7 @@ final class account extends core
|
||||
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'])) {
|
||||
@@ -381,7 +381,7 @@ final class account extends core
|
||||
{
|
||||
try {
|
||||
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('Не удалось инициализировать коллекцию');
|
||||
} catch (exception $e) {
|
||||
|
@@ -171,18 +171,29 @@ class core extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Сгенерировать идентификатор
|
||||
* Generate identifier
|
||||
*
|
||||
* @param array &$errors Реестр ошибок
|
||||
*
|
||||
* @return int Свободный идентификатор (подразумевается)
|
||||
* @return int Идентиикатор (свободный)
|
||||
*/
|
||||
public static function id(array &$errors = []): int
|
||||
{
|
||||
try {
|
||||
if (collection::init(static::$arangodb->session, static::COLLECTION))
|
||||
return static::count(static::COLLECTION, $errors) ?? 0;
|
||||
else throw new exception('Не удалось инициализировать коллекцию');
|
||||
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
|
||||
)
|
||||
) + 1;
|
||||
} else throw new exception('Не удалось инициализировать коллекцию');
|
||||
} catch (exception $e) {
|
||||
// Запись в реестр ошибок
|
||||
$errors[] = [
|
||||
@@ -193,10 +204,10 @@ class core extends model
|
||||
];
|
||||
}
|
||||
|
||||
// Exit (fail)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete from ArangoDB
|
||||
*
|
||||
|
@@ -40,7 +40,7 @@ final class task extends core
|
||||
/**
|
||||
* Create task in ArangoDB
|
||||
*
|
||||
* @param ?string $date
|
||||
* @param string|int|null $date
|
||||
* @param ?string $worker
|
||||
* @param ?string $work
|
||||
* @param ?string $start
|
||||
@@ -51,22 +51,24 @@ final class task extends core
|
||||
* @param bool $hided
|
||||
* @param bool $problematic
|
||||
* @param bool $completed
|
||||
* @param ?string $commentary
|
||||
* @param array $errors
|
||||
*
|
||||
* @return ?string Identificator of instance of ArangoDB
|
||||
*/
|
||||
public static function create(
|
||||
?string $date = null,
|
||||
string|int|null $date = null,
|
||||
?string $worker = null,
|
||||
?string $work = null,
|
||||
?string $start = null,
|
||||
?string $end = null,
|
||||
?string $market = null,
|
||||
bool $confirmed = false,
|
||||
bool $published = true,
|
||||
bool $published = false,
|
||||
bool $hided = false,
|
||||
bool $problematic = false,
|
||||
bool $completed = false,
|
||||
?string $commentary = null,
|
||||
array &$errors = []
|
||||
): ?string {
|
||||
try {
|
||||
@@ -90,6 +92,7 @@ final class task extends core
|
||||
'hided' => $hided,
|
||||
'problematic' => $problematic,
|
||||
'completed' => $completed,
|
||||
'commentary' => $commentary,
|
||||
]);
|
||||
} else throw new exception('Не удалось инициализировать коллекции');
|
||||
} catch (exception $e) {
|
||||
@@ -145,8 +148,8 @@ final class task extends core
|
||||
<<<AQL
|
||||
FOR task IN %s
|
||||
%s
|
||||
LET worker = (FOR worker in %s FILTER worker.id LIKE task.worker SORT worker.created DESC, worker.id DESC LIMIT 1 RETURN worker)[0]
|
||||
LET market = (FOR market in %s FILTER market.id LIKE task.market SORT market.created DESC, market.id DESC LIMIT 1 RETURN market)[0]
|
||||
LET worker = (FOR worker in %s FILTER worker.id != null && worker.id LIKE task.worker SORT worker.created DESC, worker.id DESC LIMIT 1 RETURN worker)[0]
|
||||
LET market = (FOR market in %s FILTER market.id != null && market.id LIKE task.market SORT market.created DESC, market.id DESC LIMIT 1 RETURN market)[0]
|
||||
%s
|
||||
SORT %s
|
||||
LIMIT %d, %d
|
||||
@@ -180,4 +183,25 @@ final class task extends core
|
||||
// Exit (fail)
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
--padding-x: 12px;
|
||||
--padding-y: 8px;
|
||||
width: 100%;
|
||||
min-width: calc(100% - 24px);
|
||||
min-height: 120px;
|
||||
max-width: calc(100% - 24px);
|
||||
max-height: 300px;
|
||||
padding: 8px 12px;
|
||||
padding: var(--padding-y, 8px) var(--padding-x, 12px);
|
||||
font-size: smaller;
|
||||
overflow: hidden;
|
||||
border-radius: 3px;
|
||||
|
@@ -44,9 +44,12 @@ div#popup>section.calculated {
|
||||
}
|
||||
|
||||
div#popup>section.list {
|
||||
max-width: max(70vw, 1300px);
|
||||
max-height: max(62vh, 600px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 30px;
|
||||
overflow-y: scroll;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
@@ -65,17 +68,30 @@ div#popup>section.list h4 {
|
||||
}
|
||||
|
||||
div#popup>section.list>section.main {
|
||||
--gap: 15px;
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
gap: var(--gap, 15px);
|
||||
}
|
||||
|
||||
div#popup>section.list>section.main>div.column {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
flex-direction: column;
|
||||
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 {
|
||||
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)>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 {
|
||||
|
@@ -119,6 +119,7 @@ if (typeof window.markets !== "function") {
|
||||
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
||||
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
||||
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
||||
* @param {HTMLElement} market_id Идентификатор магазина <input>
|
||||
* @param {HTMLElement} market_type Тип магазина <select>
|
||||
* @param {HTMLElement} market_city Город магазина <select>
|
||||
* @param {HTMLElement} market_district Регион магазина <input>
|
||||
@@ -140,6 +141,7 @@ if (typeof window.markets !== "function") {
|
||||
market_name_last,
|
||||
market_number,
|
||||
market_mail,
|
||||
market_id,
|
||||
market_type,
|
||||
market_city,
|
||||
market_district,
|
||||
@@ -158,6 +160,7 @@ if (typeof window.markets !== "function") {
|
||||
market_name_last.setAttribute("readonly", true);
|
||||
market_number.setAttribute("readonly", true);
|
||||
market_mail.setAttribute("readonly", true);
|
||||
market_id.setAttribute("readonly", true);
|
||||
market_type.setAttribute("readonly", true);
|
||||
market_city.setAttribute("readonly", true);
|
||||
market_district.setAttribute("readonly", true);
|
||||
@@ -181,6 +184,7 @@ if (typeof window.markets !== "function") {
|
||||
market_name_last,
|
||||
market_number,
|
||||
market_mail,
|
||||
market_id,
|
||||
market_type,
|
||||
market_city,
|
||||
market_district,
|
||||
@@ -204,6 +208,7 @@ if (typeof window.markets !== "function") {
|
||||
* @param {HTMLElement} market_name_last Отчество представителя магазина <input>
|
||||
* @param {HTMLElement} market_number SIM-номер представителя магазина <input>
|
||||
* @param {HTMLElement} market_mail Почта представителя магазина <input>
|
||||
* @param {HTMLElement} market_id Идентификатор магазина <input>
|
||||
* @param {HTMLElement} market_type Тип магазина <select>
|
||||
* @param {HTMLElement} market_city Город магазина <select>
|
||||
* @param {HTMLElement} market_district Регион магазина <input>
|
||||
@@ -226,6 +231,7 @@ if (typeof window.markets !== "function") {
|
||||
market_name_last,
|
||||
market_number,
|
||||
market_mail,
|
||||
market_id,
|
||||
market_type,
|
||||
market_city,
|
||||
market_district,
|
||||
@@ -246,6 +252,7 @@ if (typeof window.markets !== "function") {
|
||||
market_name_last.removeAttribute("readonly");
|
||||
market_number.removeAttribute("readonly");
|
||||
market_mail.removeAttribute("readonly");
|
||||
market_id.removeAttribute("readonly");
|
||||
market_type.removeAttribute("readonly");
|
||||
market_city.removeAttribute("readonly");
|
||||
market_district.removeAttribute("readonly");
|
||||
@@ -275,7 +282,7 @@ if (typeof window.markets !== "function") {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
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((data) => {
|
||||
@@ -513,6 +520,29 @@ if (typeof window.markets !== "function") {
|
||||
market_mail_input.setAttribute("title", "Почта представителя магазина");
|
||||
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");
|
||||
market_type.classList.add("row", "divided", "merged");
|
||||
@@ -958,6 +988,11 @@ if (typeof window.markets !== "function") {
|
||||
market_mail.appendChild(market_mail_label);
|
||||
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_select.appendChild(market_type_option_1);
|
||||
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_number SIM-номер сотрудника <input>
|
||||
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
||||
* @param {HTMLElement} worker_id Идентификатор сотрудника <input>
|
||||
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
||||
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
||||
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
||||
@@ -148,6 +149,7 @@ if (typeof window.workers !== "function") {
|
||||
worker_name_last,
|
||||
worker_number,
|
||||
worker_mail,
|
||||
worker_id,
|
||||
worker_birth,
|
||||
worker_passport,
|
||||
worker_issued,
|
||||
@@ -174,6 +176,7 @@ if (typeof window.workers !== "function") {
|
||||
worker_name_last.setAttribute("readonly", true);
|
||||
worker_number.setAttribute("readonly", true);
|
||||
worker_mail.setAttribute("readonly", true);
|
||||
worker_id.setAttribute("readonly", true);
|
||||
worker_birth.setAttribute("readonly", true);
|
||||
worker_passport.setAttribute("readonly", true);
|
||||
worker_issued.setAttribute("readonly", true);
|
||||
@@ -205,6 +208,7 @@ if (typeof window.workers !== "function") {
|
||||
worker_name_last,
|
||||
worker_number,
|
||||
worker_mail,
|
||||
worker_id,
|
||||
worker_birth,
|
||||
worker_passport,
|
||||
worker_issued,
|
||||
@@ -236,6 +240,7 @@ if (typeof window.workers !== "function") {
|
||||
* @param {HTMLElement} worker_name_last Отчество сотрудника <input>
|
||||
* @param {HTMLElement} worker_number SIM-номер сотрудника <input>
|
||||
* @param {HTMLElement} worker_mail Почта сотрудника <input>
|
||||
* @param {HTMLElement} worker_id Идентификатор сотрудника <input>
|
||||
* @param {HTMLElement} worker_birth Дата рождения сотрудника <input>
|
||||
* @param {HTMLElement} worker_passport Номер паспорта сотрудника <input>
|
||||
* @param {HTMLElement} worker_issued Дата выдачи паспорта сотрудника <input>
|
||||
@@ -266,6 +271,7 @@ if (typeof window.workers !== "function") {
|
||||
worker_name_last,
|
||||
worker_number,
|
||||
worker_mail,
|
||||
worker_id,
|
||||
worker_birth,
|
||||
worker_passport,
|
||||
worker_issued,
|
||||
@@ -294,6 +300,7 @@ if (typeof window.workers !== "function") {
|
||||
worker_name_last.removeAttribute("readonly");
|
||||
worker_number.removeAttribute("readonly");
|
||||
worker_mail.removeAttribute("readonly");
|
||||
worker_id.removeAttribute("readonly");
|
||||
worker_birth.removeAttribute("readonly");
|
||||
worker_passport.removeAttribute("readonly");
|
||||
worker_issued.removeAttribute("readonly");
|
||||
@@ -331,7 +338,7 @@ if (typeof window.workers !== "function") {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
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((data) => {
|
||||
@@ -561,6 +568,29 @@ if (typeof window.workers !== "function") {
|
||||
worker_mail_input.setAttribute("title", "Почта сотрудника");
|
||||
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");
|
||||
worker_birth.classList.add("row", "divided");
|
||||
@@ -1205,6 +1235,11 @@ if (typeof window.workers !== "function") {
|
||||
worker_mail.appendChild(worker_mail_label);
|
||||
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_input);
|
||||
worker_birth.appendChild(worker_birth_label);
|
||||
|
Reference in New Issue
Block a user