File: /home/slyfwmm/incastiglionfiorentino/wp-content/themes/amplify/scheda_strutture.php
<?php
/**
* Template Name: Scheda Strutture
*
* Template per mostrare scheda della struttura
*/
get_header(); ?>
<div id="main_container">
<!-- IE7 float fix --><!--[if lt IE 7]><span class="iefix">.</span><![endif]-->
<div class="main">
<div class="entries_full">
<div class="entry_full">
<div class="box_twothirds mt35 pr60">
<?php $count = 0; ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<!-- displays the blog posts -->
<?php $count++; if($count > 3) { $count = 1; } ?>
<h3 class="<?php if($count > 1) echo "mt25 "; ?>mb12"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div id="tassonomie-sotto-titolo"><div id="icona-tassonomia"><img src="<?php echo get_template_directory_uri(); ?>/images/tipo.jpg" /></div><div class="meta" style="margin-bottom: 20px; float: left;"><?php _e(get_the_term_list( get_the_ID(), 'inserzione', "" )) ?></div>
<div id="icona-tassonomia" style="margin-left: 20px;"><img src="<?php echo get_template_directory_uri(); ?>/images/location.jpg" /></div><div class="meta"><?php _e(get_the_term_list( get_the_ID(), 'locazione', "" )) ?></div></div>
<?php if(get_field('large_image_value') != NULL || get_field('fullsize_value') != NULL)
{ ?>
<div class="mag_blog"><!-- magnifying glass div -->
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php if(get_field('large_image_value') != NULL) {echo get_field('large_image_value');} else {echo get_field('fullsize_value');} ?>&h=213&w=600&zc=1" alt="<?php the_title(); ?>" /></a>
</div><!-- end magnifying glass div -->
<?php } ?>
<?php
$struttura_id=get_the_ID();
$metakey = 'id-galleria';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
$gallery = "[nggallery id=" . $s . "]";
echo do_shortcode($gallery);
}
}
}
?>
<?php
$metakey = 'logo';
$logo = "";
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
$tit = get_the_title();
$logo = "<div id=\"logo-struttura\">" . "<img src=\"". $s . "\" alt=\"" . $tit . " - Castiglion Fiorentino - Arezzo\" title=\"" . $tit . " - Castiglion Fiorentino - Arezzo\" />" . "</div>";
}
}
}
if($logo != "")
{ ?>
<div id="logo-info-box">
<?php echo $logo;
}else{?>
<div id="no-logo-info-box">
<?php }?>
<div id="info-struttura">
<?php
$indirizzo = "";
$metakey = 'indirizzo';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
echo "<div style=\"float: left; margin-right: 6px; margin-top: -3px;\"><img src=\"" . get_template_directory_uri() ."/images/address.jpg\" /></div><div class=\"meta\" style=\"margin-bottom: 20px;\">" . $s . "</div>";
$indirizzo = $s;
}
}
}
$metakey = 'telefono';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
echo "<div style=\"float: left; margin-right: 6px; margin-top: -3px;\"><img src=\"" . get_template_directory_uri() ."/images/phone.jpg\" /></div><div class=\"meta\" style=\"margin-bottom: 20px;\">" . $s . "</div>";
}
}
}
$metakey = 'telefono_secondario';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
echo "<div style=\"float: left; margin-right: 6px; margin-top: -3px;\"><img src=\"" . get_template_directory_uri() ."/images/phone.jpg\" /></div><div class=\"meta\" style=\"margin-bottom: 20px;\">" . $s . "</div>" ;
}
}
}
$metakey = 'sito_web';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
echo "<div style=\"float: left; margin-right: 6px; margin-top: -3px;\"><img src=\"" . get_template_directory_uri() ."/images/web.jpg\" /></div><div class=\"meta\" style=\"margin-bottom: 20px;\"><a href=\"" . $s . "\" target=\"blank\" rel=\"nofollow\">" .$s. "</a></div>";
}
}
}
?>
</div>
</div>
<div class="bar mt25 mb30"></div>
<div id="descrizione-struttura">
<h5>Descrizione</h5>
<?php the_content(); ?>
</div>
<div id="servizi-struttura">
<h5>Servizi</h5>
<div id="icona-tassonomia"><img src="<?php echo get_template_directory_uri(); ?>/images/services.jpg" /></div><div class="meta" style="margin-bottom: 20px;"><?php _e(str_replace("</a><!--:-->", "<!--:--></a>", str_replace("[:it]", "<!--:it-->", str_replace("[:en]", "<!--:--><!--:en-->", get_the_term_list( get_the_ID(), 'servizi', "","<!--:-->, ","<!--:-->" )))));?></div>
</div>
<div class="bar mt25 mb30"></div>
<h5>Verifica disponibilità</h5>
<form name="disponibilita" id="disponibilita" action="<?php echo get_template_directory_uri(); ?>/disponibilita.php" method="post">
<label for="from">Data Arrivo* </label> <input style="min-width:120px;" type="text" id="from" name="from" class="<?php echo $ce?> validate[required][custom[date]] text-input datepicker" />
<label for="to" style="margin-left:15px;">Data Partenza *</label> <input style="min-width:120px;" type="text" id="to" name="to" class="<?php echo $ce?> validate[required][custom[date]] text-input datepicker" />
<a style="margin-left:15px;" id="various2" href="javascript:void(0);" class="disponibilita_calendario_verifica" onclick="modificaLink()">VERIFICA</a>
<br /><br />
<label>N° Adulti*</label>
<input style="min-width:50px;" name="adulti" type="text" id="adulti" class="<?php echo $cl?> validate[required][custom[integer]]" />
<span class="<?php echo $cc ?>">
<label>N° Bambini*</label>
<input style="min-width:50px;" name="bambini" type="text" id="bambini" class="<?php echo $cl2?> validate[custom[integer]]" /></span>
<?php
$metakey = 'e-mail';
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
if (($s != "") && ($s != " ") && ($s != NULL))
{
echo "<input type=\"hidden\" id=\"myemail\" value=\"".$s."\" />";
}
}
}
?>
</form>
<div class="bar mt25 mb30"></div>
<h5>Dove puoi otrvarci</h5>
<?php
$metakey = 'id-mappa';
$map = "";
$t = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s ORDER BY meta_value ASC", $struttura_id, $metakey) );
if ($t) {
foreach ($t as $s) {
$map = "[mappress mapid=\"".$s."\"]";
}
}
echo do_shortcode($map); ?>
<div class="bar mt25 mb30"></div>
<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'amplify' ), 'after' => '' ) ); ?>
<?php endwhile; ?>
</div>
<!-- Begin Sidebar -->
<?php
if(get_field('custom_sidebar_value') != NULL)
{include get_field('custom_sidebar_value');}
else {include('sidebar.php');} ?>
<!-- end sidebar -->
<div class="clear"></div>
</div><!-- end div.entry -->
</div><!-- end div.entries -->
<div class="clear"></div>
</div><!-- end div#main -->
<div class="clear"></div>
</div><!-- end div#main_container-->
<?php get_footer(); ?>