<?php
/* Smarty version 4.5.3, created on 2024-10-07 22:20:53
  from '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/backup.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_6704349520db56_99396776',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '30e5efe3f9d5cc3d0cfef43e69d0515fc140c902' => 
    array (
      0 => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/backup.tpl',
      1 => 1716650267,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_6704349520db56_99396776 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_assignInScope('meta_title', "Бекап" ,false ,8);?>

<div class="container-fluid">

        <div class="nk-block-head nk-block-head-sm">
        <div class="nk-block-between">
            <div class="nk-block-head-content">
                <h3 class="nk-block-title page-title">Бекап</h3>
                <div class="nk-block-des text-soft">
                    <p>Управление резервными копиями сайта.</p>
                </div>
            </div>

            <?php if ($_smarty_tpl->tpl_vars['message_error']->value != 'no_permission') {?>
            <div class="nk-block-head-content">
                <div class="toggle-wrap nk-block-tools-toggle">

                                        <a href="#" class="btn btn-icon btn-trigger toggle-expand mr-n1" data-target="pageMenu">
                        <em class="icon ti ti-menu"></em>
                    </a>

                                        <form class="js-backup-form" method="post">
                    	<input type="hidden" name="name" value="">
                    	<input type="hidden" name="action" value="">
                    </form>

                                        <div class="toggle-expand-content" data-content="pageMenu">
                        <ul class="nk-block-tools g-3">
                            <li>
                                <button type="button" class="btn btn-secondary js-backup-create">
                                    <em class="icon ti ti-circle-plus"></em>
                                    <span>Создать бекап</span>
                                </button>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <?php }?>

        </div>
    </div>

        <?php if ($_GET['message_success']) {?>
    <div class="pb-2">
    	<div class="alert alert-fill alert-success alert-icon">
    		<em class="icon ti ti-circle-check"></em>
    		<?php if ($_GET['message_success'] == 'created') {?>Бекап создан<?php } elseif ($_GET['message_success'] == 'deleted') {?>Файл удален<?php } elseif ($_GET['message_success'] == 'unzipped') {?>Фото восстановлены<?php } elseif ($_GET['message_success'] == 'restored') {?>Бекап восстановлен<?php }?>.
    	</div>
    </div>
    <?php }?>

        <?php if ($_smarty_tpl->tpl_vars['message_error']->value) {?>
    <div class="pb-2">
    	<div class="alert alert-fill alert-danger alert-icon">
    		<em class="icon ti ti-circle-x"></em>
    		<?php if ($_smarty_tpl->tpl_vars['message_error']->value == 'no_permission') {?>Установить права на запись в папку <?php echo $_smarty_tpl->tpl_vars['backup_files_dir']->value;
} else {
echo $_smarty_tpl->tpl_vars['message_error']->value;
}?>.
    	</div>
    </div>
    <?php }?>

        <?php if ($_smarty_tpl->tpl_vars['message_error']->value != 'no_permission') {?>
    <div class="nk-block">
        <div class="card card-bordered card-stretch">
            <div class="card-inner-group">

                <?php if ($_smarty_tpl->tpl_vars['backups']->value) {?>
                <form class="js-list-form" method="post">
                    <div class="card-inner p-0">

                                                <div class="nk-tb-list nk-tb-ulist">
                            <div class="nk-tb-item nk-tb-head">

                                                                <div class="nk-tb-col nk-tb-col-check">
                                    <div class="custom-control custom-control-sm custom-checkbox notext">
                                        <input type="checkbox" class="custom-control-input js-check-all" id="checkall">
                                        <label class="custom-control-label" for="checkall"></label>
                                    </div>
                                </div>
                                <div class="nk-tb-col">
                                    <span class="sub-text">Файл</span>
                                </div>
                                <div class="nk-tb-col tb-col-md">
                                    <span class="sub-text">Размер</span>
                                </div>
                                <div class="nk-tb-col nk-tb-col-tools text-right">Действие</div>
                            </div>
                        </div>

                                                <div class="nk-tb-list nk-tb-ulist is-compact js-list js-list-sortable">

                                                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['backups']->value, 'backup', false, 'key');
$_smarty_tpl->tpl_vars['backup']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['backup']->value) {
$_smarty_tpl->tpl_vars['backup']->do_else = false;
?>
                            <div class="nk-tb-item js-list-item">

                                                                <div class="nk-tb-col nk-tb-col-check">
                                    <div class="custom-control custom-control-sm custom-checkbox notext">
                                        <input type="checkbox" name="check[]" value="<?php echo $_smarty_tpl->tpl_vars['backup']->value->name;?>
" class="custom-control-input" id="uid_<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
">
                                        <label class="custom-control-label" for="uid_<?php echo $_smarty_tpl->tpl_vars['key']->value;?>
"></label>
                                    </div>
                                </div>

                                                                <div class="nk-tb-col ">
                                    <a href="/admin/backup/<?php echo $_smarty_tpl->tpl_vars['backup']->value->name;?>
" target="_blank">
                                        <span class="tb-lead">
                                            <?php echo $_smarty_tpl->tpl_vars['backup']->value->name;?>

                                        </span>
                                    </a>
                                </div>

                                                                <div class="nk-tb-col tb-col-md">
                                	<span class="sub-text"><?php if ($_smarty_tpl->tpl_vars['backup']->value->size > 1024*1024) {
echo round((float) ($_smarty_tpl->tpl_vars['backup']->value->size/1024/1024), (int) 2, (int) 1);?>
 MB<?php } else {
echo round((float) ($_smarty_tpl->tpl_vars['backup']->value->size/1024), (int) 2, (int) 1);?>
 KB<?php }?>
                                    </span>
                                </div>

                                                                <div class="nk-tb-col nk-tb-col-tools">
                                    <ul class="nk-tb-actions gx-1">

                                                                                <li>
                                            <a href="#" class="btn btn-trigger btn-icon js-backup-restore" data-file="<?php echo $_smarty_tpl->tpl_vars['backup']->value->name;?>
" data-toggle="tooltip" data-placement="top" title="" data-original-title="Восстановить бекап">
                                                <em class="icon ti ti-database"></em>
                                            </a>
                                        </li>

                                                                                <li>
                                            <a href="#" class="btn btn-trigger text-danger btn-icon js-list-delete" data-toggle="tooltip" data-placement="top" title="Удалить">
                                                <em class="icon ti ti-trash"></em>
                                            </a>
                                        </li>

                                    </ul>
                                </div>
                            </div>
                            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

                        </div>
                    </div>

                                        <div class="card-inner">
                        <div class="nk-block-between-md g-3">

                                                        <div class="g">
                                <div class="center form-inline flex-nowrap gx-3">
                                    <div class="form-wrap w-200px">
                                        <select name="action" class="form-select form-select-sm" data-placeholder="Массовые действия">
                                            <option value="">Массовые действия</option>
                                            <option value="delete">Удалить</option>
                                        </select>
                                    </div>
                                    <div class="btn-wrap">
                                        <span class="d-none d-md-block">
                                            <button type="submit" class="btn btn-dim btn-outline-light">Применить</button>
                                        </span>
                                        <span class="d-md-none">
                                            <button type="submit" class="btn btn-dim btn-outline-light btn-icon">
                                                <em class="icon ti ti-arrow-right"></em>
                                            </button>
                                        </span>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </form>
                <?php } else { ?>
                <div class="card-inner">
                    <div class="nk-tb-item">
                        <p>Бекапы не найдены.</p>
                    </div>
                </div>
                <?php }?>
            </div>
        </div>
    </div>
    <?php }?>

</div>
<?php }
}
