<?php
/* Smarty version 4.5.3, created on 2025-10-12 16:36:35
  from '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/banners.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_68ebaee33787d6_59080078',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'd4a2b22e6c146ce2ddefc0ef2b452a0e58073341' => 
    array (
      0 => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/html/banners.tpl',
      1 => 1748084487,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_68ebaee33787d6_59080078 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, array (
  'banner' => 
  array (
    'compiled_filepath' => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/compiled/d4a2b22e6c146ce2ddefc0ef2b452a0e58073341_0.file.banners.tpl.php',
    'uid' => 'd4a2b22e6c146ce2ddefc0ef2b452a0e58073341',
    'call_name' => 'smarty_template_function_banner_42023787168ebaee32e6f09_87113053',
  ),
  'section_select' => 
  array (
    'compiled_filepath' => '/home/w/wmaster77/corp.site-77.ru/public_html/admin/design/compiled/d4a2b22e6c146ce2ddefc0ef2b452a0e58073341_0.file.banners.tpl.php',
    'uid' => 'd4a2b22e6c146ce2ddefc0ef2b452a0e58073341',
    'call_name' => 'smarty_template_function_section_select_42023787168ebaee32e6f09_87113053',
  ),
));
$_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>

                        <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>

                                        <div class="toggle-expand-content" data-content="pageMenu">
                        <ul class="nk-block-tools g-3">

                                                        <?php if ($_GET['return']) {?>
                            <li>
                                <a href="<?php echo $_GET['return'];?>
" class="btn btn-white btn-outline-light">
                                    <em class="icon ti ti-arrow-back-up"></em>
                                    <span>Вернуться</span>
                                </a>
                            </li>
                            <?php }?>

                                                        <li>
                                <a href="javascript:void(0);" data-toggle="modal" data-target="#addBanner" class="btn btn-secondary">
                                    <em class="icon ti ti-circle-plus"></em>
                                    <span>Создать баннер</span>
                                </a>
                            </li>

                        </ul>
                    </div>
                </div>
            </div>

        </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'] == 'updated') {?>
                Баннер обновлён.
            <?php } elseif ($_GET['message_success'] == 'added') {?>
                Баннер добавлен.
            <?php } elseif ($_GET['message_success'] == 'deleted') {?>
                Баннер удалён.
            <?php } else { ?>
                <?php echo htmlspecialchars((string)$_GET['message_success'], ENT_QUOTES, 'UTF-8', true);?>
.
            <?php }?>
        </div>
    </div>
    <?php }?>

        <div class="nk-block">
        <div class="card card-bordered card-stretch">
            <div class="card-inner-group">
                <div class="card-inner position-relative card-tools-toggle">
                    <div class="card-title-group">
                        <div class="card-title">
                            <h5 class="title">Баннеры</h5>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

        <div class="nk-block">
        <div class="row g-gs js-banners-sortable">
            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['banners']->value, 'banner');
$_smarty_tpl->tpl_vars['banner']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['banner']->value) {
$_smarty_tpl->tpl_vars['banner']->do_else = false;
?>
            <div class="col-lg-3 js-list-item" data-position="<?php echo $_smarty_tpl->tpl_vars['banner']->value->position;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
">
                <div class="card card-bordered h-100">
                    <div class="img-thumbnail border-0">
                        <?php if (!empty($_smarty_tpl->tpl_vars['banner']->value->image->filename)) {?>
                            <?php if ($_smarty_tpl->tpl_vars['banner']->value->image->filetype != "svg") {?>
                            <div class="w-max-350px h-150px of-hidden center">
                                <a href="<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['banner']->value->image ));?>
" data-toggle="modal" data-target="#EditBanner<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
">
                                    <img src="<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['banner']->value->image,350,120,'auto' ));?>
" class="rounded-0 p-2">
                                </a>
                            </div>
                            <?php } else { ?>
                            <div class="w-max-350px h-150px of-hidden">
                                <a class="center" href="#" data-toggle="modal" data-target="#EditBanner<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
">
                                    <?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['banner']->value->image,0,0,'auto','blob' ));?>

                                </a>
                            </div>
                            <?php }?>
                        <?php } else { ?>
                        <div class="w-max-350px of-hidden center">
                            <h6 data-toggle="modal" data-target="#EditBanner<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
" style="padding:10px 0;"><?php echo $_smarty_tpl->tpl_vars['banner']->value->title;?>
</h6>
                        </div>
                        <?php }?>
                    </div>
                    <div class="card-inner border-top">
                        <div class="team">
                            <ul class="pricing-features fw-medium fs-14px">
                                <li>
                                    <span class="w-50">Активность</span> -
                                    <span class="ms-auto <?php if ($_smarty_tpl->tpl_vars['banner']->value->visible) {?>text-success<?php } else { ?>text-danger<?php }?>">
                                        <?php if ($_smarty_tpl->tpl_vars['banner']->value->visible) {?>Включен<?php } else { ?>Выключен<?php }?>
                                    </span>
                                </li>
                                <li>
                                    <span class="w-50">Цвет текста</span> -
                                    <span class="ms-auto">
                                        <?php if ($_smarty_tpl->tpl_vars['banner']->value->color == 'white') {?>Светлый<?php } else { ?>Темный<?php }?>
                                    </span>
                                </li>
                                <li>
                                    <span class="w-50">На странице</span> -
                                    <span class="ms-auto">
                                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['all_pages']->value, 'p');
$_smarty_tpl->tpl_vars['p']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['p']->value) {
$_smarty_tpl->tpl_vars['p']->do_else = false;
?>
                                            <?php if ($_smarty_tpl->tpl_vars['p']->value->id == $_smarty_tpl->tpl_vars['banner']->value->page_id) {?>
                                                <?php echo $_smarty_tpl->tpl_vars['p']->value->name;?>

                                            <?php }?>
                                        <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                    </span>
                                </li>
                                <li>
                                    <span class="w-50">URL страницы</span> -
                                    <span class="ms-auto"><?php echo $_smarty_tpl->tpl_vars['all_pages']->value[$_smarty_tpl->tpl_vars['banner']->value->page_id]->url;?>
</span>
                                </li>
                            </ul>
                            <div class="center mt-2">
                                <ul class="nk-tb-actions gx-1">

                                                                        <input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
">

                                                                        <li>
                                        <button type="button" class="btn btn-trigger nk-tooltip btn-icon" data-toggle="modal" data-target="#EditBanner<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
" data-placement="top" title="Редактировать">
                                            <em class="icon ti ti-edit"></em>
                                        </button>
                                    </li>

                                                                        <li>
                                        <div class="btn btn-trigger btn-icon js-list-move" data-toggle="tooltip" data-placement="top" title="Переместить">
                                            <em class="icon ti ti-arrows-down-up"></em>
                                        </div>
                                    </li>

                                                                        <li>
                                        <a onclick="return confirm('Подтверждаете удаление?') ? true : false;" href="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['url'][0], array( array('module'=>'BannersAdmin','name'=>$_GET['name'],'delete'=>$_smarty_tpl->tpl_vars['banner']->value->id),$_smarty_tpl ) );?>
" class="btn btn-trigger btn-icon text-danger" data-toggle="tooltip" data-placement="top" title="Удалить">
                                            <em class="icon ti ti-trash"></em>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        </div>
    </div>

        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['banners']->value, 'banner');
$_smarty_tpl->tpl_vars['banner']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['banner']->value) {
$_smarty_tpl->tpl_vars['banner']->do_else = false;
?>
    <div class="modal fade" tabindex="-1" role="dialog" id="EditBanner<?php echo $_smarty_tpl->tpl_vars['banner']->value->id;?>
">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Редактирование баннера</h5>
                    <a href="#" class="close" data-dismiss="modal" aria-label="Close">
                        <em class="icon ni ni-cross"></em>
                    </a>
                </div>
                <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'banner', array('item'=>$_smarty_tpl->tpl_vars['banner']->value), true);?>

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

        <div class="modal fade" tabindex="-1" role="dialog" id="addBanner">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Создать баннер</h5>
                    <a href="#" class="close" data-dismiss="modal" aria-label="Close">
                        <em class="icon ni ni-cross"></em>
                    </a>
                </div>
                <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'banner', array('item'=>null), true);?>

            </div>
        </div>
    </div>

</div>
<?php }
/* smarty_template_function_section_select_42023787168ebaee32e6f09_87113053 */
if (!function_exists('smarty_template_function_section_select_42023787168ebaee32e6f09_87113053')) {
function smarty_template_function_section_select_42023787168ebaee32e6f09_87113053(Smarty_Internal_Template $_smarty_tpl,$params) {
foreach ($params as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value, $_smarty_tpl->isRenderingCache);
}
?>

                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['pages']->value, 'p');
