<h2 class="section_heading" id="rights"><?=$this->t('pristup-clenu-skupiny-do-ketegorii-dokumentu-f')?></h2>
<div class="button_line">
    <a href="<?=$this->baseUrl()?>/admin/groups/add-rights-category/id/<?=$this->val($this->form, 'id_group')?>"><?=$this->t('pridat-kategorii-AF')?></a>
</div>

<?php echo $this->render('groups/part_rights.phtml'); ?>

<h2 class="section_heading" id="members"><?=$this->t('uzivatele-ve-skupine-f')?></h2>
<div class="button_line">
    <a href="<?=$this->baseUrl()?>/admin/groups/add-members/id/<?=$this->val($this->form, 'id_group')?>"><?=$this->t('pridat-uzivatele-AF')?></a>
</div>

<?php if ($this->data->count()) : ?>
	<table>
	<tr class="header">
		<td><?=$this->t('uzivatelske-jmeno-f')?></td>
		<td><?=$this->t('prijmeni-f')?> <?=$this->t('a')?> <?=$this->t('jmeno-f')?></td>
		<td><?=$this->t('e-mail-f')?></td>
		<td><?=$this->t('aktivni-ve-skupine-f')?></td>
		<td class="right"><?=$this->t('moznosti-f')?></td>
	</tr>
	<?php foreach ($this->data as $i) : ?>
	    <tr class="<?=$this->evod('odd', 'even');?>">
	        <td><?=$this->escape($i->login)?></td>
	        <td><?=$this->escape($i->user_surname . ' ' . $i->user_firstname)?></td>
	        <td><?=$this->escape($i->email)?></td>
	        <td class="<?=($i->active) ? 'active' : 'inactive';?>">
	        	<?php if ($i->active) : ?>
	        		<a href="<?=$this->baseUrl()?>/admin/groups/deactivate-member/id/<?=$this->val($this->form, 'id_group')?>/user/<?=$i->id_user?>"><?=$this->t('aktivni-AF')?></a>
	        	<?php else : ?>
	        		<a href="<?=$this->baseUrl()?>/admin/groups/activate-member/id/<?=$this->val($this->form, 'id_group')?>/user/<?=$i->id_user?>"><?=$this->t('neaktivni-AF')?></a>
	        	<?php endif; ?>    
	        </td>
	        <td class="actions">
	            <a class="action_delete" id="item_del_<?=$i->id_user?>"href="<?=$this->baseUrl()?>/admin/groups/delete-member/user/<?=$i->id_user?>/id/<?=$this->val($this->form, 'id_group')?>"><?=$this->t('vyradit-AF')?></a> 
	        </td>
	    </tr>
	    <script type="text/javascript">
				$(document).ready(function(){
					$('#item_del_<?=$i->id_user?>').attr('href', $('#item_del_<?=$i->id_user?>').attr('href') + '/thru/1');
						$('#item_del_<?=$i->id_user?>').click(function(){
							if (confirm("<?=$this->t('delete_confirm')?>"))
							{
								return true;
							} else {
								return false;
							}
						});
					});
		</script>
	<?php endforeach; ?>
	</table>
<?php else : ?>

<?php endif; ?>