{include file="./index_top.tpl"}
<script src="themes/clientbase/js/deletegroupitems.js?{$revision}"></script>
<script src="themes/clientbase/js/preloader.js?{$revision}"></script>
<script type="text/javascript">
    function copying_field(field_name, id, copy_href) {
        let name_field = copy_field(field_name);
        if (name_field !== null) {
            window.location.href = copy_href + '&name_field=' + name_field;
        }
        return false;
    }
    function field_dubl(field_name) {
        let res = 0;
        $.ajax({
            url: "edit_field.php",
            data: "copy_name_field=" + field_name + "&table_id=" + table_id,
            async: false,
            success: function(data) {
                res = data;
            }
        });
        return res;
    }

    function copy_field(copy_name) {
        var copy_name_ok = false;
        do {
            copy_name = prompt("{$lang.Copy_as}", copy_name);
            // Проверяем Нажали "ОК" или "отмена"
            if (copy_name != null) {
                if (!copy_name) {
                    alert('{$lang.must_enter_name_field}');
                } else if (copy_name != null) {
                    if (field_dubl(copy_name) == 1) {
                        copy_name_ok = true;
                    } else {
                        alert('{$lang.alert_name_field_exists1}' + copy_name + '{$lang.alert_name_field_exists2}');
                    }
                }
            } else {
                copy_name_ok = true; // Нажали кнопку отмены
            }
        }
        while (copy_name_ok === false);
        return copy_name;
    }

    function delete_field(field_id) {
        let titleField = $('#f_set' + field_id + ' .cb_super_user a').text().trim();
        let descAlert = '{$lang.alert_delete_field}'.replace(/\n/g, "<br>");
        let mapTexts = new Map([
            ['delete_field', 'event'],
            ['desc', descAlert],
            ['title', titleField]
        ])

        jconfirm(mapTexts,
            function() {
                $('.sortableTable').css('height',''); // фикс бага из-за которого верстка слетает
                $('#f_set'+field_id).hide();
                $.post('edit_field.php',
                    'table={$table_id}&field='+field_id+'&delete&csrf={$csrf}{if $back_url}&back_url={$base64_current_url}{/if}',
                    function(data) {
                        if (data.substr(0, 7) == 'Error: ') {
                            $('#f_set'+field_id).show();
                            jalert(data.substr(7));
                        }
                    }
                );
            }
        );
    }
</script>

