File "a7fbd6f916e65c115af7f6b01835b3ada5c5656c_0.file.punti-vendita.tmpl.php"

Full Path: /srv/www/www.cadoro.it/src/templates_c/a7fbd6f916e65c115af7f6b01835b3ada5c5656c_0.file.punti-vendita.tmpl.php
File size: 7.51 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/* Smarty version 3.1.29, created on 2024-02-21 16:36:23
  from "/srv/www/www.test.cadoro.it/src/templates/punti-vendita.tmpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_65d61877762ed1_57865608',
  'file_dependency' => 
  array (
    'a7fbd6f916e65c115af7f6b01835b3ada5c5656c' => 
    array (
      0 => '/srv/www/www.test.cadoro.it/src/templates/punti-vendita.tmpl',
      1 => 1708527642,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:layout-base.tmpl' => 1,
    'file:punti-vendita-form.tmpl' => 1,
  ),
),false)) {
function content_65d61877762ed1_57865608 ($_smarty_tpl) {
if (!is_callable('smarty_function_html_options')) require_once '/srv/www/www.test.cadoro.it/src/vendor/smarty/smarty/libs/plugins/function.html_options.php';
$_smarty_tpl->ext->_inheritance->init($_smarty_tpl, true);
?>


<?php 
$_smarty_tpl->ext->_inheritance->processBlock($_smarty_tpl, 0, 'title', array (
  0 => 'block_182093549165d618777474a3_01491359',
  1 => false,
  3 => 0,
  2 => 0,
));
?>


<?php 
$_smarty_tpl->ext->_inheritance->processBlock($_smarty_tpl, 0, "head", array (
  0 => 'block_5560924065d61877749057_29669527',
  1 => false,
  3 => 0,
  2 => 0,
));
?>


<html>
  <body>
    <?php 
$_smarty_tpl->ext->_inheritance->processBlock($_smarty_tpl, 0, "content", array (
  0 => 'block_84749856665d6187774c389_66402069',
  1 => false,
  3 => 0,
  2 => 0,
));
?>

    <?php 
$_smarty_tpl->ext->_inheritance->processBlock($_smarty_tpl, 0, "jstail", array (
  0 => 'block_48059443465d6187775aa21_27115964',
  1 => false,
  3 => 0,
  2 => 0,
));
?>

  </body>
</html>
<?php $_smarty_tpl->ext->_inheritance->endChild($_smarty_tpl);
$_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:layout-base.tmpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 2, false);
}
/* {block 'title'}  file:punti-vendita.tmpl */
function block_182093549165d618777474a3_01491359($_smarty_tpl, $_blockParentStack) {
?>

  Punti Vendita - CADORO
<?php
}
/* {/block 'title'} */
/* {block 'head'}  file:punti-vendita.tmpl */
function block_5560924065d61877749057_29669527($_smarty_tpl, $_blockParentStack) {
?>

  <meta name="keywords" content="Punti Vendita Cadoro">
  <meta name="description" content="Scopri i punti vendita Cadoro più vicino a te, scopri gli orari di apertura e il volantino delle offerte in corso.">
  <meta property="og:url" content="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;
echo $_smarty_tpl->tpl_vars['request_uri']->value;?>
">
  <meta property="og:title" content="Punti Vendita Cadoro">
  <meta property="og:image" content="<?php echo $_smarty_tpl->tpl_vars['cdn_url']->value;?>
/images/logo.png">
  <meta property="og:description" content="Scopri i punti vendita Cadoro più vicino a te, scopri gli orari di apertura e il volantino delle offerte in corso.">
<?php
}
/* {/block 'head'} */
/* {block 'content'}  file:punti-vendita.tmpl */
function block_84749856665d6187774c389_66402069($_smarty_tpl, $_blockParentStack) {
?>

    <div class="row">
      <div class="col-sm-3 mt20">
        <form method="post" action="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/punti-vendita" data-behaviour="punti-vendita">
          <h1 class="mt0">
            CERCA<br>IL PUNTO VENDITA<br>PIÙ VICINO A TE
          </h1>
          <div class="mt60">
            PROVINCIA
            <select name="prov" id="prov" class="form-control">
              <option value=""></option>
              <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['provinces']->value,'selected'=>$_smarty_tpl->tpl_vars['params']->value['prov']),$_smarty_tpl);?>

            </select>
          </div>
          <div class="mt20">
            CITTÀ
            <select name="city" id="city" class="form-control">
              <option value=""></option>
              <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['cities']->value,'selected'=>$_smarty_tpl->tpl_vars['params']->value['city']),$_smarty_tpl);?>

            </select>
          </div>
        </form>
      </div>
      <div class="col-sm-8 col-sm-offset-1 mt20">
        <div id="map_canvas" style="width: 100%; height: 400px;"></div>
      </div>
    </div>
    <div id="punti-vendita-form" class="mt60">
      <?php $_smarty_tpl->smarty->ext->_subtemplate->render($_smarty_tpl, "file:punti-vendita-form.tmpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>

    </div>
    <?php
}
/* {/block 'content'} */
/* {block 'jstail'}  file:punti-vendita.tmpl */
function block_48059443465d6187775aa21_27115964($_smarty_tpl, $_blockParentStack) {
?>

    <?php echo '<script'; ?>
 src="https://maps.googleapis.com/maps/api/js?language=it&region=IT&key=AIzaSyB6Z5rKR2huU_foZ-LxHlyqdU8XL9zVny0"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
>
      $(function () {
        if (window.google) {
          var map = new google.maps.Map(document.getElementById('map_canvas'), {
                   center: new google.maps.LatLng(45.40643, 11.87676)
                 , mapTypeId: google.maps.MapTypeId.ROADMAP
                 , zoom: 7
              })
            , markers = []
        }
        var $target = $("#punti-vendita-form")
        $('body').on('change', 'form[data-behaviour~=punti-vendita] select', function (e) {
          if ($(this).attr('name') == 'prov') {
            $('#city').val('')
          }
          $(e.target).closest('form').submit()
        })
        $('body').on('submit', 'form[data-behaviour~=punti-vendita]', function (e) {
          e.preventDefault()
          var $form = $(e.target)
          $.ajax({
              url: $form.attr('action')
            , type: $form.attr('method')
            , data: $form.serialize()
            , success: function (data, status, jqXHR) {
                $target.html(data)
              }
          })
        })
        window.updateStoreLocator = function (data) {
          if (!data) {
            return
          }
          // city
          var c = $('#city').get()[0]
            , v = $('#city').val()
          while (c.options.length > 1) {
            c.options[1] = null
          }
          for (city in data.cities) {
            c.options[c.options.length] = new Option(city, city)
          }
          $('#city').val(v)
          // markers
          for (i in markers) {
            markers[i].setMap(null)
          }
          markers = []
          for (i in data.stores) {
            var store = data.stores[i]
            if (store && store.lat && store.lng) {
             marker = new google.maps.Marker({
                  position: new google.maps.LatLng(store.lat, store.lng)
                , map: map
                , icon: {
                      url: '<?php echo $_smarty_tpl->tpl_vars['cdn_url']->value;?>
/images/map.png'
                    , anchor: new google.maps.Point(21, 28)
                  }
             })
             marker.slug = store.slug;
             google.maps.event.addListener(marker, 'click', function () {
               location.href = '<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/punti-vendita/' + this.slug;
             });
             markers.push(marker)
            }
          }
        }
        <?php if ($_smarty_tpl->tpl_vars['data']->value) {?>window.updateStoreLocator(<?php echo json_encode($_smarty_tpl->tpl_vars['data']->value);?>
);<?php }?>
      })
    <?php echo '</script'; ?>
>
    <?php
}
/* {/block 'jstail'} */
}