2022-03-14 14:56:35 +01:00
|
|
|
<?php namespace ProcessWire;
|
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
/** @var Page $page API variable */
|
2022-03-14 14:56:35 +01:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = '';
|
|
|
|
$contido = '';
|
|
|
|
|
|
|
|
if($configuracion['mantemento']['activo'] && !$user->isLoggedin())
|
2022-03-14 14:56:35 +01:00
|
|
|
{
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = renderMenu($pages->get('/noticias')->and($pages->get('/contacto')));
|
2022-03-14 14:56:35 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = renderMenu($inicio->children);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($_POST['enviar']))
|
|
|
|
{
|
|
|
|
$correo = wireMail();
|
|
|
|
$correo->to($configuracion['contacto_correo']);
|
|
|
|
$correo->from($sanitizer->email($input->post->correo));
|
|
|
|
$correo->fromName($sanitizer->text($input->post->nome));
|
|
|
|
$correo->subject($sanitizer->text($input->post->asunto));
|
|
|
|
$correo->body($sanitizer->text($input->post->mensaxe));
|
|
|
|
$correo->send();
|
|
|
|
$enviado = $correo->getResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
$contido .= renderMigasPan($page) . "\n";
|
|
|
|
$contido .= '<article id="' . $page->name .'" class="container">' . "\n";
|
|
|
|
$contido .= '<h2 class="visually-hidden">' . ucfirst($page->title) . '</h2>' . "\n";
|
2022-03-14 14:56:35 +01:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= '<div class="row align-items-lg-stretch mb-5">' . "\n";
|
|
|
|
$contido .= '<div class="col-lg-7">' . "\n";
|
|
|
|
$contido .= '<div class="h-100 p-5 text-bg-light border rounded-3">' . "\n";
|
|
|
|
$contido .= '<form method="POST" id="formulario-contacto" name="formulario-contacto" action="#">' . "\n";
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-6">' . "\n";
|
|
|
|
$contido .= '<label class="form-label" for="nome">' . _x('Nome', 'name') . '</label>' . "\n";
|
|
|
|
$contido .= '<input type="text" class="form-control" name="nome" id="nome" placeholder="' . _x('Nome', 'name') . '" required>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="col-md-6">' . "\n";
|
|
|
|
$contido .= '<label class="form-label" for="correo">' . _x('Correo electrónico', 'email') . '</label>' . "\n";
|
|
|
|
$contido .= '<input type="email" class="form-control" name="correo" id="correo" placeholder="' . _x('Correo electrónico', 'email') . '" required>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-12">' . "\n";
|
|
|
|
$contido .= '<label class="form-label" for="asunto">' . _x('Asunto', 'subject') . '</label>' . "\n";
|
|
|
|
$contido .= '<input type="text" class="form-control" name="asunto" id="asunto" placeholder="' . _x('Asunto', 'subject') . '" required>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-12">' . "\n";
|
|
|
|
$contido .= '<label class="form-label" for="mensaxe">' . _x('Mensaxe', 'message') . '</label>' . "\n";
|
|
|
|
$contido .= '<textarea class="form-control" name="mensaxe" id="mensaxe" cols="30" rows="4" placeholder="' . _x('Mensaxe', 'message') . '" required></textarea>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-12">' . "\n";
|
|
|
|
$contido .= '<input type="submit" id="enviar" name="enviar" value="' . _x('Enviar mensaxe', 'send message') . '" class="btn btn-primary">' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
|
|
|
|
if(isset($enviado) && count($enviado['recipientsSuccess']))
|
|
|
|
{
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-12 alert alert-success" role="alert">' . "\n";
|
|
|
|
$contido .= 'Correo enviado.' . "\n";
|
2022-10-27 14:10:14 +02:00
|
|
|
$contido .= '</div>' . "\n";
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
}
|
|
|
|
if(isset($enviado) && count($enviado['recipientsFailed']))
|
|
|
|
{
|
|
|
|
$contido .= '<div class="row mb-3">' . "\n";
|
|
|
|
$contido .= '<div class="col-md-12 alert alert-danger" role="alert">' . "\n";
|
|
|
|
$contido .= 'Error enviado correo.' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$contido .= '</form>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="col-lg-5">' . "\n";
|
|
|
|
$contido .= '<div class="h-100 p-3 text-bg-primary border rounded-3">' . "\n";
|
|
|
|
$contido .= '<div class="row m-0 mb-3 position-relative w-100 h-100" style="padding-bottom: 56.25%;">' . "\n";
|
|
|
|
$contido .= '<iframe class="p-0 rounded position-absolute top-0 start-0 bottom-0 end-0 w-100 h-100" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d167.88206925427303!2d-8.223339!3d43.43177!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd2e759aa6d41317%3A0x25ccd67bb4c850ab!2sApartamentos%20tur%C3%ADsticos%20Praia%20de%20Seselle!5e1!3m2!1ses!2ses!4v1676985980478!5m2!1ses!2ses" style="border:0" allowfullscreen="" loading="lazy"></iframe>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
2023-03-10 19:44:38 +01:00
|
|
|
$contido .= '<div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3 py-5 justify-content-center">' . "\n";
|
|
|
|
$contido .= '<div class="feature col text-center">' . "\n";
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= '<div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">' . "\n";
|
|
|
|
$contido .= '<i class="icon-map-pin"></i>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="text">' . "\n";
|
|
|
|
$contido .= '<p class="fs-4">' . _x('Address', 'address') . ':</p>' . "\n";
|
|
|
|
$contido .= '<p>' . $configuracion['contacto_direccion'] . '</p>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
2023-03-10 19:44:38 +01:00
|
|
|
$contido .= '<div class="feature col text-center">' . "\n";
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= '<div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">' . "\n";
|
|
|
|
$contido .= '<i class="icon-phone"></i>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="text">' . "\n";
|
|
|
|
$contido .= '<p class="fs-4">' . _x('Teléfono', 'phone') . '</p>' . "\n";
|
|
|
|
$contido .= '<p><a href="tel://' . $configuracion['contacto_telefono'] . '">' . $configuracion['contacto_telefono'] . '</a></p>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
2023-03-10 19:44:38 +01:00
|
|
|
$contido .= '<div class="feature col text-center">' . "\n";
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= '<div class="feature-icon d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-2 mb-3">' . "\n";
|
|
|
|
$contido .= '<i class="icon-mail"></i>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '<div class="text">' . "\n";
|
|
|
|
$contido .= '<p class="fs-4">' . _x('Correo electrónico', 'email') . ':</p>' . "\n";
|
|
|
|
$contido .= '<p><a href="mailto:' . $configuracion['contacto_correo'] . '">' . $configuracion['contacto_correo'] . '</a></p>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</div>' . "\n";
|
|
|
|
$contido .= '</article>' . "\n";
|