File "edf3615e677d782e1e9e5390c26e46e99093bdc1_0.file.admin-stores-add.tmpl.php"

Full Path: /srv/www/www.cadoro.it/src/templates_c/edf3615e677d782e1e9e5390c26e46e99093bdc1_0.file.admin-stores-add.tmpl.php
File size: 22.88 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/* Smarty version 3.1.29, created on 2024-05-22 08:41:51
  from "/srv/www/www.cadoro.it/src/templates/admin-stores-add.tmpl" */

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

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

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

    <?php 
$_smarty_tpl->ext->_inheritance->processBlock($_smarty_tpl, 0, "jstail", array (
  0 => 'block_1235274464664d93af111d98_74880739',
  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-admin.tmpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 2, false);
}
/* {block 'breadcrumbs'}  file:admin-stores-add.tmpl */
function block_2141317058664d93af072025_33815065($_smarty_tpl, $_blockParentStack) {
?>

    <div class="breadcrumbs">
      <a href="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/admin/stores">Punti Vendita</a> <span class="divider">&raquo;</span>
      <strong>Aggiungi punto vendita</strong>
    </div>
    <?php
}
/* {/block 'breadcrumbs'} */
/* {block 'content'}  file:admin-stores-add.tmpl */
function block_1713403275664d93af0758b0_29057500($_smarty_tpl, $_blockParentStack) {
?>

    <div class="sheet">
      <div class="sheet-header">
        <h1>
          Aggiungi punto vendita
        </h1>
      </div>
      <div class="sheet-body">
        <?php if ($_smarty_tpl->tpl_vars['errors']->value) {?>
        <div class="alert alert-danger">
          <strong>ATTENZIONE: si sono verificati degli errori, correggere prima di proseguire!</strong>
        </div>
        <?php }?>
        <form class="form-horizontal" method="post" action="" enctype="multipart/form-data">
          <fieldset>
            <legend>Informazioni di base</legend>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['slug'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="slug">SLUG</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="slug" name="slug" value="<?php echo _f('slug',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['slug'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['title'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="title">Titolo</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="title" name="title" value="<?php echo _f('title',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['title'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['type'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="type">Tipo</label>
              <div class="controls col-md-9">
                <select name="type" class="form-control">
                  <option value=""></option>
                  <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['STORE_TYPES']->value,'selected'=>_f('type',$_smarty_tpl->tpl_vars['store']->value)),$_smarty_tpl);?>

                </select>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['type'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['address'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="address">Indirizzo</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="address" name="address" value="<?php echo _f('address',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['address'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['zipcode'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="zipcode">CAP</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="zipcode" name="zipcode" value="<?php echo _f('zipcode',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['zipcode'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['city'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="city">Città</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="city" name="city" value="<?php echo _f('city',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['city'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['province'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="province">Provincia</label>
              <div class="controls col-md-9">
                <select name="province" id="province" class="form-control">
                  <option value=""></option>
                  <?php echo smarty_function_html_options(array('options'=>$_smarty_tpl->tpl_vars['PROVINCES']->value,'selected'=>_f('province',$_smarty_tpl->tpl_vars['store']->value)),$_smarty_tpl);?>

                </select>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['province'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['lat'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="lat">Latitudine / Longitudine</label>
              <div class="controls col-md-3">
                <input type="text" class="form-control" id="lat" name="lat" value="<?php echo _fn('lat',$_smarty_tpl->tpl_vars['store']->value,8);?>
" placeholder="Latitudine" data-behaviour="numeric">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['lat'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
              <div class="controls col-md-3">
                <input type="text" class="form-control" id="lng" name="lng" value="<?php echo _fn('lng',$_smarty_tpl->tpl_vars['store']->value,8);?>
" placeholder="Longitudine" data-behaviour="numeric">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['website'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
              <div class="controls col-md-3">
                <a href="" class="btn btn-default btn-block" data-behaviour="geocode"><i class="glyphicon glyphicon-map-marker"></i> Geocodifica</a>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['phone'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="phone">Telefono</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="phone" name="phone" value="<?php echo _f('phone',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['phone'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['email'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="email">Email</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="email" name="email" value="<?php echo _f('email',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['email'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['services'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="services">Servizi</label>
              <div class="controls col-md-9">
                <?php
$_from = $_smarty_tpl->tpl_vars['STORE_SERVICES']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_v_0_saved_item = isset($_smarty_tpl->tpl_vars['v']) ? $_smarty_tpl->tpl_vars['v'] : false;
$__foreach_v_0_saved_key = isset($_smarty_tpl->tpl_vars['k']) ? $_smarty_tpl->tpl_vars['k'] : false;
$_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['v']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['k']->value => $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
$__foreach_v_0_saved_local_item = $_smarty_tpl->tpl_vars['v'];
?>
                <div class="checkbox">
                  <label>
                    <input type="checkbox" name="services[]" value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
"<?php if (in_array($_smarty_tpl->tpl_vars['k']->value,_f('services',$_smarty_tpl->tpl_vars['store']->value,array()))) {?> checked="checked"<?php }?>> <?php echo $_smarty_tpl->tpl_vars['v']->value;?>

                  </label>
                </div>
                <?php
$_smarty_tpl->tpl_vars['v'] = $__foreach_v_0_saved_local_item;
}
if ($__foreach_v_0_saved_item) {
$_smarty_tpl->tpl_vars['v'] = $__foreach_v_0_saved_item;
}
if ($__foreach_v_0_saved_key) {
$_smarty_tpl->tpl_vars['k'] = $__foreach_v_0_saved_key;
}
?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['services'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
          </fieldset>
          <fieldset class="mt30">
            <legend>Orario di apertura</legend>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_1'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_1">Lunedì</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_1" name="openings_1" value="<?php echo _f('openings_1',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_1'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_2'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_2">Martedì</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_2" name="openings_2" value="<?php echo _f('openings_2',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_2'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_3'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_3">Mercoledì</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_3" name="openings_3" value="<?php echo _f('openings_3',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_3'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_4'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_4">Giovedì</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_4" name="openings_4" value="<?php echo _f('openings_4',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_4'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_5'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_5">Venerdì</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_5" name="openings_5" value="<?php echo _f('openings_5',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_5'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_6'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_6">Sabato</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_6" name="openings_6" value="<?php echo _f('openings_6',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_6'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_7'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="openings_7">Domenica</label>
              <div class="controls col-md-9">
                <input type="text" class="form-control" id="openings_7" name="openings_7" value="<?php echo _f('openings_7',$_smarty_tpl->tpl_vars['store']->value);?>
">
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['openings_7'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
          </fieldset>
          <fieldset class="mt30">
            <legend>Immagini</legend>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_1'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="image_1">Immagine 1</label>
              <div class="controls col-md-9">
                <input type="file" class="form-control" id="image_1" name="image_1" value="">
                <?php if (isset($_smarty_tpl->tpl_vars['store']->value['image_1']) && $_smarty_tpl->tpl_vars['store']->value['image_1']) {?>
                <p class="mt20">
                  <input type="hidden" name="image_1" value="<?php echo $_smarty_tpl->tpl_vars['store']->value['image_1'];?>
">
                  <img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/assets/<?php echo $_smarty_tpl->tpl_vars['store']->value['image_1'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['store']->value['name'];?>
" class="img-responsive img-editable" id="img_image_1">
                </p>
                <?php }?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_1'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_2'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="image_2">Immagine 2</label>
              <div class="controls col-md-9">
                <input type="file" class="form-control" id="image_2" name="image_2" value="">
                <?php if (isset($_smarty_tpl->tpl_vars['store']->value['image_2']) && $_smarty_tpl->tpl_vars['store']->value['image_2']) {?>
                <p class="mt20">
                  <input type="hidden" name="image_2" value="<?php echo $_smarty_tpl->tpl_vars['store']->value['image_2'];?>
">
                  <img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/assets/<?php echo $_smarty_tpl->tpl_vars['store']->value['image_2'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['store']->value['name'];?>
" class="img-responsive img-editable" id="img_image_2">
                </p>
                <?php }?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_2'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_3'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="image_3">Immagine 3</label>
              <div class="controls col-md-9">
                <input type="file" class="form-control" id="image_3" name="image_3" value="">
                <?php if (isset($_smarty_tpl->tpl_vars['store']->value['image_3']) && $_smarty_tpl->tpl_vars['store']->value['image_3']) {?>
                <p class="mt20">
                  <input type="hidden" name="image_3" value="<?php echo $_smarty_tpl->tpl_vars['store']->value['image_3'];?>
">
                  <img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/assets/<?php echo $_smarty_tpl->tpl_vars['store']->value['image_3'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['store']->value['name'];?>
" class="img-responsive img-editable" id="img_image_3">
                </p>
                <?php }?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_3'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_4'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="image_4">Immagine 4</label>
              <div class="controls col-md-9">
                <input type="file" class="form-control" id="image_4" name="image_4" value="">
                <?php if (isset($_smarty_tpl->tpl_vars['store']->value['image_4']) && $_smarty_tpl->tpl_vars['store']->value['image_4']) {?>
                <p class="mt20">
                  <input type="hidden" name="image_4" value="<?php echo $_smarty_tpl->tpl_vars['store']->value['image_4'];?>
">
                  <img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/assets/<?php echo $_smarty_tpl->tpl_vars['store']->value['image_4'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['store']->value['name'];?>
" class="img-responsive img-editable" id="img_image_4">
                </p>
                <?php }?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_4'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
            <div class="form-group<?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_5'])) {?> error<?php }?>">
              <label class="control-label col-md-3" for="image_5">Immagine 5</label>
              <div class="controls col-md-9">
                <input type="file" class="form-control" id="image_5" name="image_5" value="">
                <?php if (isset($_smarty_tpl->tpl_vars['store']->value['image_5']) && $_smarty_tpl->tpl_vars['store']->value['image_5']) {?>
                <p class="mt20">
                  <input type="hidden" name="image_5" value="<?php echo $_smarty_tpl->tpl_vars['store']->value['image_5'];?>
">
                  <img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/assets/<?php echo $_smarty_tpl->tpl_vars['store']->value['image_5'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['store']->value['name'];?>
" class="img-responsive img-editable" id="img_image_5">
                </p>
                <?php }?>
                <?php if (isset($_smarty_tpl->tpl_vars['errors']->value['image_5'])) {?><p class="help-block error">Campo obbligatorio!</p><?php }?>
              </div>
            </div>
          </fieldset>
          <div class="form-group form-actions"><div class="col-md-offset-3 col-md-9">
            <button type="submit" class="btn btn-success">Salva le modifiche</button>
            <a href="<?php echo $_smarty_tpl->tpl_vars['base_url']->value;?>
/admin/stores" class="btn btn-default">Annulla</a>
          </div></div>
        </form>
      </div>
    </div>
    <?php
}
/* {/block 'content'} */
/* {block 'jstail'}  file:admin-stores-add.tmpl */
function block_1235274464664d93af111d98_74880739($_smarty_tpl, $_blockParentStack) {
?>

    <?php echo '<script'; ?>
>
      var geocoder = new google.maps.Geocoder()
      $('[data-behaviour=geocode]').click(function (e) {
        e.preventDefault()
        var address = $('#address').val() + ', ' + $('#city').val() + ', ' + $('#province').val()
        geocoder.geocode({'address': address}, function(results, status) {
          if (status === google.maps.GeocoderStatus.OK) {
           $('#lat').val(results[0].geometry.location.lat().toFixed(8).toString().replace('.', ','))
           $('#lng').val(results[0].geometry.location.lng().toFixed(8).toString().replace('.', ','))
          } else {
           alert("Geocodifica non riuscita: " + address);
          }
        });
      })
    <?php echo '</script'; ?>
>
    <?php
}
/* {/block 'jstail'} */
}