<?php  //print_r($getProductor->getProductor); ?>
<?php  //print_r($getProductor->objDatos); ?>
 

<?php 
//echo JFactory::getApplication()->input->get('view');
foreach ($getProductor->getProductor as $p){?>
    <div class="row" itemscope itemtype="http://schema.org/LocalBusiness">
	    <div class="col-md-6 col-xs-12" id="datosProductor">
		    <h1 itemprop="name"> <?php echo $p->razonsocial;?></h1>
			  <div>
			    <p> <span class="green"> <?php print_r(JText::_('COM_PRODUCTORES_PRODUCTORES_NOMBRE'));?>:</span>
				<?php  echo $p->productornombre;?>    </p> 
				<h2><?php print_r(JText::_('COM_PRODUCTORES_PRODUCTORES_PRODUCTOS'));?></h2>
				<p id="prodProd" itemprop="makesOffer">
				<?php 
				if($getProductor->objDatos->lang == 'es'){echo  $p->prodes;}else{echo  $p->prodeu;}
				?> </p>
				<h2><?php print_r(JText::_('COM_PRODUCTORES_LEGEND_SECTOR'));?></h2>
			 
				<div class="col-md-6 col-xs-12" style="padding-top:20px;text-align:center;">
				<p> <img   src="./images/productores/sectores/<?php echo $p->sector1;?>.png" itemprop="image" alt="<?php 
				if($getProductor->objDatos->lang == 'es'){echo  $p->sectornombre;}else{echo  $p->sectornombreeus;}
				?>" title="<?php 
				if($getProductor->objDatos->lang == 'es'){echo  $p->sectornombre;}else{echo  $p->sectornombreeus;}
				?>"></p>
				<p style="text-align:center;"><?php 
				if($getProductor->objDatos->lang == 'es'){echo  $p->sectornombre;}else{echo  $p->sectornombreeus;}
				?></p>
				</div>
				
				
		</div>
		</div>
		<div class="col-md-6 col-xs-12 "  id="mapProductor" style="padding-top:20px;">
		
		<div id="map"></div>
	 <script>
// Initialize and add the map
function initMap() {
  // The location of Uluru
  var uluru = {lat: <?php echo $p->latitud;?>, lng: <?php echo $p->longitud;?>};
  // The map, centered at Uluru
  var map = new google.maps.Map(
      document.getElementById('map'), {zoom: 12, center: uluru});
  // The marker, positioned at Uluru
  var marker = new google.maps.Marker({position: uluru, map: map});
}
    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBJmPwA7ajGNtXojmtQO7SxrcN_a_NlAS8&callback=initMap">
    </script>
</div>
		<div class="col-xs-12" id="contacto">
		<h2><?php print_r(JText::_('COM_PRODUCTORES_LEGEND_CONTACTO'));?></h2>
		<p class="col-xs-12"></p>
		        <div class="col-md-6 col-xs-12 " >
				<p itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> <span class="green"><?php print_r(JText::_('COM_PRODUCTORES_COORDENADAS'));?>:</span> <span itemprop="latitude"> <?php echo $p->latitud;?> </span>,
				<span itemprop="longitude"> <?php echo $p->longitud;?> </span></p>
				
				<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> 
					
				<?php if($p->provincia==0){}else{?>	<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_PRODUCTORES_PROVINCIA'));?>:</span> <span itemprop="addressRegion"><?php echo $p->provincianombre;?> </span>
				</p> <?php } ?>
				
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_PRODUCTORES_COMARCA'));?>:</span> <?php echo $p->comarcanombre;?> </p>
				
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_PRODUCTORES_POBLACION'));?>:</span> <?php echo $p->poblacionnombre;?> </p>
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_FORM_LBL_PRODUCTOR_CP'));?>:</span> <span itemprop="postalCode"><?php echo $p->cp;?> </span></p>
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_FORM_LBL_PRODUCTOR_DIRECCION'));?>:</span> <span itemprop="streetAddress"><?php echo $p->direccion;?> </span></p>
				</span>
			

		       </div>
		       <div class="col-md-6 col-xs-12 "  id="mapaProductor">
                    <p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_FORM_LBL_PRODUCTOR_TELEFONO'));?>: </span><span itemprop="telephone"><a href="tel:<?php echo $p->telefono;?>"><?php echo $p->telefono;?></a></span></p>
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_FORM_LBL_PRODUCTOR_WEB'));?>: </span><?php echo $p->web;?></p>
				<p><span class="green"><?php print_r(JText::_('COM_PRODUCTORES_FORM_LBL_PRODUCTOR_EMAIL'));?>:</span><span itemprop="email"> <?php echo $p->email;?></span> </p>
					<p><span class="green">Facebook:</span><span > <?php echo $p->facebook;?></span> </p>
						<p><span class="green">Instagram:</span><span > <?php echo $p->instagram;?></span> </p>
		     	<p><button id="goBack" onclick="history.back()"><?php print_r(JText::_('COM_PRODUCTORES_VOLVER'));?></button></p>
			 </div>

		</div>
	</div>
	
<?php } ?>
 
 
 
 <?php  /************************
 <?php if($p->sector2 > 0){?>
				<div class="col-md-6 col-xs-12 " style="padding-top:20px;text-align:center">
				<p> <img   src="./images/productores/sectores/<?php echo $p->sector2;?>.png" itemprop="image" alt="<?php echo  $p->sector2;?>"></p>
				<p ><?php echo  $p-> sector2 ;?></p>
				</div> 
				<?php } ?>
 ******************************/
 ?>