$_smarty_tpl->tpl_vars['p']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['p']->value) {
$_smarty_tpl->tpl_vars['p']->do_else = false;
?>
                                    <option value='<?php echo $_smarty_tpl->tpl_vars['p']->value->id;?>
' <?php if ($_smarty_tpl->tpl_vars['banner']->value->page_id == $_smarty_tpl->tpl_vars['p']->value->id) {?>selected<?php }?>>
                                        <?php
$__section_sp_0_loop = (is_array(@$_loop=$_smarty_tpl->tpl_vars['level']->value) ? count($_loop) : max(0, (int) $_loop));
$__section_sp_0_total = $__section_sp_0_loop;
$_smarty_tpl->tpl_vars['__smarty_section_sp'] = new Smarty_Variable(array());
if ($__section_sp_0_total !== 0) {
for ($__section_sp_0_iteration = 1, $_smarty_tpl->tpl_vars['__smarty_section_sp']->value['index'] = 0; $__section_sp_0_iteration <= $__section_sp_0_total; $__section_sp_0_iteration++, $_smarty_tpl->tpl_vars['__smarty_section_sp']->value['index']++){
?>&mdash;<?php
}
}
echo $_smarty_tpl->tpl_vars['p']->value->name;?>

                                    </option>
                                    <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'section_select', array('pages'=>$_smarty_tpl->tpl_vars['p']->value->subpages,'level'=>$_smarty_tpl->tpl_vars['level']->value+1), true);?>

                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            <?php
}}
/*/ smarty_template_function_section_select_42023787168ebaee32e6f09_87113053 */
/* smarty_template_function_banner_42023787168ebaee32e6f09_87113053 */
if (!function_exists('smarty_template_function_banner_42023787168ebaee32e6f09_87113053')) {
function smarty_template_function_banner_42023787168ebaee32e6f09_87113053(Smarty_Internal_Template $_smarty_tpl,$params) {
$params = array_merge(array('item'=>$_smarty_tpl->tpl_vars['banner']->value), $params);
foreach ($params as $key => $value) {
$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value, $_smarty_tpl->isRenderingCache);
}
?>

<?php $_smarty_tpl->_assignInScope('id', $_smarty_tpl->tpl_vars['item']->value->id);?>
<div class="modal-body">
    <form method="post" action="" enctype="multipart/form-data" id="id_<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">
        <input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">
        <input type="hidden" name="old_image" value="<?php echo $_smarty_tpl->tpl_vars['item']->value->image->filename;?>
">
        <div class="row g-2">
            <div class="col-12">
                <?php if (!empty($_smarty_tpl->tpl_vars['item']->value->image->filename)) {?>
                    <?php if ($_smarty_tpl->tpl_vars['banner']->value->image->filetype != "svg") {?>
                    <div class="form-group">
                        <div class="img-thumbnail text-center p-2 js-delivery-image">
                            <a href="<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['item']->value->image ));?>
" data-fancybox="gallery">
                                <img src="<?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['item']->value->image ));?>
">
                            </a>
                        </div>
                    </div>
                    <?php } else { ?>
                    <div class="form-group">
                        <div class="img-thumbnail text-center p-2 js-delivery-image">
                            <a href="#" data-fancybox="gallery">
                                <?php echo call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'resize' ][ 0 ], array( $_smarty_tpl->tpl_vars['item']->value->image,0,0,'auto','blob' ));?>

                            </a>
                        </div>
                    </div>
                    <?php }?>
                <?php }?>
                <div class="form-group mb-0">
                    <label class="form-label mb-1" for="customFile<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Загрузить изображение</label>
                    <div class="form-control-wrap">
                        <div class="custom-file">
                            <input type="file" name="dropped_images[]" class="custom-file-input" id="customFile<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">
                            <label class="custom-file-label" for="customFile<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Выберите фото</label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group mb-1">
                    <label class="form-label mb-1">Заголовок</label>
                    <input type="text" class="form-control" name="banner[title]" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->title, ENT_QUOTES, 'UTF-8', true);?>
