<?php
/* Smarty version 4.5.2, created on 2024-05-17 07:07:10
  from '/home/life/public_html/yzb.lifestyle.uz/admin/templates/views/socials/social.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.2',
  'unifunc' => 'content_6647021e5e28e2_25560327',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '6d31739c0a7c87f1740a4636629fde7b651d446b' => 
    array (
      0 => '/home/life/public_html/yzb.lifestyle.uz/admin/templates/views/socials/social.tpl',
      1 => 1679630384,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:components/group-buttons.tpl' => 1,
    'file:components/page-header.tpl' => 1,
    'file:components/fields/select.tpl' => 1,
  ),
),false)) {
function content_6647021e5e28e2_25560327 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/home/life/public_html/yzb.lifestyle.uz/includes/composer/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
?>
<form method="post" id="social" >
	<!-- Page header -->
    <?php ob_start();
if (!empty($_smarty_tpl->tpl_vars['page']->value)) {
echo (string)$_smarty_tpl->tpl_vars['page']->value;
}
$_prefixVariable1=ob_get_clean();
$_smarty_tpl->_subTemplateRender("file:components/group-buttons.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('url'=>((string)$_smarty_tpl->tpl_vars['adminUrl']->value)."/socials?page=".$_prefixVariable1.((string)$_smarty_tpl->tpl_vars['buildQueryString']->value)), 0, false);
?>

    <?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "breadcrumb", null, null);?>
		<a href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/socials" class="breadcrumb-item"><?php if ((isset($_smarty_tpl->tpl_vars['title']->value))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8', true);
}?></a>
		<span class="breadcrumb-item active">Добавить</span>
    <?php $_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

    <?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "showBy", null, null);
$_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

    <?php $_smarty_tpl->_subTemplateRender("file:components/page-header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('buttons'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons'),'breadcrumb'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'breadcrumb'),'showBy'=>$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'showBy')), 0, false);
?>
	<!-- /page header -->

	<!-- Content area -->
    <div class="content">
        <div class="row"> 
            <div class="col-md-12">
    
    		    <div class="card border shadow-sm">
			        <div class="card-header d-flex flex-wrap">
				        <h6 class="mb-0">Основное</h6>
				        <div class="d-inline-flex ms-auto">
					        <a class="text-body" data-card-action="collapse"><i class="ph-caret-down"></i></a>
				        </div>
			        </div>
			        <div class="collapse show">
	                    <div class="card-body">

	                        <div class="row">
								<div class="col-12">
                                                                        <?php $_smarty_tpl->_subTemplateRender("file:components/fields/select.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('col'=>"col-12",'id'=>"status",'title'=>"Статус",'field'=>"social[status]",'array'=>$_smarty_tpl->tpl_vars['statuses']->value,'selected'=>(($tmp = $_smarty_tpl->tpl_vars['social']->value['status'] ?? null)===null||$tmp==='' ? 'visible' ?? null : $tmp),'class'=>"form-group mb-3"), 0, false);
?>
                                    								</div>
	                            <div class="col-md-6">
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['errorName']))) {?>text-danger<?php }?>">Название</label>
	                                    <input type="text" class="form-control" autocomplete="off" id="name" name="social[name]" value="<?php if ((isset($_smarty_tpl->tpl_vars['social']->value['name']))) {
echo htmlspecialchars((string)htmlspecialchars((string)$_smarty_tpl->tpl_vars['social']->value['name'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8', true);
}?>">
	                                </div>
	                                 <div class="form-group  mb-3">
	                                    <label class="form-label is-visible <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameEmpty'])) || (isset($_smarty_tpl->tpl_vars['errors']->value['fileNameError']))) {?>text-danger<?php }?>">Псевдоним</label>
	                                    <input type="text" class="form-control" autocomplete="off" id="fileName" name="social[fileName]" value="<?php if ((isset($_smarty_tpl->tpl_vars['social']->value['fileName']))) {
echo htmlspecialchars((string)htmlspecialchars((string)$_smarty_tpl->tpl_vars['social']->value['fileName'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8', true);
}?>">
	                                </div>
	                            </div>

	                            <div class="col-md-6">
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible">Ссылка</label>
	                                    <input type="text" class="form-control" autocomplete="off" id="url" name="social[url]" value="<?php if ((isset($_smarty_tpl->tpl_vars['social']->value['url']))) {
echo htmlspecialchars((string)htmlspecialchars((string)$_smarty_tpl->tpl_vars['social']->value['url'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8', true);
}?>" />
	                                </div>
	                                <div class="form-group mb-3">
	                                    <label class="form-label is-visible">Иконка</label>
	                                    <input type="text" class="form-control" autocomplete="off" id="icon" name="social[icon]" value="<?php if ((isset($_smarty_tpl->tpl_vars['social']->value['icon']))) {
echo htmlspecialchars((string)htmlspecialchars((string)$_smarty_tpl->tpl_vars['social']->value['icon'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8', true);
}?>"/>
	                                </div>

	                            </div>
	                        </div>
	                    </div>
                        <?php if ((isset($_smarty_tpl->tpl_vars['social']->value['addedOn'])) && (isset($_smarty_tpl->tpl_vars['social']->value['modifiedOn']))) {?>
				        <div class="card-footer hstack gap-3 justify-content-between">
					        <div class="text-muted">
						        <ul class="list list-unstyled mb-0 fs-sm">
                                    <li>Создано</li>
                                    <li>Изменено</li>
						        </ul>
					        </div>
					        <div class="hstack gap-1">
						        <ul class="list list-unstyled mb-0 fs-sm">
                                    <li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['social']->value['addedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['addedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li>
                                    <li><?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['social']->value['modifiedOn'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>
 (<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['modifiedBy']['loginName'] ?? null)===null||$tmp==='' ? "Неизвестный пользователь" ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
)</li>
						        </ul>
					        </div>
				        </div>
                        <?php }?>
			        </div>
    		    </div>
            </div>

	        <div class="col-md-12 main main_buttons text-center">
                <?php if ((isset($_smarty_tpl->tpl_vars['social']->value['socialId']))) {?><input type="hidden" class="form-control" id="id" name="id" value="<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['socialId'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
"><?php }?>
                <?php echo $_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl, 'buttons');?>

	        </div>

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

<?php echo '<script'; ?>
>
    $(document).ready(function() {
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['errorName']))) {?> new Noty({ text: 'Введите название Социальной сети.', type: 'error'}).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameEmpty']))) {?> new Noty({ text: 'Псевдоним не должен быть пустым:', type: 'error'}).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['fileNameError']))) {?> new Noty({ text: '«<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['fileName'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
» Уже существует:', type: 'error' }).show(); <?php }?>
        <?php if ((isset($_smarty_tpl->tpl_vars['errors']->value['not_saved']))) {?> new Noty({ text: '«<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['name'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
» НЕ сохранен или не были изменены', type: 'error' }).show(); <?php }?>

        <?php if ((isset($_smarty_tpl->tpl_vars['messages']->value['saved']))) {?> new Noty({ text: '«<?php echo htmlspecialchars((string)(($tmp = $_smarty_tpl->tpl_vars['social']->value['name'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp), ENT_QUOTES, 'UTF-8', true);?>
» сохранен.', type: 'success' }).show(); <?php }?>
    });
    function deleteMessage() {
        new Noty({ text: 'Соц.сеть удалена.', type: 'success' }).show();
    }
    
    $(function () {
        function e() { fileName_touched || $("#fileName").val(n()) }
        function n() { return fileName = $("#name").val(), fileName = fileName.replace(/[\s]+/gi, "<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['config']->value['filename_word_separator'], ENT_QUOTES, 'UTF-8', true);?>
"), fileName = l(fileName), fileName = fileName.replace(/[^0-9a-z_\-]+/gi, "").toLowerCase() }
        function l(e) { for (var a = "А-а-Б-б-В-в-Ґ-ґ-Г-г-Д-д-Е-е-Ё-ё-Є-є-Ж-ж-З-з-И-и-І-і-Ї-ї-Й-й-К-к-Л-л-М-м-Н-н-О-о-П-п-Р-р-С-с-Т-т-У-у-Ф-ф-Х-х-Ц-ц-Ч-ч-Ш-ш-Щ-щ-Ъ-ъ-Ы-ы-Ь-ь-Э-э-Ю-ю-Я-я".split("-"), i = "A-a-B-b-V-v-G-g-G-g-D-d-E-e-E-e-E-e-ZH-zh-Z-z-I-i-I-i-I-i-J-j-K-k-L-l-M-m-N-n-O-o-P-p-R-r-S-s-T-t-U-u-F-f-H-h-TS-ts-CH-ch-SH-sh-SCH-sch-'-'-Y-y-'-'-E-e-YU-yu-YA-ya".split("-"), t = "", n = 0, l = e.length; l > n; n++) { var o = e.charAt(n),c = a.indexOf(o);t += c >= 0 ? i[c] : o } return t }
        fileName_touched = !0, ($("#fileName").val() == n() || "" == $("#fileName").val()) && (fileName_touched = !1), $("#fileName").change( function () { fileName_touched = !0 }), $("#name").keyup( function () { e() })
    });
            
<?php echo '</script'; ?>
><?php }
}
