8 isset(
$user) or require
$_SERVER[
'DOCUMENT_ROOT'] .
'/page/404.php';
11 <div
class=
"modal fade" id=
"<?= $basename ?>" tabindex=
"-1" data-backdrop=
"static" data-keyboard=
"false">
12 <div
class=
"modal-dialog modal-dialog-centered" role=
"document">
13 <div
class=
"modal-content">
14 <div
class=
"modal-header">
15 <h5
class=
"modal-title">Импорт модели</h5>
16 <button type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"Close">
17 <span aria-hidden=
"true">×</span>
20 <div
class=
"modal-body pt-2">
21 <form action=
"<?= Wrong\Models\Actions::find(38)->request ?>">
22 <div
class=
"input-group input-group-sm">
23 <div
class=
"custom-file">
24 <input type=
"file" name=
"file" accept=
"application/zip" class=
"custom-file-input" id=
"input-file">
25 <label
class=
"custom-file-label" for=
"input-file">Выбрать .zip файл импорта</label>
28 <button type=
"submit" class=
"btn btn-sm btn-block btn-success mt-3">Импорт</button>
34 $(
"#input-file").change(
function() {
35 $(
this).next().html($(
"#input-file")[0].files[0]?.name ||
'Выбрать .zip файл импорта');
37 $(
"#<?= $basename ?> form").submit(
function(e) {
38 lockSubmit($(
"#<?= $basename ?> form [type=submit]"));
40 let formData =
new FormData();
41 formData.append(
'file', $(
"#input-file")[0].files[0]);
42 formData.append(
'CSRF', window.CSRF);
45 url: $(
this).attr(
"action"),
58 errorToast(response.error);
61 $(
'.dataTable').DataTable().ajax.reload(
null,
false);
62 $(
'.toast').toast(
'hide');
63 successToast(response.message);
64 $(
"#<?= $basename ?>").modal(
"hide");
65 if (location.pathname != response.location) {
67 location.href = response.location;
72 unlockSubmit($(
"#<?= $basename ?> form [type=submit]"));
setcookie('FROM_UID', $uid, [ 'expires'=> time()+31536000, 'path'=> '/', 'domain'=> $_SERVER['HTTP_HOST'], 'secure'=> Wrong\Start\Env::$e->IS_SECURE, 'httponly'=> false, 'samesite'=> Wrong\Start\Env::$e->IS_SECURE ? 'None' :'Lax']) or setcookie('FROM_UID' $_SERVER['HTTP_HOST']