">
                </div>
                <div class="form-group">
                    <label class="form-label mb-1">Подзаголовок</label>
                    <input type="text" class="form-control" name="banner[subtitle]" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->subtitle, ENT_QUOTES, 'UTF-8', true);?>
">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group mb-1">
                    <label class="form-label mb-1">Текст кнопки</label>
                    <input type="text" class="form-control" name="banner[button_text]" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->button_text, ENT_QUOTES, 'UTF-8', true);?>
">
                </div>
                <div class="form-group">
                    <label class="form-label mb-1">URL кнопки</label>
                    <input type="text" class="form-control" name="banner[button_url]" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->button_url, ENT_QUOTES, 'UTF-8', true);?>
">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="form-label mb-1" for="page_<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Показывать на странице</label>
                    <div class="form-control-wrap">
                        <select name="banner[page_id]" id="page_<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" class="form-select form-control">
                            
                            <?php $_smarty_tpl->smarty->ext->_tplFunction->callTemplateFunction($_smarty_tpl, 'section_select', array('pages'=>$_smarty_tpl->tpl_vars['pages']->value,'level'=>0), true);?>

                        </select>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label class="form-label mb-1">Опциональные данные</label>
                    <input type="text" class="form-control" name="banner[options]" value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->options, ENT_QUOTES, 'UTF-8', true);?>
