<link rel="stylesheet" href="{$config.site_root}/modules/api/css/style.css" type="text/css">
<div class="my_api_settings">
    <div class="top">    {$lang.modules.api.My_settings} <span class="help_bt" h_id="setting_top_api"></span></div>
    {if $status}
    {else}
        <div align="center" class="f13">
            {$lang['modules']['api']['activate']} /
            <a href="?module=api&path=forms">{$lang['modules']['api']['forms']}</a> /
            <a href="?module=api&path=config">{$lang['Settings']}</a>
        </div>
        <form>
            {if $users}
                <table class="for_table">
                    <tr>
                        <td align="right">{$lang.modules.api.select} <span class="help_bt"
                                                                           h_id="api_select_user"></span>:
                        </td>
                        <td align="left"><select name="user_api">
                                {foreach from = $users item = row}
                                    <option value="{$row['id']}">{$row.fio}</option>
                                {/foreach}
                            </select>
                        </td>
                        <td>
                            <input class="btn btn-default btn-sm" type="submit" name="save" value="{$lang.Add}">
                        </td>
                    </tr>
                </table>
            {/if}
            <input type=hidden name="csrf" value='{$csrf}'>
            <input type="hidden" name="module" value="api">
        </form>
        {if $api_user}
            <div align="center" class="top f14">{$lang.modules.api.in}</div>
            <table class="for_table">
                <tr>
                    <th align="center">{$lang.User}</th>
                    <th align="center">{$lang.modules.api.group}</th>
                    <th align="center">{$lang.modules.api.api}</th>
                    <th></th>
                </tr>
                {foreach from=$api_user item=row}
                    <tr>
                        <td>{$row.fio}</td>
                        <td>{$row.group}</td>
                        <td>{$row.password}</td>
                        <td><a class='no_border'
                               onclick='return href_post=jconfirm ("{$lang['modules']['api']['delete']}? ", this);'
                               href='{$config.site_url}/edit_modules.php?module=api&del=del&id={$row.id}'>
                                <img src='{$config.site_root}/images/b_drop.png'>
                            </a></td>
                    </tr>
                {/foreach}
            </table>
        {/if}
        {if $trial}
            <div class="trial">{$lang.modules.api.trial}</div>
        {/if}
    {/if}
</div>
<script type="text/javascript" src="{$config.site_root}/modules/api/js/script.js"></script>