<div class="header">Przepisywanie</div>
    
<br />
<form action="{url user=AjaxJoin type=$type}" method="post" id="userJoin" class="avfo">
	{foreach from=$ids item=id}
		<input type="hidden" name="{$type}[]" value="{$id}">
	{/foreach}
        <table class="adminTable" cellpadding="2" cellspacing="2" style="width: 600px;" align="center">
            <thead>
            <tr>
			<th></th>
            <th width="20">lp.</th>
            <th>{tableSort field=login title='Login'}</th>
            <th>{tableSort field=email title='email'}</th>
            <th>{tableSort field=role title='Rola'}</th>
            <th>{tableSort field=last_login title='Ostatnio zalogowany'}</th>
            <th class="light"><a href="{url _value=user,add}">dodaj</a></th>
            </tr>
            </thead>
            <tbody>
            {assign var=x value=1}
            {foreach item=userObj from=$UserList}
            {assign var=userId value=$userObj->getId()}
            <tr {if $x==1}{assign var=x value=0}{else}{assign var=x value=1}class="even"{/if}>
				<td> <input type="checkbox" name="admin[]" value="{$userObj->getId()}"> </td>
                <td align="right"> {$userObj->GetId()} </td>
                <td> {$userObj->getLogin()} </td>
                <td align="center"> {$userObj->GetEmail()} </td>
                <td align="center"> {$userObj->GetRole()} </td>
                <td align="center"> {$userObj->GetLastLogin()} </td>
                <td align="center"> <a href="{url _value=user,edit,id,$userId}">edycja</a> | <a href="{url _value=user,delete,id,$userId}" onclick="{literal}if(confirm('Czy napewno usunąć tego użytkownika?')){return true;}else{return false;}{/literal}">usuń</a></td>
            </tr>            

            {/foreach}
			<tr>
				<td colspan="7">
					<input type="submit" value="zaznacz wszytkie" onclick="{literal}$$('input').each(function(e){ if(e.type == 'checkbox') e.checked = 1; });return false;{/literal}"> <input type="submit" value="edytuj"> <input type="submit" value="przypisz"> <input type="submit" value="moderuj">
				</td>
			</tr>
            </tbody>          
        </table>
</form>
  