<?php /* Smarty version 2.6.26, created on 2020-06-25 13:11:13
         compiled from /home3/bargaip4/public_html/gevimmo/plugins/massmailer_newsletter/block.tpl */ ?>
<!-- newsletter block -->
<?php echo '<div class="subscribe'; ?><?php if ($this->_tpl_vars['block']['Side'] != 'left' && $this->_tpl_vars['block']['Side'] != 'right'): ?><?php echo ' light-inputs'; ?><?php endif; ?><?php echo '"><div class="submit-cell"><input placeholder="'; ?><?php echo $this->_tpl_vars['lang']['massmailer_newsletter_your_name']; ?><?php echo '" type="text" id="newsletter_name" maxlength="50" /></div><div class="submit-cell"><input placeholder="'; ?><?php echo $this->_tpl_vars['lang']['massmailer_newsletter_your_e_mail']; ?><?php echo '" type="text" id="newsletter_email" maxlength="100" /></div><input class="button" id="subscribe_user" type="button" value="'; ?><?php echo $this->_tpl_vars['lang']['massmailer_newsletter_subscribe']; ?><?php echo '" data-default-val="'; ?><?php echo $this->_tpl_vars['lang']['massmailer_newsletter_subscribe']; ?><?php echo '" /></div>'; ?>


<script class="fl-js-dynamic">
lang['no_response_from_server'] = '<?php echo $this->_tpl_vars['lang']['massmailer_newsletter_no_response']; ?>
';
<?php echo '
$(document).ready(function(){
    $(\'#subscribe_user\').click(function(){
        $(this).val(lang[\'loading\']).attr(\'disabled\', \'true\');
        var $name = $(\'#newsletter_name\');
        var $email = $(\'#newsletter_email\');
        var data = {
            mode: \'newsletterSubscribe\',
            name: $name.val(),
            email: $email.val()
        };
        $.getJSON(rlConfig[\'ajax_url\'], data, function(response) {
            if (response) {
                if (response.status == \'OK\' || response.status == \'WARNING\') {
                    $(\'#newsletter_name\').val(\'\');
                    $(\'#newsletter_email\').val(\'\');
                    $(\'#subscribe_user\').val($(\'#subscribe_user\').data(\'default-val\')).removeAttr(\'disabled\');
                    if (response.status == \'OK\') {
                        printMessage(\'notice\', response.data.content);
                    } else {
                        printMessage(\'warning\', response.data.content);
                    }
                } else {
                    $(\'#subscribe_user\').val($(\'#subscribe_user\').data(\'default-val\')).removeAttr(\'disabled\');
                    printMessage(\'error\', response.data.message);
                }
            } else {
                $(\'#subscribe_user\').val($(\'#subscribe_user\').data(\'default-val\')).removeAttr(\'disabled\');
                printMessage(\'warning\', lang[\'no_response_from_server\']);
            }
        }).fail(function(){
            $(\'#subscribe_user\').val($(\'#subscribe_user\').data(\'default-val\')).removeAttr(\'disabled\');
            printMessage(\'warning\', lang[\'no_response_from_server\']);
        });
    });
});
'; ?>

</script>
<!-- newsletter block end -->