">
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label class="form-label mb-1">Виден</label>
                    <ul class="custom-control-group g-3 align-center flex-wrap">
                        <li>
                            <div class="custom-control custom-control-sm custom-radio checked">
                                <input type="radio" class="custom-control-input" name="banner[visible]" value="1" id="newbanner_visible_on<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['item']->value->visible == '1') {?>checked="checked"<?php }?>>
                                <label class="custom-control-label" for="newbanner_visible_on<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Да</label>
                            </div>
                        </li>
                        <li>
                            <div class="custom-control custom-control-sm custom-radio">
                                <input type="radio" class="custom-control-input" name="banner[visible]" value="0" id="newbanner_visible_off<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['item']->value->visible == '0') {?>checked="checked"<?php }?>>
                                <label class="custom-control-label" for="newbanner_visible_off<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Нет</label>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label class="form-label mb-1">Текст</label>
                    <ul class="custom-control-group g-3 align-center flex-wrap">
                        <li>
                            <div class="custom-control custom-control-sm custom-radio checked">
                                <input type="radio" class="custom-control-input" name="banner[color]" value="white" id="newbanner_color_white<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['item']->value->color == 'white') {?>checked="checked"<?php }?>>
                                <label class="custom-control-label" for="newbanner_color_white<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Светлый</label>
                            </div>
                        </li>
                        <li>
                            <div class="custom-control custom-control-sm custom-radio">
                                <input type="radio" class="custom-control-input" name="banner[color]" value="black" id="newbanner_color_black<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['item']->value->color == 'black') {?>checked="checked"<?php }?>>
                                <label class="custom-control-label" for="newbanner_color_black<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
">Темный</label>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-12">
                <div class="form-group">
                    <label class="form-label mb-1">Описание</label>
                    <textarea rows=5 class="form-control" name="banner[description]"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['item']->value->description, ENT_QUOTES, 'UTF-8', true);?>
</textarea>
                </div>
            </div>
            <div class="col-12">
                <ul class="align-center flex-wrap flex-sm-nowrap gx-4 gy-2">
                    <li>
                        <button type="submit" class="btn btn-primary">Сохранить</button>
                    </li>
                    <li>
                        <a href="#" class="link link-light" data-dismiss="modal">Отменить</a>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<?php
}}
/*/ smarty_template_function_banner_42023787168ebaee32e6f09_87113053 */
}
