Joywork/admin/parameters.php
2026-05-22 21:21:54 +03:00

80 lines
2.4 KiB
PHP

<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/config.php");
ini_set('display_errors', 1);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE);
// закрываем доступ на выполнение запросов
if (!isset($_SESSION['superadmin'])) {
header("location:/index.php");
die("Доступ запрещён!");
}
include $_SERVER['DOCUMENT_ROOT'] . '/import/ImporterService.php';
include $_SERVER['DOCUMENT_ROOT'] . '/import/ImportReport.php';
$importerService = new ImporterService();
if (isset($_POST['save_params'])) {
$err = "";
$post = clearInputData($_POST);
$importerService->setDefaultFee($post['defaultFee']);
}
require_once($_SERVER['DOCUMENT_ROOT'] . "/templates/header-admin.php");
if (!isset($post)) {
$defaultFee = $importerService->getDefaultFee();
}
?>
<div class="main-title">
<h1>Параметры</h1>
</div>
<div class="users fr__users" style="margin-right: 20px;">
<div class="new-object">
<form method="post" id="upload-form">
<div class="new-object__form">
<?php if (isset($err) && strlen($err) > 0) { ?>
<div class="block" style="border-bottom: none; color: red;"><?php echo $err; ?></div>
<?php } ?>
<div class="block">
<div class="line">
<div class="label" style="width: 200px;">
<span>Комиссия по умолчанию:</span>
</div>
<div class="inputs">
<input type="number" step="0.1" min="0" max="100" class="text" name="defaultFee"
value="<? if (isset($post)) echo $post['defaultFee'];
if (isset($defaultFee)) echo $defaultFee; ?>">
</div>
</div>
<div class="line" style="text-align: right">
<button type="submit" class="medium-button">Сохранить</button>
</div>
<input type="hidden" name="save_params" value="1">
<div class="clear"></div>
</div>
</div>
</form>
</div>
<div class="clear"></div>
</div>
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/templates/footer-admin.php");
?>