<?php
/**
 * @author Lukas Havlicek
 * @version 1.0
 */

$this->headTitle($this->projectName);
$this->placeholder('title')->set($this->t('uzivatele-f'));
?>

<h1 class="page_title"><?=$this->t('uzivatele-f')?></h1>
        <h1 class="group_title"><?=$this->t('dokumenty-ke-kterym-ma-pristup-uzivatel-f')?> <?=$this->item->user_firstname . ' ' . $this->item->user_surname?></h1>
            <div class="main_inner2">
    			<div class="main_inner">
    			
    				 <div class="left_column">
    	                <div class="left_column_item">
    	                    <?=$this->action('left-menu', 'layout', 'admin', array('leftmenu' => $this->leftmenu)); ?>
    	                </div>
    	            </div>
    	            
    				<div class="main_text_right">
    				    
                        <h2 class="section_heading"><?=$this->t('dokumenty-ke-kterym-ma-pristup-uzivatel-f')?> <?=$this->item->user_firstname . ' ' . $this->item->user_surname?></h2>
                        
                        
                        <?php if (count($this->data)) : ?>
                        	<div class="button_line">
                            	<a href="<?=$this->baseUrl()?>/admin/users/edit/id/<?=$this->item->id_user?>"><?=$this->t('zpet-AF')?></a>
                        	</div>
                        
	                        <table>
                        	<tr class="header">
                        		<td><?=$this->t('nazev-dokumentu-f')?></td>
                        		<td><?=$this->t('kategorie-f')?></td>
                        		<td><?=$this->t('pristup-diky-clenstvi-ve-skupinach-f')?></td>
                        	</tr>
                        	<?php foreach ($this->data as $i) : ?>
	                            <tr class="<?=$this->evod('odd', 'even');?>">
	                                <td><?=$this->escape($i['doc_name'])?></td>
	                                <td><?=$this->escape($i['category_name'])?></td>
	                                <td>
	                                	<?php $first = true; ?>
	                                	<?php foreach ($i['group_name'] as $k => $j) : ?>
	                                		<?=($first) ? '' : ', '?><a href="<?=$this->baseUrl()?>/admin/groups/edit/id/<?=$k?>"><?=trim($j)?></a>
	                                		<? $first = false; ?>
	                                	<?php endforeach; ?>
	                                
	                                </td>
	                            </tr>
	                            
	                        <?php endforeach; ?>
	                        </table>
                        <?php else : ?>
                        	<div class="info_box"><?=$this->t('uzivatel-nema-pristup-k-zadnemu-dokumentu')?>.</div>
                        <?php endif; ?>
                        <div class="button_line">
                            <a href="<?=$this->baseUrl()?>/admin/users/edit/id/<?=$this->item->id_user?>"><?=$this->t('zpet-AF')?></a>
                        </div>
                    </div>
    			
    			</div>
			</div>