<?php
/* Smarty version 4.5.2, created on 2024-06-10 12:29:01
  from '/Users/nikolaimv/Sites/admin.panel.11.loc/admin/templates/views/users/developers.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.2',
  'unifunc' => 'content_6666ab3ddc9b62_18686077',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '44035d45c07c71e666488dfb090bff8f17080964' => 
    array (
      0 => '/Users/nikolaimv/Sites/admin.panel.11.loc/admin/templates/views/users/developers.tpl',
      1 => 1711623565,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:module/show-by.tpl' => 1,
    'file:components/page-header.tpl' => 1,
    'file:module/pagination.tpl' => 1,
  ),
),false)) {
function content_6666ab3ddc9b62_18686077 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/Users/nikolaimv/Sites/admin.panel.11.loc/includes/composer/vendor/smarty/smarty/libs/plugins/modifier.date_format.php','function'=>'smarty_modifier_date_format',),));
?>

	<!-- Page header -->
	<?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "buttons", null, null);?>
		<a class="btn btn-sm btn-primary mx-1" data-bs-popup="tooltip" title="Добавить администратора" data-bs-placement="auto" href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/developer?action=add<?php if (!empty($_smarty_tpl->tpl_vars['page']->value)) {?>&page=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['page']->value, ENT_QUOTES, 'UTF-8', true);
}?>"><i class="icon-plus3"></i></a>
	<?php $_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>
	<?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);?>
/developers" 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>
	<?php $_smarty_tpl->smarty->ext->_capture->close($_smarty_tpl);?>

	<?php $_smarty_tpl->smarty->ext->_capture->open($_smarty_tpl, "showBy", null, null);?>
	    <?php $_smarty_tpl->_subTemplateRender("file:module/show-by.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('url'=>((string)$_smarty_tpl->tpl_vars['adminUrl']->value)."/developers"), 0, false);
?>
	<?php $_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 -->

	<div class="content">

	    <div class="card border shadow-sm">
		    <div class="">
		        <table class="table table-togglable table-xs table-striped table-hover managers-archive" id="managers">
	            <thead>
	                <tr>
						<th class="text-start gridjs-th-sort main-th-col-sortable" onclick="tableSort(this, '<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['module']->value, ENT_QUOTES, 'UTF-8', true);?>
'); return false;" data-sort-by="fullName" data-sort-order="<?php if ((isset($_smarty_tpl->tpl_vars['sortOrder']->value['column'])) && $_smarty_tpl->tpl_vars['sortOrder']->value['column'] == 'fullName') {
if ($_smarty_tpl->tpl_vars['sortOrder']->value['sort'] == 'asc') {?>desc<?php } else { ?>asc<?php }
} else { ?>asc<?php }?>">Менеджеры <button class="gridjs-sort gridjs-sort-<?php if ((isset($_smarty_tpl->tpl_vars['sortOrder']->value['column'])) && $_smarty_tpl->tpl_vars['sortOrder']->value['column'] == 'fullName') {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['sortOrder']->value['sort'], ENT_QUOTES, 'UTF-8', true);
} else { ?>neutral<?php }?>"></button></th>
						<th class="text-start gridjs-th-sort main-th-col-sortable" onclick="tableSort(this, '<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['module']->value, ENT_QUOTES, 'UTF-8', true);?>
'); return false;" data-sort-by="email" data-sort-order="<?php if ((isset($_smarty_tpl->tpl_vars['sortOrder']->value['column'])) && $_smarty_tpl->tpl_vars['sortOrder']->value['column'] == 'email') {
if ($_smarty_tpl->tpl_vars['sortOrder']->value['sort'] == 'asc') {?>desc<?php } else { ?>asc<?php }
} else { ?>asc<?php }?>">Email <button class="gridjs-sort gridjs-sort-<?php if ((isset($_smarty_tpl->tpl_vars['sortOrder']->value['column'])) && $_smarty_tpl->tpl_vars['sortOrder']->value['column'] == 'email') {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['sortOrder']->value['sort'], ENT_QUOTES, 'UTF-8', true);
} else { ?>neutral<?php }?>"></button></th>
	                    <th data-toggle="true">Тип</th>
	                    <th data-toggle="true">Статус</th>
	                    <th class="text-center text-muted" width="30">
							<div class="btn-group">
								<a href="javascript:void(0);" class="align-items-center text-body dropdown-toggle" data-bs-toggle="dropdown"><i class="ph-gear"></i></a>
								<div class="dropdown-menu" style="">
									<button class="dropdown-item" onclick="clearTableSort(this, '<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['module']->value, ENT_QUOTES, 'UTF-8', true);?>
'); return false;" type="button"><i class="ph-check me-2"></i>Сбросить сортировку</button>
								</div>
							</div>
						</th>
	                </tr>
	            </thead>
	            <?php if ((isset($_smarty_tpl->tpl_vars['managers']->value))) {?>
	            <tbody>
	                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['managers']->value, 'manager', false, NULL, 'managers', array (
  'iteration' => true,
));
$_smarty_tpl->tpl_vars['manager']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['manager']->value) {
$_smarty_tpl->tpl_vars['manager']->do_else = false;
$_smarty_tpl->tpl_vars['__smarty_foreach_managers']->value['iteration']++;
?>
	                <tr id="manager-<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['userId'], ENT_QUOTES, 'UTF-8', true);?>
" class="">
	                    <td class="text-nowrap">
	                        <div class="d-flex align-items-center">
								<div class="status-indicator-container me-3">
									<img src="<?php if ((isset($_smarty_tpl->tpl_vars['manager']->value['image']))) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['image']['medium'], ENT_QUOTES, 'UTF-8', true);
} else { ?>/admin/assets/img/no_images.jpg<?php }?>" class="rounded-circle" width="40" height="40">
									<span class="status-indicator <?php if ($_smarty_tpl->tpl_vars['manager']->value['status'] == 1) {?>bg-success<?php } elseif ($_smarty_tpl->tpl_vars['manager']->value['status'] == 1) {?>bg-slate<?php } elseif ($_smarty_tpl->tpl_vars['manager']->value['status'] == 2 || $_smarty_tpl->tpl_vars['manager']->value['status'] == 3) {?>bg-danger<?php } elseif ($_smarty_tpl->tpl_vars['manager']->value['status'] == 4 || $_smarty_tpl->tpl_vars['manager']->value['status'] == 5) {?>bg-primary <?php } else { ?>bg-grey<?php }?> mr-1"></span>
								</div>
								<div>
									<a href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/developer?action=edit&id=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['userId'], ENT_QUOTES, 'UTF-8', true);?>
" class="text-body fw-semibold letter-icon-title"><?php if (!empty($_smarty_tpl->tpl_vars['manager']->value['fullName'])) {
echo $_smarty_tpl->tpl_vars['manager']->value['fullName'];
}?></a>
									<div class="d-flex align-items-center text-muted fs-sm">
										<?php echo htmlspecialchars((string)smarty_modifier_date_format($_smarty_tpl->tpl_vars['manager']->value['last_login'],"%d.%m.%Y %H:%M"), ENT_QUOTES, 'UTF-8', true);?>

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

	                    <td class="text-nowrap"><?php if (!empty($_smarty_tpl->tpl_vars['manager']->value['email'])) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['email'], ENT_QUOTES, 'UTF-8', true);
} else { ?>Email не указан<?php }?></td>
	                    <td class="text-nowrap"><?php echo htmlspecialchars((string)call_user_func_array($_smarty_tpl->registered_plugins[ 'modifier' ][ 'upper' ][ 0 ], array( $_smarty_tpl->tpl_vars['manager']->value['accessLevelName'] )), ENT_QUOTES, 'UTF-8', true);?>
</td>
	                    <td class="text-nowrap"><?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['statusName'], ENT_QUOTES, 'UTF-8', true);?>
</td>
	                    <td class="text-start">
	                        <div class="d-inline-flex">
		                        <a class="text-primary" data-bs-popup="tooltip" title="Редактировать" data-bs-placement="auto" href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/developer?action=edit&id=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['userId'], ENT_QUOTES, 'UTF-8', true);
if (!empty($_smarty_tpl->tpl_vars['page']->value)) {?>&page=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['page']->value, ENT_QUOTES, 'UTF-8', true);
}
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['buildQueryString']->value, ENT_QUOTES, 'UTF-8', true);?>
"><i class="ph-note-pencil me-2"></i></a>
								<div class="dropdown">
	                                <?php if ((isset($_smarty_tpl->tpl_vars['__smarty_foreach_managers']->value['iteration']) ? $_smarty_tpl->tpl_vars['__smarty_foreach_managers']->value['iteration'] : null) > 2) {?>
		                            <a class="text-body" data-bs-toggle="dropdown"><i class="ph-list"></i></a>
		                            <div class="dropdown-menu dropdown-menu-end">
										<a class="dropdown-item" href="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['adminUrl']->value, ENT_QUOTES, 'UTF-8', true);?>
/developer?action=edit&id=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['userId'], ENT_QUOTES, 'UTF-8', true);
if (!empty($_smarty_tpl->tpl_vars['page']->value)) {?>&page=<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['page']->value, ENT_QUOTES, 'UTF-8', true);
}
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['buildQueryString']->value, ENT_QUOTES, 'UTF-8', true);?>
"><i class="ph-note-pencil me-2"></i>Редактировать</a>
										<div class="dropdown-divider"></div>
										<button class="dropdown-item text-danger" onclick="remove(<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['userId'], ENT_QUOTES, 'UTF-8', true);?>
, '<?php if (!empty($_smarty_tpl->tpl_vars['manager']->value['fullName'])) {
echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['manager']->value['fullName'], ENT_QUOTES, 'UTF-8', true);
}?>', 'developers')"><i class="ph-trash me-2"></i>Удалить</button>
									</div>
	                                <?php }?>
								</div>
							</div>
	                    </td>
	                </tr>
	            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
	            </tbody>

	            <?php } else { ?>
	            <tbody><tr class="odd"><td class="text-center" colspan="5">- Не найдено -</td></tr></tbody>
	            <?php }?>
	        </table>
		    </div>
	        <?php $_smarty_tpl->_subTemplateRender("file:module/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array('url'=>((string)$_smarty_tpl->tpl_vars['adminUrl']->value)."/developers",'params'=>((string)$_smarty_tpl->tpl_vars['buildQueryString']->value)), 0, false);
?>
	    </div>
	</div>

	<?php echo '<script'; ?>
>

	    function deleteSuccess(id) {
	        new Noty({ text: 'Менеджер удален.', layout: 'topRight', type: 'success', timeout: 1500 }).show();
	        removeElement(id, 'manager');
	    }

	    function deleteError() {
	        new Noty({ text: 'Менеджер не удален.', layout: 'topRight', type: 'error' }).show();
	    }

	    function userNotFound() {
	        new Noty({ text: 'Менеджер не найден.', layout: 'topRight', type: 'error' }).show();
	    }

	    function notDeleteAdministrator() {
	        new Noty({ text: 'Невозможно удалить или изменить уровень доступа менеджера, т.к. остался всего один менеджер с правами администратора.', layout: 'topRight', type: 'error' }).show();
	    }

	    function notDeleteDeveloper() {
	        new Noty({ text: 'Невозможно удалить или изменить уровень доступа менеджера, т.к. остался всего один менеджер с правами разработчика.', layout: 'topRight', type: 'error' }).show();
	    }



	<?php echo '</script'; ?>
>



<?php }
}