<div align=center>
    <br>{$lang.fields_of_table} "{$name_table}"<span class='help_bt' h_id='Fields'></span><br><br>
    {include file="./conf_nav.tpl"}
    {if $del_err}<span class="sel__field-info-err" style="color: #f00; font-size: 13px;">{$del_err}</span><br/><br/>{/if}

    <script type="text/javascript">
        let isDeveloperMode = '{$cb_super_dev}' == 2;

        $(function () {
            $('span.mouseHoverTip').each(function () {
                {* //вставить как подсказку, в тексте подсказки возможны любые теги - "<span class='mouseHoverTip'><a tabindex="1" class='mouseHoverTipLink'></a><span class='mouseHoverAnswer'>Здесь подсказка</span></span> *}
                var myTip = $(this),
                        mouseHoverTip = myTip.find('span.mouseHoverAnswer , span.mouseHoverAnswer-left').hide();

                {* функция открытия подсказки *}
                function showTip(e) {
                    var xM, yM, tipW, tipH, scrollwinH, scrollwinW, curwinH;

                    $(document).find('span.mouseHoverAnswer , span.mouseHoverAnswer-left').hide();
                    xM = e.pageX;
                    yM = e.pageY;
                    tipW = mouseHoverTip.width();
                    tipH = mouseHoverTip.height();
                    scrollwinH = $(window).scrollTop();
                    scrollwinW = $(window).scrollLeft();
                    curwinH = $(window).scrollTop() + $(window).height();
                    if (xM > scrollwinW + tipW * 2) {
                        mouseHoverTip.removeClass('mouseHoverAnswer').addClass('mouseHoverAnswer-left');
                    } else {
                        mouseHoverTip.removeClass('mouseHoverAnswer-left').addClass('mouseHoverAnswer');
                    }
                    if (yM > scrollwinH + tipH && yM > curwinH / 2) {
                        mouseHoverTip.addClass('a-top');
                    } else {
                        mouseHoverTip.removeClass('a-top');
                    }
                    mouseHoverTip.fadeIn(100).css('display', 'block');
                    e.preventDefault();
                }
                {* вешаем событие открытия подсказки *}
                myTip.find("a[tabindex='1']").on("click", showTip);
            });

            {* isDeveloperMode *}
            $('tr[id^="f_set"]').each(function(i, tr) {
                const $tr = $(tr);

                $tr.on('mouseover', function() { showSettingsIcons($tr); })
                    .on('mouseout', function() { hideSettingsIcons($tr); });
            });

            $('.edit-field__icons--img').each(function(i, img) {
                const $img = $(img);

                $img.on('mouseover', function() {
                        $img.toggleClass('active');
                    })
                    .on('mouseout', function() {
                        $img.toggleClass('active');
                    })
                    .on('click', function() {
                        const fieldId = $img.attr('field_id'); // id поля
                        const curMode = $img.attr('mode_on'); // режим текущей настройки
                        const type = $img.attr('set_type'); // тип настройки
                        const mode = curMode == 1 ? '' : '_on'; // если выключено - включаем; если включено - выключаем
                        const newSrc = 'images/f_' + type + mode + '.png';
                        const newMode = curMode == 1 ? 0 : 1;

                        $.ajax({
                            url: 'edit_field.php',
                            type: 'POST',
                            data: { 'field': fieldId, 'type': type, 'switch': newMode, 'csrf': csrf },
                            success: function (data) {
                                if (data == 'SUCCESS') {
                                    $img.attr('src', newSrc);
                                    $img.attr('mode_on', newMode);
                                    $img.toggleClass('active');
                                }
                            },
                            error: function() {
                                alert('Ошибка сохранения. Попробуйте перейти в настройки поля');
                            }
                        });
                    });
            });
        });
        $(document).on("click", function (event) {
            {* /* вешаем события закрытия подсказки, из закрытия убраны:
              - сама картинка для клика (чтобы подсказка не закрывалась сразу после открытия) */ *}
            if (!$(event.target).hasClass('mouseHoverTipLink'))
                $(document).find('span.mouseHoverAnswer , span.mouseHoverAnswer-left').hide();
        });

        function showSettingsIcons(row) {
            $(row).find('.edit-field__icons--img').css('opacity', 1);
        }

        function hideSettingsIcons(row) {
            $(row).find('.edit-field__icons--img').css('opacity', '');
        }
    </script>

{if $user.developer_mode == 0 || $cb_super_dev==1}
  <style type="text/css">
        .sortableTable.sel_field_table tr[id^="f_set"] td:nth-child(5) {
            display: flex;
        }
  </style>
{/if}
    {if $user.developer_mode && ($user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id)}
    {if $cb_super_dev==1}
        <style type="text/css">
            .cb_super_dev {
                display: none;
            }
        </style>
        <script type="text/javascript">
            $(function () {
                $('.cb_super_dev').hide();
                $('.cb_super_user').show();
            });
        </script>
    {/if}
    {if $cb_super_dev==2}
        <style type="text/css">
            .cb_super_user {
                display: none;
            }
        </style>
        <script type="text/javascript">
            $(function () {
                $('.cb_super_dev').show();
                $('.cb_super_user').hide();
            });
        </script>
    {/if}

        <div>
            <form id="form_dev" method="post">
                <b>{$lang.display_mode} </b>
                <select class="form-control form-control-160" name="cb_super_dev" onchange="document.getElementById('form_dev').submit();">
                    <option value='1' {if $cb_super_dev==1}selected{/if}>{$lang.Simple}</option>
                    <option value='2' {if $cb_super_dev==2}selected{/if}>{$lang.Advanced}</option>
                </select>
                <input type=hidden name=csrf value='{$csrf}'>
            </form>
        </div>
    {/if}



    <form action="edit_field.php?table={$table_id}{if $back_url}&back_url={$base64_back_url}{/if}" method="post">
        <div class="preloader__block" style="height: unset; width: unset;left:50%;transform:translate(-50%, 10px);">
            <div class="preloader" style="padding-right: 100px;">
                <div class="lds-css ng-scope">
                    <div style="width:100%;height:100%" class="lds-ellipsis">
                        <div>
                            <div></div>
                        </div>
                        <div>
                            <div></div>
                        </div>
                        <div>
                            <div></div>
                        </div>
                        <div>
                            <div></div>
                        </div>
                        <div>
                            <div></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        {if count($all_fields) > 15}
            <div class="flex-wrap flex-wrap--center" style="margin: 15px 0;">
                {*<input class="btn btn-default btn-sm btnhide-whileremove" name='fields__refresh_field' type=submit value="{$lang.Refresh_range}" style="margin-right: 3px;">*}
                {if !$archive && !$add_blocked}<input class="btn btn-default btn-sm btnhide-whileremove" name='fields__add_field' type=button value="{$lang.Add_field}" style="margin-right: 3px;"
                       onClick="location.href='edit_field.php?table={$table_id}&field=-1{if $back_url}&back_url={$smarty.get.back_url}{/if}';">
                <input class="btn btn-default btn-sm btnhide-whileremove" name='fields__add_group' type=button value="{$lang.Add_group}" style="margin-right: 3px;"
                       onClick="location.href='edit_fgroup.php?table={$table_id}&group=-1{if $back_url}&back_url={$base64_current_url}{/if}';">{/if}
                {if $cb_super_dev == 2 && ($system_fields_only == 0)}
                <input class="btn btn-default btn-sm btn-selectitems" type=button value="{$lang.Select_group_field}"
                       onclick=selectGroupItems('table__group-remove','table__input-remove','btnhide-whileremove','btn-selectitems','btn-remove','btn-unselectitems')>
                <input class="btn btn-default btn-sm btn-unselectitems" type=button value="{$lang.Unselect_group_items}"
                       onclick=selectGroupItems('table__group-remove','table__input-remove','btnhide-whileremove','btn-selectitems','btn-remove','btn-unselectitems')>
                {/if}
                <input class="btn btn-default btn-sm btn-selectitemsall" type=button value="{$lang.Select_items_all}"
                       onclick=selectGroupItemsAll('table__group-remove',this)>
                <input class="btn btn-default btn-sm btn-remove" type=button value="{$lang.Delete_group_field}"
                       onclick=deleteGroupItems('table__group-remove','field',{$table_id},'fgroup')>
                <input type=hidden name=csrf value='{$csrf}' style="margin-right: 3px;">
            </div>
        {/if}
        <table class='sortableTable table__group-remove hide-while-loading sel_field_table'>
            {if $error}
                <tr class="noDrug"><td style="color:red" colspan="15" align="center">{$error}<br><br></td></tr>
            {/if}
            {foreach from=$all_fields item=one_field}
                {if $config.display_protected_elements || $one_field.blocked != 2}
                <tr id="f_set{$one_field.id}">
                    <td><span class="draggableImg"></span></td>
                    {if $one_field.type=="fgroup"}
                        <td>
                        {if $user.group_id==1 || ($user.sub_admin_rights.tables.{$table_id}==2 && $user.sub_admin_rights.allow_del) || $one_field.owner_id==$user.group_id}
                            <a class="href_post" href="edit_fgroup.php?table={$table_id}&group={$one_field.id}&delete{if $back_url}&back_url={$base64_current_url}{/if}"
                               onclick="return href_post=jconfirm('{$lang.Delete_group} &quot;{$one_field.name_field}&quot;?', this)">
                                <img alt="{$lang.delete}" title="{$lang.Delete_group}" src="images/b_drop.png" border=0>
                            </a>
                        {/if}
                        </td>
                        <td>
                        {if $user.group_id==1 || ($user.sub_admin_rights.tables.{$table_id}==2 && $user.sub_admin_rights.allow_del) || $one_field.owner_id==$user.group_id}
                            <input type=checkbox data-checkbox-remove-group-id="{$one_field.id}" class="table__input-remove">
                        {/if}
                        </td>

                        <td>
                            <input type=text size=1 name=num[{$one_field.type}_{$one_field.id}]
                                   value={$one_field.field_num} class="edit-field__field-num">
                        </td>
                        <td colspan=5 class="sel_field_fgroup">
                            <b>{$lang.Group}:</b>
                            {if $user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id}
                                <a class="cb_group_title__link" href="edit_fgroup.php?table={$table_id}&group={$one_field.id}{if $back_url}&back_url={$base64_current_url}{/if}">
                                    <b>
                                    {if $lang[$one_field.name_field]}{$lang[$one_field.name_field]}
                                    {else if $lang['conf'][$one_field.name_field]}{$lang['conf'][$one_field.name_field]}
                                    {else}{$one_field.name_field}{/if}
                                    </b>
                                </a>
                            {else}
                                <b style="color:gray;">{$one_field.name_field}</b>{/if}
                        </td>
                    {else}
                        <td align=right>
                        {if $one_field.type_field!=10 and $one_field.type_field!=11 and $one_field.type_field!=12 and $one_field.type_field!=13}
                        {if ($user.group_id==1 || ($user.sub_admin_rights.tables.{$table_id}==2 && $user.sub_admin_rights.allow_del) || $one_field.owner_id==$user.group_id) && !$one_field.blocked}
                            <a class="href_post" href="edit_field.php?table={$table_id}&field={$one_field.id}&delete{if $back_url}&back_url={$base64_current_url}{/if}"
                               onclick="href_post=false; delete_field({$one_field.id});">
                                <img alt="{$lang.delete}" title="{$lang.Delete_field}" src="images/b_drop.png" border=0>
                            </a>
                        {/if}
                        {if ($user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id) && $one_field.blocked != 2 && !$add_blocked}
                            <a class="href_post" href="edit_field.php?table={$table_id}&field={$one_field.id}&amp;copy{if $back_url}&back_url={$base64_current_url}{/if}"
                               onclick="href_post=false; copying_field('{$one_field.name_field}', {$one_field.id}, this.href);">
                                <img alt="{$lang.Copy}" title="{$lang.Copy} {$lang.field}" src="images/b_copy.png">
                            </a>
                        {/if}
                        {/if}
                        </td>

                        <td>
                            {if $one_field.type_field!=10 and $one_field.type_field!=11 and $one_field.type_field!=12 and $one_field.type_field!=13}
                            {if ($user.group_id==1 || ($user.sub_admin_rights.tables.{$table_id}==2 && $user.sub_admin_rights.allow_del) || $one_field.owner_id==$user.group_id) && !$one_field.blocked}
                            <input type=checkbox data-checkbox-remove-id={$one_field.id} class="table__input-remove">
                            {/if}
                            {/if}
                        </td>
                        <td>
                            <input type=text size=1 name=num[{$one_field.type}_{$one_field.id}]
                                   value={$one_field.field_num} class="edit-field__field-num">
                        </td>
                        <td {if $user.developer_mode}class='cb_super_user'{/if}>
                            {if ($user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $user.sub_admin_rights.tables.{$table_id}==3 || $one_field.owner_id==$user.group_id) && $one_field.blocked != 2}
                                <a class="cb_field_title__link {if $one_field.blocked}gray_link{/if}" href="edit_field.php?table={$table_id}&field={$one_field.id}{if $back_url}&back_url={$smarty.get.back_url}{/if}">
                                    <b>{$one_field.name_field}</b>
                                </a>
                            {else}
                                <b style="color:gray;">{$one_field.name_field}</b>
                            {/if}
                        </td>
                    {if $user.developer_mode && ($user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id)}
                        <th class='cb_super_dev' style='padding-left:3px;'>
                            <input type='text' onclick='this.select();' value='{$one_field.int_name}' style='cursor:pointer; width:55px; background-color:#f9f9f9; border:1px solid #EAEAEA;' readonly>
                        </th>
                        <th class='cb_super_dev' style='padding-left:3px;'>
                            <input type='text' onclick='this.select();' value="$line['{$one_field.int_name}']" style='cursor:pointer; width:95px; background-color:#f9f9f9; border:1px solid #EAEAEA;' readonly>
                        </th>
                        <th class='cb_super_dev' style='padding-left:3px;'>
                            <input type='text' onclick='this.select();' value='{$one_field.name_field}'  style='cursor:pointer; width:200px; background-color:#f9f9f9; border:1px solid #EAEAEA;' readonly>
                        </th>
                        <th class='cb_super_dev' style='padding-left:3px;'>
                            {if $one_field.blocked != 2}
                            <a href='edit_field.php?table={$table_id}&field={$one_field.id}{if $back_url}&back_url={$smarty.get.back_url}{/if}'>
                                <img alt='{$lang.Edit}' title='{$lang.Edit}' src='images/b_edit.png' border='0'>
                            </a>
                            {/if}
                        </th>
                        <script type="text/javascript">$(".cb_super_dev").hide();</script>
                    {/if}
                        <td>
                            <span style="color: grey; font-style: italic;">
                            {if $one_field.linkDescription}
                                <span class='mouseHoverTip'>
                                    <a tabindex="1" id="mouseHoverLink" class='mouseHoverTipLink'>
                                        {$one_field.type_name}
                                    </a>
                                    <span class='mouseHoverAnswer'>
                                        {$one_field.linkDescription}
                                    </span>
                                </span>
                            {elseif $one_field.type_field==4}
                                <span class='mouseHoverTip'>
                                    <a tabindex="1" id="mouseHoverLink" class='mouseHoverTipLink'>
                                        {$one_field.type_name}
                                    </a>
                                    <span class='mouseHoverAnswer'>
                                        {$one_field.type_value|nl2br}
                                    </span>
                                </span>
                            {else}
                                {$one_field.type_name}
                            {/if}
                            </span>
                        </td>
                        {*элемент внутри ячейки с align='right' сначала прелоадер, а потом через ajax подставляются ссылки*}
                        <td align='right' style="width: 40px;">
                          {if $cb_super_dev == 2}
                            <span class="fieldHelpIconsWrap preloaderBlockForCalcs preloaderBlockForCalcs{$one_field.id}" {if $user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id}group_id="1"{/if}>
                            {*{if $one_field.fieldDefaultCompare.calcs}
                                <span class='mouseHoverTip'>
                                    {if $user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id}
                                    <a title="{$lang.open} {$lang.Calcs|lower}" tabindex="1"
                                       class='fieldTipLink mouseHoverTipLink fieldTipLinkGreen'>
                                        php
                                    </a>
                                    {else}
                                        php
                                    {/if}
                                    <span class='mouseHoverAnswer'>
                                        {$one_field.fieldDefaultCompare.calcs}
                                    </span>
                                </span>
                            {/if}*}
                                <div class="preloader__block">
                                   <span class="preloader_span">php</span>
                                </div>
                            </span>
                          {/if}
                        </td>
                        <td align='left' style="width: 40px;">
                            <span class="fieldHelpIconsWrap">
                            {if $one_field.fieldDefaultCompare.javascript && $cb_super_dev == 2}
                                {if $user.group_id==1 || $user.sub_admin_rights.tables.{$table_id}==2 || $one_field.owner_id==$user.group_id}
                                    <a title="{$lang.open} javascript" class="fieldTipLink fieldTipLinkRed"
                                       onclick="open_calc('table={$table_id}&amp;field={$one_field.id}&amp;part=field_javas',0);return false;">
                                        js
                                    </a>
                                {else}
                                    <span style="margin-left: 20px;">js</span>
                                {/if}
                            {/if}
                            </span>
                        </td>
                        <td class="edit-field__icons">
                            <div class="edit-field__static-icons">
                                <img src="images/f_width.png"
                                    class="edit-field__icons--none-edit-ico{if !$one_field.fieldDefaultCompare['width']} edit-field__disabled-setting{/if}"
                                    title="{$one_field.fieldDefaultCompare['width']}" />
                                <img src="images/f_default_value.png"
                                    class="edit-field__icons--none-edit-ico {if !$one_field.fieldDefaultCompare['default_value']} edit-field__disabled-setting{/if}"
                                    title="{$one_field.fieldDefaultCompare['default_value']}" />
                            </div>
                            <div class="edit-field__icons-settings">
                                <img class="edit-field__icons--img{if $one_field.main} active{/if}" field_id="{if $one_field.blocked}-1{else}{$one_field.id}{/if}" set_type="main"
                                    mode_on="{$one_field.main}" src="images/f_main{if $one_field.main}_on{/if}.png" title="{$lang.required_field}">
                                <img class="edit-field__icons--img{if $one_field.uniq_field} active{/if}" field_id="{if $one_field.blocked}-1{else}{$one_field.id}{/if}" set_type="uniq_field"
                                    mode_on="{$one_field.uniq_field}" src="images/f_uniq_field{if $one_field.uniq_field}_on{/if}.png"
                                    title="{$lang.prevent_duplicates}" >
                                    <img class="edit-field__icons--img{if $one_field.fast_edit} active{/if}" field_id="{if $one_field.blocked}-1{else}{$one_field.id}{/if}" set_type="fast_edit"
                                        mode_on="{$one_field.fast_edit}" src="images/f_fast_edit{if $one_field.fast_edit}_on{/if}.png"
                                        title="{$lang.Fast_edit}" >
                                {if $one_field.type_field == 1}
                                    <img class="edit-field__icons--img{if $one_field.summa} active{/if}" field_id="{if $one_field.blocked}-1{else}{$one_field.id}{/if}" set_type="itog_summa"
                                        mode_on="{$one_field.summa}" src="images/f_itog_summa{if $one_field.summa}_on{/if}.png"
                                        title="{$lang.calc_total_sum}" >
                                    <img class="edit-field__icons--img{if $one_field.average} active{/if}" field_id="{if $one_field.blocked}-1{else}{$one_field.id}{/if}" set_type="average"
                                        mode_on="{$one_field.average}" src="images/f_average{if $one_field.average}_on{/if}.png" title="{$lang.calc_average}" >
                                {/if}
                            </div>
                        </td>
                    {/if}
                    {if $one_field.protected}<td><img src="images/lock.svg" style="width:13px" title="{$one_field.protect_comment}"></td>{/if}
                </tr>
                {/if}
            {foreachelse}
                <tr>
                    <td>{$lang.no_fields}</td>
                </tr>
            {/foreach}
        </table>
        <br>

        <div class="hide-while-loading">
        {*if $all_fields}<input class="btn btn-default btn-sm btnhide-whileremove" name='fields__refresh_field' type=submit value="{$lang.Refresh_range}"> {/if*}
        {if !$archive && !$add_blocked}<input class="btn btn-default btn-sm btnhide-whileremove" name='fields__add_field' type=button value="{$lang.Add_field}"
               onClick="location.href='edit_field.php?table={$table_id}&field=-1{if $back_url}&back_url={$smarty.get.back_url}{/if}';">
        <input class="btn btn-default btn-sm btnhide-whileremove" name='fields__add_group' type=button value="{$lang.Add_group}"
               onClick="location.href='edit_fgroup.php?table={$table_id}&group=-1{if $back_url}&back_url={$base64_current_url}{/if}';">{/if}
        {if $cb_super_dev == 2 && ($system_fields_only == 0)}
        <input class="btn btn-default btn-sm btn-selectitems" type=button value="{$lang.Select_group_field}"
               onclick=selectGroupItems('table__group-remove','table__input-remove','btnhide-whileremove','btn-selectitems','btn-remove','btn-unselectitems')>
        <input class="btn btn-default btn-sm btn-unselectitems" type=button value="{$lang.Unselect_group_items}"
               onclick=selectGroupItems('table__group-remove','table__input-remove','btnhide-whileremove','btn-selectitems','btn-remove','btn-unselectitems')>
        {/if}
        <input class="btn btn-default btn-sm btn-selectitemsall" type=button value="{$lang.Select_items_all}"
               onclick=selectGroupItemsAll('table__group-remove')>
        <input class="btn btn-default btn-sm btn-remove" type=button value="{$lang.Delete_group_field}"
               onclick=deleteGroupItems('table__group-remove','field',{$table_id},'fgroup')>
        <input type=hidden name=csrf value='{$csrf}'>
        </div>
    </form>
    <br>
    <br><a href="{if $back_url}{$back_url}{else}edit_tabrep.php?cat={$cat_id}{/if}">{$lang.return_to_tables}</a> | <a href="fields.php?table={$table_id}" target="_blank">{$lang.view_table}</a>
    <br>
    <br>

</div>

</div>

<script src="themes/clientbase/js/cut_title_field.js"></script>
<script src="themes/clientbase/js/edit_field.js"></script>
