<?php

/*
 * PuzzleApp
 * Webemyos
 * Jérôme Oliva
 * GNU Licence
 */

namespace Apps\estimation\Module\Front;

use Core\Control\Button\Button;
use Core\Controller\Controller;
use Core\View\View;
use Core\View\ElementView;

use Apps\estimation\Entity\estimationCity;

/*
 * 
 */

class FrontController extends Controller {

    
    function Secteur($params){
       $view = new View(__DIR__ . "/View/estimate.tpl", $this->Core);
    
       $city = new estimationCity($this->Core);
       $city = $city->GetByCode($params);
       
       if($city){         
           
         $this->Core->MasterView->Set("Title", $city->TitleEstimation->Value);
         $this->Core->MasterView->Set("Description", $city->MetaEstimationDescription->Value);
  
         $view->AddElement(new ElementView("city", $city));
           
        return $view->Render();
       } else{
           
           //RETOU PAGE D4ACUCUIE
           
       }
    }
    
    
    function Ville($params){
       $view = new View(__DIR__ . "/View/search.tpl", $this->Core);
    
       $city = new estimationCity($this->Core);
       $city = $city->GetByCode($params);
       
       if($city){         
           
         $this->Core->MasterView->Set("Title", $city->TitleImmobilier->Value);
         $this->Core->MasterView->Set("Description", $city->MetaImmobilierDescription->Value);

         
           
         $view->AddElement(new ElementView("city", $city));
           
        return $view->Render();
       } else{
           
           //RETOU PAGE D4ACUCUIE
           
       }
    }
    
}