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

$this->headTitle($this->projectName);
$this->placeholder('title')->set($this->t('prehled-f'));
?>
<h1 class="page_title"><?=$this->t('prehled-f')?></h1>
        <h1 class="group_title"><?=$this->t('celkovy-prehled-f')?></h1>
        
        <div class="main_inner">
            <div class="right_column">
            	<div class="right_column_item">
                    <table class="calendar_right">
                    	<tr class="first">
                    		<?php if ($this->calendar['start'] == 'sun') : ?>
                    			<td><?=$this->t('Ne-cal')?></td>
                    		<?php endif; ?>
	            				<td><?=$this->t('Po-cal')?></td>
	            				<td><?=$this->t('Ut-cal')?></td>
	            				<td><?=$this->t('St-cal')?></td>
	            				<td><?=$this->t('Ct-cal')?></td>
	            				<td><?=$this->t('Pa-cal')?></td>
	            				<td><?=$this->t('So-cal')?></td>
	            			<?php if ($this->calendar['start'] == 'mon') : ?>
                    			<td><?=$this->t('Ne-cal')?></td>
                    		<?php endif; ?>
            			</tr>
                    	<?php foreach ($this->calendar['calendar'] as $week) : ?>
                    		<tr>
                    			<?php foreach ($week as $day) : ?>
			                    	<td <?if ($day == $this->calendar['this_day']):?> class="today"<?endif;?>><?php if ($day) echo $day; else echo '&nbsp;'; ?></td>
   			                    <?php endforeach; ?>
                    		</tr>
                    	<?php $first = false; ?>
                    <?php endforeach; ?>
                    </table>
                </div>
            </div>
            
            <div class="main_text_left">
                <h2 class="section_heading"><?=$this->t('zpravy-f')?></h2>
                
                <?php if ($this->messages->count()) : ?>
                <table>
                	<?php foreach ($this->messages as $i) : ?>
                    <tr class="<?=$this->evod('odd', 'even');?>">
                        <td <? if (!$i->is_read) echo 'class="bold"'?>><a href="<?=$this->baseUrl()?>/messages/detail/id/<?=$i->id_message?>"><?=$this->date($i->datetime)?></a></td>
                        <td <? if (!$i->is_read) echo 'class="bold"'?>><?=$this->time($i->datetime)?></td>
                        <td <? if (!$i->is_read) echo 'class="bold"'?>><?=$this->escape($i->user_surname . ' ' . $i->user_firstname)?></td>
                        <td <? if (!$i->is_read) echo 'class="bold"'?>><a href="<?=$this->baseUrl()?>/messages/detail/id/<?=$i->id_message?>"><?=$this->escape($i->subject);?></a></td>
                        <td class="actions">
                            <a class="action_read" href="<?=$this->baseUrl()?>/messages/detail/id/<?=$i->id_message?>"><?=$this->t('cist-AF')?></a>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                    <?php $this->evod('','', 1);?>
                </table>
                <?php else: ?>
                <div class="info_box"><?=$this->t('zadne-nove-zpravy-f')?>.</div>
                <?php endif; ?>
                
                
                <h2 class="section_heading"><?=$this->t('nove-verze-f')?></h2>
                
                <?php if ($this->verconf->count()) : ?>
                <table>
                	<?php foreach ($this->verconf as $i) : ?>
                    <tr class="<?=$this->evod('odd', 'even');?>">
                        <td><a href="<?=$this->baseUrl()?>/documents/detail/id/<?=$i->id_document?>"><?=$i->doc_name?></a></td>
                        <td><?=$this->t('verze')?>: <?=number_format($i->ver_number, 1, '.', '')?></td>
                        <td class="actions">
                            <a class="action_read" href="<?=$this->baseUrl()?>/confirmations/version-confirm/id/<?=$i->id_version_confirm?>"><?=$this->t('potvrdit-AF')?></a>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                    <?php $this->evod('','', 1);?>
                </table>
                <?php else: ?>
                <div class="info_box"><?=$this->t('zadne-nove-verze-f')?>.</div>
                <?php endif; ?>
                
                <h2 class="section_heading"><?=$this->t('nove-revize-f')?></h2>
                
                <?php if ($this->revconf->count()) : ?>
                <table>
                	<?php foreach ($this->revconf as $i) : ?>
                    <tr class="<?=$this->evod('odd', 'even');?>">
                        <td><a href="<?=$this->baseUrl()?>/documents/detail/id/<?=$i->id_document?>"><?=$i->doc_name?></a></td>
                        <td><?=$this->t('revize')?>: <?=$i->ver_number . '.' . $i->rev_number?></td>
                        <td class="actions">
                            <a class="action_read" href="<?=$this->baseUrl()?>/confirmations/revision-confirm/id/<?=$i->id_revision_confirm?>"><?=$this->t('potvrdit-AF')?></a>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                    <?php $this->evod('','', 1);?>
                </table>
                <?php else: ?>
                <div class="info_box"><?=$this->t('zadne-nove-revize-f')?>.</div>
                <?php endif; ?>
            </div>
        </div>