<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace FrontModule;
use \Nette\Application\UI\Form;
use \Nette\Utils\Image;


class SrazyPresenter extends BasePresenter {
    
    private $srazyModel;
   
    
    public function __construct(\SrazyModel $srazyModel) {
    $this->srazyModel = $srazyModel;
    }
    
    public function beforeRender() {
        $this->template->title = 'Srazy a akce';
        $this->template->description = "Srazy a akce sekce velššpringršaněl, fotogalerie.";
    }
    
   
    
    public function renderList() {
      
       
     
        $this->template->srazy = $this->srazyModel->getSrazy(); 
        
        
 }
 
  
    public function renderGalerie($id) {
      $this->template->fotky = $this->srazyModel->getFotkyByGalerieId($id);
      $galerie = $this->srazyModel->getGalerieById($id);
      $this->template->galerie = $this->srazyModel->getGalerieById($id); 
      $this->template->sraz = $this->srazyModel->getSraz($galerie->id_srazu);
       
    }
    
    
    public function renderDetail($id) {
        $this->template->sraz = $this->srazyModel->getSraz($id);
        $this->template->galerie = $this->srazyModel->getGalerieBySrazId($id);
    }
    
   
    
    

    
}
