<?php

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

namespace Apps\estimation\Module\DialogAdminEstimation;

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

use Apps\estimation\Entity\estimationCity;
use Apps\estimation\Widget\EstimationCityForm\EstimationCityForm;


/*
 * 
 */
 class DialogAdminEstimationController extends Controller
 {
    /**
     * Constructeur
     */
    function _construct($core="")
    {
          $this->Core = $core;
    }

    /**
     * Create
     */
    function Create()
    {
    }

    /**
     * Init
     */
    function Init()
    {
    }

    /**
     * Render
     */
    function Show($all=true)
    {
         return $this->Index();
    }
    
    /*
    * Get the home page
    */
   function Index()
   {
       $view = new View(__DIR__."/View/index.tpl", $this->Core);
       return $view->Render();
   }
   
   /***
    * Dialogue d'ajout de ville
    */
   function AddCity($cityId= ""){
       
    $estimationCityForm = new EstimationCityForm($this->Core);

    if ($cityId != "") {
        $city = new estimationCity($this->Core);
        $city->GetById($cityId);
        $estimationCityForm->Load($city);
    }

    return $estimationCityForm->Render();
       
   }
          
          /*action*/
 }?>