<? session_start(); ?>
<? include("../includes/sesiones.php"); ?>
<? include("vars.php"); ?>
<? include("../includes/traducciones.php");?>
<!doctype html>
<?php
include("../defines.php");
include("../administracion/bd-con.php");
include("../administracion/funciones.php");
include("../includes/consultas-generales.php");
include("sql.php");
include("../includes/header.php");
require "../includes/class.phpmailer.php";
include('../includes/form_config.php');
?>
<main class="interiores <?=$seccion?>">
<section class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="titulo-articulo"><?= $row['titulo']; ?></h1>
</div>
<div class="col-md-6">
<?=$row['descripcion']?>
<br>
<form class="form-horizontal" action="<? echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="form1">
<div class="form-group row">
<label for="nombre" class="col-md-2 col-form-label"><?= $fnombre?></label>
<div class="col-md-10">
<input name="nombre" type="text" class="form-control" id="nombre" value="<?=$_POST['nombre']?>" required tabindex="1">
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-2 col-form-label"><?= $femail?></label>
<div class="col-md-10">
<input name="email" type="email" class="form-control" id="email" value="<?=$_POST['email']?>" required tabindex="2">
</div>
</div>
<div class="form-group row">
<label for="tel" class="col-md-2 col-form-label"><?= $ftel?></label>
<div class="col-md-10">
<input name="tel" type="tel" class="form-control" id="tel" value="<?=$_POST['tel']?>" tabindex="2">
</div>
</div>
<div class="form-group row">
<label for="asunto" class="col-md-2 col-form-label"><?= $fasunto?></label>
<div class="col-md-10">
<input name="asunto" type="text" class="form-control" id="asunto" value="<?=$_POST['asunto']?>" required tabindex="3">
</div>
</div>
<div class="form-group row">
<label for="mensaje" class="col-md-12 col-form-label"><?= $fmensaje?></label>
<div class="col-md-12">
<textarea name="mensaje" id="detalles" class="form-control tinymce" rows="8" tabindex="4" required><?=$_POST['mensaje']?></textarea>
</div>
</div>
<div class="form-check">
<label class="privacidad form-check-label">
<input type="checkbox" name="privacidad" class="form-check-input" value="1" required>
<?=$fprivacidad;?>
</label>
</div>
<div class="privacidad-content">
<p class="text-center"><strong><?=$rowlegal["titulo"]?></strong></p>
<?=$rowlegal["descripcion"]?>
</div>
<br>
<div class="form-group row">
<div class="col-sm-12">
<input type="submit" name="submit" class="btn btn-info btn-lg btn-block" value="<?= $enviar?>" tabindex="5">
</div>
</div>
</form>
</div>
<div class="col-md-6">
<ul itemscope itemtype="http://schema.org/LocalBusiness" class="list-unstyled list-personal">
<li itemprop="name"><?=CLIENT_NAME?></li>
<li itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"><i class="fa fa-map-marker" aria-hidden="true"></i>
<span itemprop="streetAddress"><?=$row["direccion"]?></span>
<? if ( $row["cp"] != "" ) { echo " <span itemprop='postalCode'>| " . $row["cp"] . "</span>"; } ?>
<? if ( $row["localidad"] != "" ) { echo " <span itemprop='addressLocality'>" . $row["localidad"] . "</span>"; } ?>
<? if ( $row["provincia"] != "" ) { echo " (" . $row["provincia"] . ")"; } ?>
</li>
<? if ( $row["latitud"] != "" ) { ?>
<meta itemprop="latitude" content="<?=$row["latitud"]?>" />
<meta itemprop="longitude" content="<?=$row["longitud"]?>" />
<? } ?>
<? if ( $row["tel"] != "" || $row["tel2"] != "" || $row["tel3"] != "" ) { ?>
<li itemprop="telephone"><i class="fa fa-phone" aria-hidden="true"></i> Tel.:
<? if ( $row["tel"] != "" ) { ?>
<a href="tel:<?=$row["tel"]?>"><?=$row["tel"]?></a>
<? } ?>
<? if ( $row["tel2"] != "" ) { ?>
- <a href="tel:<?=$row["tel2"]?>"><?=$row["tel2"]?></a>
<? } ?>
<? if ( $row["tel3"] != "" ) { ?>
- <a href="tel:<?=$row["tel3"]?>"><?=$row["tel3"]?></a>
<? } ?>
</li>
<? } ?>
<i class="fa fa-envelope" aria-hidden="true"></i> E-mail: <a href="mailto:<?=$row['email']?>"><?=$row['email']?></a></li>
</ul>
<br>
<div id="mapa">
<form class="form-inline form_llegar row" id="form" action="#" onsubmit="calcRoute(); return false;">
<div class="form-group col-lg-6">
<input type="text" class="form-control w-100" id="start" name="start" placeholder="ej.: Tolosa, Gipuzkoa" required />
<input name="end" type="hidden" id="end" value="<?= $latitud;?>, <?= $longitud;?>" />
</div>
<div class="form-group col-lg-6">
<input class="btn btn-info btn-inline w-100" type="submit" name="Submit" id="calcular" value="<?= $comoLlegar;?>" />
</div>
</form>
<br>
<div id="directionsPanel"></div>
<div style="width:100%; height:300px;" id="map_canvas"></div>
</div>
<br>
<div itemscope itemtype="http://schema.org/LocalBusiness">
<iframe src="https://www.google.com/maps/embed?pb=!4v1531291035043!6m8!1m7!1smLV6PH3jtnAZrDj-HWIx2g!2m2!1d43.30353744541897!2d-1.886192741432225!3f358.4382439436138!4f-2.9677301621283902!5f1.1924812503605782" width="100%" height="250" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
<?php
if( $row['foto'] != "" ){ ?>
<br>
<img class="img-fluid" src="<?=PROTOCOL.DOMAIN_NAME?>images/<?=$row['foto'];?>" alt="Foto contactar">
<? } ?>
</div>
</div>
</section>
</main>
<?php
include("../includes/footer.php");
?>
<script type='text/javascript' src='//maps.google.com/maps/api/js?key=AIzaSyDGuY0m0-b9V91efNXgg0iUpM2oJSwR5Qg'></script>
<script>
<!--
var infowindow = null;
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
window.onload = function(){
directionsDisplay = new google.maps.DirectionsRenderer();
var center = new google.maps.LatLng(<?= $latitud;?>,<?= $longitud;?>);
var myOptions = {
zoom: 16,
center: center,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL
},
scaleControl: true,
mapTypeId: google.maps.MapTypeId.SATELLITE
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel"));
var image = new google.maps.MarkerImage(
'../images/comunes/icon.png'
, new google.maps.Size(30,30)
, new google.maps.Point(0,0)
, new google.maps.Point(15,40)
, new google.maps.Size(30,30)
);
var marker = new google.maps.Marker({
position: map.getCenter()
, map: map
, title: '<? echo CLIENT_NAME; ?>'
, icon: image
})
infowindow = new google.maps.InfoWindow({
content: "<div><strong><? echo CLIENT_NAME; ?></strong><br />Tel: <a href=\"tel:<?=$row['tel']?>\"><?=$row['tel']?></a><br /></div>"
, width: 300
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
infowindow.open(map, marker);
//evento al clicar en direcciión
var mapDiv = document.getElementById('directionsPanel');
google.maps.event.addDomListener(mapDiv, 'click', moveScroll);
function moveScroll() {
//alert("ddd");
//$('html, body').animate({
// scrollTop: $("#map_canvas").offset().top
//}, 2000);
infowindow.close(map, marker);
}
}
//calcula ruta desde formulario
function calcRoute() {
var start = document.getElementById("start").value;
var end = document.getElementById("end").value;
var request = {
origin:start,
destination:end,
travelMode: google.maps.TravelMode.DRIVING
//travelMode: google.maps.TravelMode.BICYCLING
//travelMode: google.maps.TravelMode.TRANSIT
//travelMode: google.maps.TravelMode.WALKING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}
$(document).ready(function(){
$(".privacidad a").click(function(e){
event.preventDefault();
$(".privacidad-content").toggle("slow");
});
});
//-->
</script>
</body>
</html>