Files
raby/common/Controller/Web/Home.php
2020-03-02 01:05:39 -03:00

78 lines
2.6 KiB
PHP

<?php
namespace ProVM\NotariaRaby\Common\Controller\Web;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Container\ContainerInterface as Container;
use Slim\Views\Blade as View;
class Home {
public function __invoke(Request $request, Response $response, View $view, Container $container): Response {
$banner = (object) [
'titulo' => "5° NOTARÍA DE SANTIAGO\nPATRICIO RABY BENAVENTE",
'contenido' => "Gertrudis Echenique 30, of. 32, El Golf\n<span class=\"icon-metro\"></span> Metro Alcantara"
];
$suplente = (object) [
'horario' => (object) [
'titulo' => "Horario lunes a viernes\n9:30 - 13:30 | 15:30 - 18:00",
'contenido' => "La atención dentro del horario, puede verse
afectada circunstancialmente y sin previo
aviso, por encontrarse el notario cumpliendo
funciones fuera de la Notaría."
],
'datos' => (object) [
'fechas' => "DEL 1 DE ABRIL AL 15 DE MAYO",
'nombre' => "MARIA VIRGINIA\nWIELANDT COVARRUBIAS"
]
];
$links = (object) [
'documentos' => [
new Documento($container, 'Autorizaciones'),
new Documento($container, 'Declaraciones'),
new Documento($container, 'Certificados'),
new Documento($container, 'Poderes'),
new Documento($container, 'Contratos'),
new Documento($container, 'Otros')
],
'consulta' => [
new Link('Servicios de Impuestos Internos', 'http://www.sii.cl'),
new Link('Registro Civil', 'http://www.registrocivil.cl'),
new Link('Conservador de Bienes Raices', ''),
new Link('Diario Oficial', ''),
new Link('Tesorería General de la República', ''),
new Link('Fojas', '')
]
];
return $view->render($response, 'home', compact('banner', 'suplente', 'links'));
}
}
class Documento {
protected $icono;
protected $texto;
protected $uri;
public function __construct(Container $container, string $nombre) {
$this->icono = implode('/', [$container->get('urls.images'), $nombre . '.png']);
$this->texto = $nombre;
$this->uri = implode('/', [$container->get('urls.base'), 'documentos', strtolower($nombre)]);
}
public function show(): string {
return '<a href="' . $this->uri . '"><img src="' . $this->icono . '" /> ' . $this->texto . '</a>';
}
}
class Link {
protected $uri;
protected $texto;
public function __construct(string $texto, string $uri) {
$this->texto = $texto;
$this->uri = $uri;
}
public function show(): string {
return '<a href="' . $this->uri . '">' . $this->texto . '</a>';
}
}