Cambios en titulo, en boton fojas, y en indices online
This commit is contained in:
@ -4,6 +4,7 @@ namespace ProVM\NotariaRaby\Common\Controller\Web\Admin;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use Carbon\Carbon;
|
||||
use ProVM\Common\Service\Filemanager;
|
||||
|
||||
class Admin {
|
||||
@ -17,7 +18,13 @@ class Admin {
|
||||
'activo' => false
|
||||
];
|
||||
}
|
||||
$months = (object) ['full' => [], 'short' => []];
|
||||
$m = Carbon::createFromDate(0, 1, 1);
|
||||
for ($i = 0; $i < 12; $i ++) {
|
||||
$months->full []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMMM'));
|
||||
$months->short []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMM'));
|
||||
}
|
||||
$transparencia = $filemanager->folder('data')->load('transparencia.yml')->activo;
|
||||
return $view->render($response, 'admin.admin', compact('aviso', 'transparencia'));
|
||||
return $view->render($response, 'admin.admin', compact('aviso', 'transparencia', 'months'));
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,12 @@ class Documentos {
|
||||
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.upload'),
|
||||
$post['filename'] . '.pdf'
|
||||
$post['filename']
|
||||
]);
|
||||
if (isset($post['month'])) {
|
||||
$filename .= '_' . implode('_', array_reverse(explode(' ', $post['month'])));
|
||||
}
|
||||
$filename .= '.pdf';
|
||||
$file->moveTo($filename);
|
||||
$status = (file_exists($filename) and filemtime($filename) == time());
|
||||
|
||||
|
@ -1,28 +1,45 @@
|
||||
<?php
|
||||
namespace ProVM\NotariaRaby\Common\Controller\Web;
|
||||
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Slim\Views\Blade as View;
|
||||
use Nette\Mail\SendmailMailer as Mailer;
|
||||
use Nette\Mail\Message;
|
||||
|
||||
class Contacto {
|
||||
public function __invoke(Request $request, Response $response, View $view): Response {
|
||||
$google = (object) [
|
||||
'api' => ''
|
||||
];
|
||||
$map = (object) [
|
||||
'lat' => -33.415938,
|
||||
'long' => -70.591688
|
||||
];
|
||||
$url = 'https://www.google.com/maps/embed/v1/place?q=notaria+patricio+raby&key=AIzaSyBFw0Qbyq9zTFTd-tUY6dZWTgaQzuU17R8';
|
||||
$url = 'https://maps.google.com/maps?hl=es&q=Notaria%20Patricio%20Raby+(Notaria%20Patricio%20Raby)&ie=UTF8&z=16&iwloc=B&output=embed';
|
||||
public function __invoke(Request $request, Response $response, View $view, Container $container): Response {
|
||||
$url = $container->get('urls.map');
|
||||
return $view->render($response, 'contacto', compact('url'));
|
||||
}
|
||||
public function formulario(Request $request, Response $response): Response {
|
||||
public function formulario(Request $request, Response $response, Mailer $mailer, Container $container): Response {
|
||||
$post = $request->getParsedBody();
|
||||
|
||||
$body = [];
|
||||
foreach ($post as $key => $val) {
|
||||
$body []= $key . ': ' . $val;
|
||||
}
|
||||
$body = implode(PHP_EOL, $body);
|
||||
$subject = 'Contacto Web - ' . $post['nombre'];
|
||||
|
||||
$message = $container->make(Message::class)
|
||||
->setFrom($post['email'], $post['nombre'])
|
||||
->addTo($container->get('email.recepcion'))
|
||||
->addCc($container->get('email.administrativo'))
|
||||
->setSubject($subject)
|
||||
->setBody($body)
|
||||
->setHTMLBody(nl2br($body));
|
||||
//$mailer->send($message);
|
||||
|
||||
$output = [
|
||||
'informacion' => $post
|
||||
'informacion' => $post,
|
||||
'mail' => [
|
||||
'to' => $container->get('email.recepcion'),
|
||||
'cc' => $container->get('email.administrativo'),
|
||||
'asunto' => $subject,
|
||||
'mensaje' => $body
|
||||
]
|
||||
];
|
||||
$response->getBody()->write(json_encode($output));
|
||||
return $response
|
||||
|
@ -5,15 +5,16 @@ 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;
|
||||
use Carbon\Carbon;
|
||||
use ProVM\Common\Service\Filemanager;
|
||||
|
||||
class Home {
|
||||
public function __invoke(Request $request, Response $response, View $view, Filemanager $manager, Container $container): Response {
|
||||
$banner = (object) [
|
||||
'titulo' => "5° NOTARÍA DE SANTIAGO\nPATRICIO RABY BENAVENTE",
|
||||
'titulo' => "5° NOTARÍA DE SANTIAGO",
|
||||
'contenido' => "Gertrudis Echenique 30, of. 32, El Golf\n<i class=\"large icon icon-metro\"></i> Metro Alcantara"
|
||||
];
|
||||
|
||||
|
||||
$links = $manager->folder('data')->load('documentos.yml');
|
||||
array_walk($links->documentos, function(&$item) use ($container) {
|
||||
$item = new Documento($container, $item->texto, $item->uri, $item->icono);
|
||||
@ -23,7 +24,13 @@ class Home {
|
||||
});
|
||||
$aviso = $manager->folder('data')->load('aviso.yml');
|
||||
$transparencia = $manager->folder('data')->load('transparencia.yml')->activo;
|
||||
return $view->render($response, 'home', compact('banner', 'aviso', 'links', 'transparencia'));
|
||||
$months = (object) ['full' => [], 'short' => []];
|
||||
$m = Carbon::createFromDate(0, 1, 1);
|
||||
for ($i = 0; $i < 12; $i ++) {
|
||||
$months->full []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMMM'));
|
||||
$months->short []= ucwords($m->copy()->addMonths($i)->locale('es_ES')->isoFormat('MMM'));
|
||||
}
|
||||
return $view->render($response, 'home', compact('banner', 'aviso', 'links', 'transparencia', 'months'));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user