Files
apart-moment/cache/prod/smarty/compile/abe1b471791ff0dc845cc98780130aeb143c4270.file.search.js.html.php
2021-03-23 13:54:38 +01:00

72 lines
2.9 KiB
PHP

<?php /* Smarty version Smarty-3.1.20, created on 2021-03-23 12:37:18
compiled from "/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Beds24/templates/frontOffice/default/hook/search.js.html" */ ?>
<?php /*%%SmartyHeaderCode:15226385866059d2eead92e0-25680659%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'abe1b471791ff0dc845cc98780130aeb143c4270' =>
array (
0 => '/Volumes/Dev/Sources/Clients/apartmoment/site_web/local/modules/Beds24/templates/frontOffice/default/hook/search.js.html',
1 => 1613761613,
2 => 'file',
),
),
'nocache_hash' => '15226385866059d2eead92e0-25680659',
'function' =>
array (
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.20',
'unifunc' => 'content_6059d2eeaec5f9_02703684',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6059d2eeaec5f9_02703684')) {function content_6059d2eeaec5f9_02703684($_smarty_tpl) {?><script>
$(function() {
flatpickr.localize(flatpickr.l10ns.<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0][0]->langDataAccess(array('attr'=>"code"),$_smarty_tpl);?>
);
var startPicker, endPicker, flatpickrOptions = {
enableTime: false,
dateFormat: "Y-m-d",
minDate: "today",
allowInput: true,
altFormat: "l j F Y",
altInput: true
};
endPicker = flatpickr(".date-fin", flatpickrOptions);
flatpickrOptions.onChange = function(selectedDates) {
endPicker.set('minDate', selectedDates[0]);
};
startPicker = flatpickr(".date-debut", flatpickrOptions);
$('#beds24-search-form').submit(function(ev) {
var $zeForm = $(this);
ev.preventDefault();
setSearchResultHtml('<div class="well well-sm"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Nous recherchons les disponibilités...','js'=>1),$_smarty_tpl);?>
</div>');
$.ajax({
url: $zeForm.attr('action'),
data: $zeForm.serialize(),
method: $zeForm.attr('method'),
success: function (htmlData) {
setSearchResultHtml(htmlData);
},
error: function () {
setSearchResultHtml('<div class="alert alert-danger"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['intl'][0][0]->translate(array('l'=>'Désolé, quelque chose n\'a pas fonctionné. Merci de ré-essayer.','js'=>1),$_smarty_tpl);?>
</div>');
}
});
});
function setSearchResultHtml(htmlText) {
$('#beds24-search-results').html(htmlText);
}
});
</script>
<?php }} ?>