{include file="adm-header.tpl"}
<div class="content">
{if $error != null}<div class="error">{$error}</div>{/if}
{if $success != null}<div class="success">{$success}</div>{/if}
<table width="100%" cellspacing="2" cellpadding="2" style="margin-top: 5px;">
<tr class="th_1"><td colspan="6" >Administracja  </td></tr>
        <tr class="td_list_title">
                <td width="5%">lp</td>
                <td width="10%">login</td>
                <td width="10%">dane osobowe</td>
                <td width="10%">funkcja</td>
                <td width="10%">ostatnie logowanie</td>
                <td width="5%">opcje</td>
        </tr>
        {assign var='i' value='0'}
        {foreach from=$admins item=A}
        {assign var='i' value=$i+1}
        <tr class="{if $i%2 == 0}td_list_a{else}td_list_b{/if}" onmouseover="style.backgroundColor='#a9a7a7'" onmouseout="style.backgroundColor='#f6f4f4'">
                <td width="5%">{$i}</td>
                <td width="10%" align="left">&nbsp; {$A.login}</td>
                <td width="10%" align="left">&nbsp; {$A.name}</td>
                <td width="10%" align="left">&nbsp; {if $A.function == 'admin'} Administrator {/if} {if $A.function == 'mod'} Moderator {/if} </td>
                <td width="10%" align="left">&nbsp; {$A.date_login}</td>
                <td width="5%">
                        {if $A.block == 1}
                        <a onclick="location.href='administrator.php?mod=admins&act=unlock&id={$A.id}'" style="cursor: pointer;"><img src="../img/admin-lock-open.png" border="0" class="img" /></a>
                        {else}
                        <a onclick="location.href='administrator.php?mod=admins&act=lock&id={$A.id}'" style="cursor: pointer;"><img src="../img/admin-lock.png" border="0" class="img" /></a>
                        {/if}
                        <a onclick="location.href='administrator.php?mod=admins&act=edit&id={$A.id}'" style="cursor: pointer;"><img src="../img/admin-edit.png" border="0" class="img" /></a>
                        <a onclick="location.href='administrator.php?mod=admins&act=delete&id={$A.id}'" style="cursor: pointer;"><img src="../img/admin-delete.png" border="0" class="img" /></a>
                </td>
        </tr>
        {/foreach}
</table>
<br />
{if isset($edit)}
{foreach from=$admin_edit item=Ad}
<form action="administrator.php?mod=admins&act=edit&id={$id}" method="post">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Edycja administracji ==> {$Ad.login} </td></tr>
        <tr>
                <td class="td_1">Login</td>
                <td class="td_2"><input type="text" name="login" value="{$Ad.login}" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Nowe hasło</td>
                <td class="td_2"><input type="text" name="pass" value="" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Dane osobowe</td>
                <td class="td_2"><input type="text" name="dane" value="{$Ad.name}" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Funkcja</td>
                <td class="td_2">
                        <select name="fun">
                                <option value="">- Wybierz</option>
                                <option value="admin" {if $Ad.function == 'admin'}SELECTED{/if}>- Administrator</option>
                        </select>
                </td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="edit_admins" value="ok" /><input type="submit" class="submit" value=" Zapisz " /></td>
        </tr>
</table>
</form>
{/foreach}
{else}
<form action="administrator.php?mod=admins" method="post">
<table width="100%" cellspacing="2" cellpadding="2" >
<tr class="th_1"><td colspan="2" >Nowa administracja </td></tr>
        <tr>
                <td class="td_1">Login</td>
                <td class="td_2"><input type="text" name="login" value="" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Hasło</td>
                <td class="td_2"><input type="text" name="pass" value="" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Dane osobowe</td>
                <td class="td_2"><input type="text" name="dane" value="" style="width: 400px;" /></td>
        </tr>
        <tr>
                <td class="td_1">Funkcja</td>
                <td class="td_2">
                        <select name="fun">
                                <option value="">- Wybierz</option>
                                <option value="admin">- Administrator</option>
                          
                        </select>
                </td>
        </tr>
        <tr>
                <td><br /><input type="hidden" name="add_admins" value="ok" /><input type="submit" class="submit" value=" Zapisz " /></td>
        </tr>
</table>
</form>
{/if}
</div>
{include file="adm-footer.tpl"}
