Beispiel #1
0
    if (empty($gift_cert_data) || !empty($gift_cert_id) && !fn_check_company_id('gift_certificates', 'gift_cert_id', $gift_cert_id)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    // [Page sections]
    Registry::set('navigation.tabs', array('detailed' => array('title' => __('detailed_info'), 'js' => true), 'log' => array('title' => __('history'), 'js' => true)));
    // [/Page sections]
    list($log, $search) = fn_get_gift_certificate_log($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'));
    Tygh::$app['view']->assign('log', $log);
    Tygh::$app['view']->assign('search', $search);
    if (false != ($last_item = reset($log))) {
        $gift_cert_data['amount'] = $last_item['debit'];
        $gift_cert_data['products'] = $last_item['debit_products'];
    }
    Tygh::$app['view']->assign('templates', fn_get_gift_certificate_templates());
    Tygh::$app['view']->assign('states', fn_get_all_states());
    Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    Tygh::$app['view']->assign('gift_cert_data', $gift_cert_data);
} elseif ($mode == 'manage') {
    list($gift_certificates, $search) = fn_get_gift_certificates($_REQUEST, Registry::get('addons.gift_certificates.cert_per_page'));
    Tygh::$app['view']->assign('gift_certificates', $gift_certificates);
    Tygh::$app['view']->assign('search', $search);
}
function fn_update_gift_certificate($gift_cert_data, $gift_cert_id = 0, $params = array())
{
    fn_correct_gift_certificate($gift_cert_data);
    $gift_cert_data['products'] = !empty($gift_cert_data['products']) ? serialize($gift_cert_data['products']) : '';
    if (empty($gift_cert_id)) {
        do {
            $code = fn_generate_gift_certificate_code();
        } while (true == fn_check_gift_certificate_code($code));
        $gift_cert_data = fn_array_merge($gift_cert_data, array('gift_cert_code' => $code, 'timestamp' => TIME));
     $payment_info = fn_get_payment_method_data($cart['payment_id']);
     Registry::get('view')->assign('payment_info', $payment_info);
     if (!empty($payment_info['processor_params']['iframe_mode']) && $payment_info['processor_params']['iframe_mode'] == 'Y') {
         Registry::get('view')->assign('iframe_mode', true);
     }
 }
 Registry::get('view')->assign('payment_methods', $payment_methods);
 $cart['payment_surcharge'] = 0;
 if (!empty($cart['payment_id']) && !empty($payment_info)) {
     fn_update_payment_surcharge($cart, $auth);
 }
 if (fn_allowed_for('MULTIVENDOR')) {
     Registry::get('view')->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($cart['products']));
 }
 Registry::get('view')->assign('usergroups', fn_get_usergroups('C', CART_LANGUAGE));
 Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
 Registry::get('view')->assign('states', fn_get_all_states());
 $cart['ship_to_another'] = fn_check_shipping_billing($cart['user_data'], $profile_fields);
 Registry::get('view')->assign('profile_fields', $profile_fields);
 if (Registry::get('settings.General.user_multiple_profiles') == 'Y') {
     $user_profiles = fn_get_user_profiles($auth['user_id']);
     Registry::get('view')->assign('user_profiles', $user_profiles);
 }
 fn_checkout_summary($cart);
 if ($edit_step == 'step_two' && !empty($completed_steps['step_one']) && empty($profile_fields['B']) && empty($profile_fields['S'])) {
     $edit_step = 'step_four';
 }
 // If we're on shipping step and shipping is not required, switch to payment step
 //FIXME
 /* if ($edit_step == 'step_three' && $cart['shipping_required'] != true) {
    $edit_step = 'step_four';
    function content_55d3125033b7a9_87422872($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('calculate_shipping_cost', 'country', 'select_country', 'state', 'select_state', 'select_state', 'zip_postal_code', 'get_rates', 'select_shipping_method', 'vendor', 'none', 'free_shipping', 'no_shipping_required', 'free_shipping', 'text_no_shipping_methods', 'total', 'select', 'text_no_shipping_methods', 'recalculate_rates', 'select_shipping_method', 'get_rates', 'calculate_shipping_cost', 'country', 'select_country', 'state', 'select_state', 'select_state', 'zip_postal_code', 'get_rates', 'select_shipping_method', 'vendor', 'none', 'free_shipping', 'no_shipping_required', 'free_shipping', 'text_no_shipping_methods', 'total', 'select', 'text_no_shipping_methods', 'recalculate_rates', 'select_shipping_method', 'get_rates'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            ?>
<script type="text/javascript">
function fn_calculate_total_shipping() 
{
    var $ = Tygh.$;
    params = [];
    parents = $('#shipping_estimation');
    radio = $('input[type=radio]:checked', parents);

    $.each(radio, function(id, elm) {
        params.push({name: elm.name, value: elm.value});
    });

    params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_country').val()});
    params.push({name: $('#elm_state').prop('name'), value: $('#elm_state').val()});
    params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_zipcode').val()});

    url = fn_url('checkout.shipping_estimation');

    for (i in params) {
        url += '&' + params[i]['name'] + '=' + encodeURIComponent(params[i]['value']);
    }

    $.ceAjax('request', url, {
        result_ids: 'shipping_estimation',
        method: 'post'
    });
}
</script>


<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["prefix"] = new Smarty_variable("sidebox_", null, 0);
            }
            if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("hidden", null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("buttons-container", null, 0);
            }
            if ($_smarty_tpl->tpl_vars['additional_id']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["class_suffix"] = new Smarty_variable("-" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["id_suffix"] = new Smarty_variable("_" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") {
                ?>

<div id="est_box<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
    <div class="ty-estimation-box">
    <h3 class="ty-subheader"><?php 
                echo $_smarty_tpl->__("calculate_shipping_cost");
                ?>
</h3>
<?php 
            }
            ?>

        <div id="shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
">

            <?php 
            $_smarty_tpl->tpl_vars['states'] = new Smarty_variable(fn_get_all_states(1), null, 0);
            ?>
            <?php 
            if (!Smarty::$_smarty_vars['capture']['states_built']) {
                ?>
                <?php 
                echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => $_smarty_tpl->tpl_vars['states']->value), 0);
                ?>

                <?php 
                $_smarty_tpl->_capture_stack[0][] = array("states_built", null, null);
                ob_start();
                ?>
Y<?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>
            <?php 
            }
            ?>

            <form class="cm-ajax" name="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
estimation_form<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" action="<?php 
            echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
            ?>
" method="post">
                <?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
<input type="hidden" name="location" value="sidebox" /><?php 
            }
            ?>
                <?php 
            if ($_smarty_tpl->tpl_vars['additional_id']->value) {
                ?>
<input type="hidden" name="additional_id" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['additional_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" /><?php 
            }
            ?>
                <input type="hidden" name="result_ids" value="shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
,shipping_estimation_buttons" />
                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_country<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("country");
            ?>
</label>
                    <select id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_country<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="cm-country cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-input-text-medium" name="customer_location[country]">
                        <option value="">- <?php 
            echo $_smarty_tpl->__("select_country");
            ?>
 -</option>
                        <?php 
            $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0);
            ?>
                        <?php 
            $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["country"]->_loop = false;
            $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['countries']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) {
                $_smarty_tpl->tpl_vars["country"]->_loop = true;
                $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key;
                ?>
                        <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] == $_smarty_tpl->tpl_vars['code']->value || !$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] && $_smarty_tpl->tpl_vars['code']->value == $_smarty_tpl->tpl_vars['settings']->value['General']['default_country']) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8');
                ?>
</option>
                        <?php 
            }
            ?>
                    </select>
                </div>

                <?php 
            $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_state'], null, 0);
            ?>

                <?php 
            if (fn_is_empty($_smarty_tpl->tpl_vars['_state']->value)) {
                ?>
                    <?php 
                $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['General']['default_state'], null, 0);
                ?>
                <?php 
            }
            ?>

                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("state");
            ?>
</label>
                    <select class="cm-state cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 <?php 
            if (!$_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
hidden<?php 
            }
            ?>
 ty-input-text-medium" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" name="customer_location[state]">
                        <option value="">- <?php 
            echo $_smarty_tpl->__("select_state");
            ?>
 -</option>
                        <?php 
            $_smarty_tpl->tpl_vars['state'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['state']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['state']->key => $_smarty_tpl->tpl_vars['state']->value) {
                $_smarty_tpl->tpl_vars['state']->_loop = true;
                ?>
                            <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['code'], ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['state']->value['code'] == $_smarty_tpl->tpl_vars['_state']->value) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['state'], ENT_QUOTES, 'UTF-8');
                ?>
</option>
                        <?php 
            }
            if (!$_smarty_tpl->tpl_vars['state']->_loop) {
                ?>
                            <option label="" value="">- <?php 
                echo $_smarty_tpl->__("select_state");
                ?>
 -</option>
                        <?php 
            }
            ?>
                    </select>
                    <input type="text" class="cm-state cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-input-text-medium <?php 
            if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
hidden<?php 
            }
            ?>
" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
_d" name="customer_location[state]" size="20" maxlength="64" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8');
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
disabled="disabled"<?php 
            }
            ?>
 />
                </div>

                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_zipcode<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("zip_postal_code");
            ?>
</label>
                    <input type="text" class="ty-input-text-medium" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_zipcode<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" name="customer_location[zipcode]" size="20" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_zipcode'], ENT_QUOTES, 'UTF-8');
            ?>
" />
                </div>

                <div class="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                    <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_name' => "dispatch[checkout.shipping_estimation]", 'but_role' => "text", 'but_id' => "but_get_rates"), 0);
            ?>

                </div>

            </form>

            <?php 
            if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") {
                ?>
                <?php 
                if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_failed'] && !$_smarty_tpl->tpl_vars['cart']->value['company_shipping_failed']) {
                    ?>
                    <?php 
                    if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                        ?>
                        <div class="ty-estimation__title"><?php 
                        echo $_smarty_tpl->__("select_shipping_method");
                        ?>
</div>
                    <?php 
                    }
                    ?>
                    <form class="cm-ajax" name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
                    ?>
select_shipping_form<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" action="<?php 
                    echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                    ?>
" method="post">
                    <input type="hidden" name="redirect_mode" value="cart" />
                    <input type="hidden" name="result_ids" value="checkout_totals" />

                    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>


                    <?php 
                        $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['group']->_loop = false;
                        $_smarty_tpl->tpl_vars['group_key'] = new Smarty_Variable();
                        $_from = $_smarty_tpl->tpl_vars['product_groups']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['group']->key => $_smarty_tpl->tpl_vars['group']->value) {
                            $_smarty_tpl->tpl_vars['group']->_loop = true;
                            $_smarty_tpl->tpl_vars['group_key']->value = $_smarty_tpl->tpl_vars['group']->key;
                            ?>
                        <p>
                        <strong><?php 
                            echo $_smarty_tpl->__("vendor");
                            ?>
:&nbsp;</strong><?php 
                            echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['group']->value['name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8');
                            ?>

                        </p>
                        <?php 
                            if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) {
                                ?>
                            <ul>
                            <?php 
                                $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["product"]->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['group']->value['products'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
                                    $_smarty_tpl->tpl_vars["product"]->_loop = true;
                                    ?>
                                <li>
                                    <?php 
                                    if ($_smarty_tpl->tpl_vars['product']->value['product']) {
                                        ?>
                                        <?php 
                                        echo $_smarty_tpl->tpl_vars['product']->value['product'];
                                        ?>

                                    <?php 
                                    } else {
                                        ?>
                                        <?php 
                                        echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                                        ?>

                                    <?php 
                                    }
                                    ?>
                                </li>
                            <?php 
                                }
                                ?>
                            </ul>
                        <?php 
                            }
                            ?>

                        <?php 
                            if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) {
                                ?>
                            <?php 
                                $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['group']->value['shippings'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                                    $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                                    ?>

                                <?php 
                                    if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0);
                                        ?>
                                <?php 
                                    } else {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0);
                                        ?>
                                <?php 
                                    }
                                    ?>

                                <?php 
                                    if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0);
                                        ?>
                                <?php 
                                    } else {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0);
                                        ?>
                                <?php 
                                    }
                                    ?>

                                <?php 
                                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation_method"));
                                    $_block_repeat = true;
                                    echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), null, $_smarty_tpl, $_block_repeat);
                                    while ($_block_repeat) {
                                        ob_start();
                                        ?>

                                <?php 
                                        if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) {
                                            ?>
                                    <?php 
                                            $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null);
                                            ob_start();
                                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0);
                                            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                                            if (!empty($_capture_buffer)) {
                                                if (isset($_capture_assign)) {
                                                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                                                }
                                                if (isset($_capture_append)) {
                                                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                                                }
                                                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                                            } else {
                                                $_smarty_tpl->capture_error();
                                            }
                                            ?>
                                    <?php 
                                            if ($_smarty_tpl->tpl_vars['shipping']->value['inc_tax']) {
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0);
                                                ?>
                                        <?php 
                                                if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) {
                                                    ?>
                                            <?php 
                                                    $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null);
                                                    ob_start();
                                                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0);
                                                    list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                                                    if (!empty($_capture_buffer)) {
                                                        if (isset($_capture_assign)) {
                                                            $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                                                        }
                                                        if (isset($_capture_append)) {
                                                            $_smarty_tpl->append($_capture_append, ob_get_contents());
                                                        }
                                                        Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                                                    } else {
                                                        $_smarty_tpl->capture_error();
                                                    }
                                                    ?>
                                            <?php 
                                                    $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0);
                                                    ?>
                                        <?php 
                                                }
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0);
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0);
                                                ?>
                                    <?php 
                                            }
                                            ?>
                                <?php 
                                        } else {
                                            ?>
                                    <?php 
                                            $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0);
                                            ?>
                                <?php 
                                        }
                                        ?>

                                <p>
                                    <input type="radio" class="ty-valign" id="sh_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" name="shipping_ids[<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
]" value="<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" onclick="fn_calculate_total_shipping();" <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
 /><label for="sh_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" class="ty-valign"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
                                        ?>
 <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
 - <?php 
                                        echo $_smarty_tpl->tpl_vars['rate']->value;
                                        ?>
</label>
                                </p>
                                <?php 
                                        $_block_content = ob_get_clean();
                                        $_block_repeat = false;
                                        echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), $_block_content, $_smarty_tpl, $_block_repeat);
                                    }
                                    array_pop($_smarty_tpl->smarty->_tag_stack);
                                    ?>

                            <?php 
                                }
                                ?>

                        <?php 
                            } else {
                                ?>
                            <?php 
                                if ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("no_shipping_required");
                                    ?>
</p>
                            <?php 
                                } elseif ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping']) {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("free_shipping");
                                    ?>
</p>
                            <?php 
                                } else {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("text_no_shipping_methods");
                                    ?>
</p>
                            <?php 
                                }
                                ?>
                        <?php 
                            }
                            ?>

                    <?php 
                        }
                        ?>

                    <p><strong><?php 
                        echo $_smarty_tpl->__("total");
                        ?>
:</strong>&nbsp;<?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0);
                        ?>
</p>

                    <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>


                    <div class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
                        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select"), 'but_role' => "text", 'but_name' => "dispatch[checkout.update_shipping]", 'but_id' => "but_select_shipping", 'but_meta' => "cm-dialog-closer"), 0);
                    ?>

                    </div>

                    </form>
                <?php 
                } else {
                    ?>
                    <p class="ty-error-text">
                        <?php 
                    echo $_smarty_tpl->__("text_no_shipping_methods");
                    ?>

                    </p>
                <?php 
                }
                ?>

            <?php 
            }
            ?>
        <!--shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></div>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") {
                ?>
    </div>
</div>
<?php 
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                ?>
<div class="ty-estimation-buttons buttons-container" id="shipping_estimation_buttons">
    <?php 
                if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") {
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("recalculate_rates"), 'but_external_click_id' => "but_get_rates", 'but_role' => "text", 'but_meta' => "ty-btn__secondary cm-external-click ty-float-right ty-estimation-buttons__rate"), 0);
                    ?>


        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select_shipping_method"), 'but_external_click_id' => "but_select_shipping", 'but_meta' => "ty-btn__secondary cm-external-click cm-dialog-closer"), 0);
                    ?>

    <?php 
                } else {
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_external_click_id' => "but_get_rates", 'but_meta' => "ty-btn__secondary cm-external-click"), 0);
                    ?>

    <?php 
                }
                ?>
<!--shipping_estimation_buttons--></div>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="views/checkout/components/shipping_estimation.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "views/checkout/components/shipping_estimation.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            ?>
<script type="text/javascript">
function fn_calculate_total_shipping() 
{
    var $ = Tygh.$;
    params = [];
    parents = $('#shipping_estimation');
    radio = $('input[type=radio]:checked', parents);

    $.each(radio, function(id, elm) {
        params.push({name: elm.name, value: elm.value});
    });

    params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_country').val()});
    params.push({name: $('#elm_state').prop('name'), value: $('#elm_state').val()});
    params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_zipcode').val()});

    url = fn_url('checkout.shipping_estimation');

    for (i in params) {
        url += '&' + params[i]['name'] + '=' + encodeURIComponent(params[i]['value']);
    }

    $.ceAjax('request', url, {
        result_ids: 'shipping_estimation',
        method: 'post'
    });
}
</script>


<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["prefix"] = new Smarty_variable("sidebox_", null, 0);
            }
            if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("hidden", null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("buttons-container", null, 0);
            }
            if ($_smarty_tpl->tpl_vars['additional_id']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["class_suffix"] = new Smarty_variable("-" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0);
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["id_suffix"] = new Smarty_variable("_" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") {
                ?>

<div id="est_box<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
    <div class="ty-estimation-box">
    <h3 class="ty-subheader"><?php 
                echo $_smarty_tpl->__("calculate_shipping_cost");
                ?>
</h3>
<?php 
            }
            ?>

        <div id="shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
">

            <?php 
            $_smarty_tpl->tpl_vars['states'] = new Smarty_variable(fn_get_all_states(1), null, 0);
            ?>
            <?php 
            if (!Smarty::$_smarty_vars['capture']['states_built']) {
                ?>
                <?php 
                echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => $_smarty_tpl->tpl_vars['states']->value), 0);
                ?>

                <?php 
                $_smarty_tpl->_capture_stack[0][] = array("states_built", null, null);
                ob_start();
                ?>
Y<?php 
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                ?>
            <?php 
            }
            ?>

            <form class="cm-ajax" name="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
estimation_form<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" action="<?php 
            echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
            ?>
" method="post">
                <?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
<input type="hidden" name="location" value="sidebox" /><?php 
            }
            ?>
                <?php 
            if ($_smarty_tpl->tpl_vars['additional_id']->value) {
                ?>
<input type="hidden" name="additional_id" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['additional_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" /><?php 
            }
            ?>
                <input type="hidden" name="result_ids" value="shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
,shipping_estimation_buttons" />
                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_country<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("country");
            ?>
</label>
                    <select id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_country<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="cm-country cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-input-text-medium" name="customer_location[country]">
                        <option value="">- <?php 
            echo $_smarty_tpl->__("select_country");
            ?>
 -</option>
                        <?php 
            $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0);
            ?>
                        <?php 
            $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["country"]->_loop = false;
            $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['countries']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) {
                $_smarty_tpl->tpl_vars["country"]->_loop = true;
                $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key;
                ?>
                        <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] == $_smarty_tpl->tpl_vars['code']->value || !$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] && $_smarty_tpl->tpl_vars['code']->value == $_smarty_tpl->tpl_vars['settings']->value['General']['default_country']) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8');
                ?>
</option>
                        <?php 
            }
            ?>
                    </select>
                </div>

                <?php 
            $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_state'], null, 0);
            ?>

                <?php 
            if (fn_is_empty($_smarty_tpl->tpl_vars['_state']->value)) {
                ?>
                    <?php 
                $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['General']['default_state'], null, 0);
                ?>
                <?php 
            }
            ?>

                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("state");
            ?>
</label>
                    <select class="cm-state cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 <?php 
            if (!$_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
hidden<?php 
            }
            ?>
 ty-input-text-medium" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" name="customer_location[state]">
                        <option value="">- <?php 
            echo $_smarty_tpl->__("select_state");
            ?>
 -</option>
                        <?php 
            $_smarty_tpl->tpl_vars['state'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['state']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['state']->key => $_smarty_tpl->tpl_vars['state']->value) {
                $_smarty_tpl->tpl_vars['state']->_loop = true;
                ?>
                            <option value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['code'], ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['state']->value['code'] == $_smarty_tpl->tpl_vars['_state']->value) {
                    ?>
selected="selected"<?php 
                }
                ?>
><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['state'], ENT_QUOTES, 'UTF-8');
                ?>
</option>
                        <?php 
            }
            if (!$_smarty_tpl->tpl_vars['state']->_loop) {
                ?>
                            <option label="" value="">- <?php 
                echo $_smarty_tpl->__("select_state");
                ?>
 -</option>
                        <?php 
            }
            ?>
                    </select>
                    <input type="text" class="cm-state cm-location-estimation<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-input-text-medium <?php 
            if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
hidden<?php 
            }
            ?>
" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_state<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
_d" name="customer_location[state]" size="20" maxlength="64" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8');
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) {
                ?>
disabled="disabled"<?php 
            }
            ?>
 />
                </div>

                <div class="ty-control-group">
                    <label class="ty-control-group__label" for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_zipcode<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo $_smarty_tpl->__("zip_postal_code");
            ?>
</label>
                    <input type="text" class="ty-input-text-medium" id="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
            ?>
elm_zipcode<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
" name="customer_location[zipcode]" size="20" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_zipcode'], ENT_QUOTES, 'UTF-8');
            ?>
" />
                </div>

                <div class="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
                    <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_name' => "dispatch[checkout.shipping_estimation]", 'but_role' => "text", 'but_id' => "but_get_rates"), 0);
            ?>

                </div>

            </form>

            <?php 
            if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") {
                ?>
                <?php 
                if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_failed'] && !$_smarty_tpl->tpl_vars['cart']->value['company_shipping_failed']) {
                    ?>
                    <?php 
                    if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                        ?>
                        <div class="ty-estimation__title"><?php 
                        echo $_smarty_tpl->__("select_shipping_method");
                        ?>
</div>
                    <?php 
                    }
                    ?>
                    <form class="cm-ajax" name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8');
                    ?>
select_shipping_form<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" action="<?php 
                    echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                    ?>
" method="post">
                    <input type="hidden" name="redirect_mode" value="cart" />
                    <input type="hidden" name="result_ids" value="checkout_totals" />

                    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>


                    <?php 
                        $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars['group']->_loop = false;
                        $_smarty_tpl->tpl_vars['group_key'] = new Smarty_Variable();
                        $_from = $_smarty_tpl->tpl_vars['product_groups']->value;
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars['group']->key => $_smarty_tpl->tpl_vars['group']->value) {
                            $_smarty_tpl->tpl_vars['group']->_loop = true;
                            $_smarty_tpl->tpl_vars['group_key']->value = $_smarty_tpl->tpl_vars['group']->key;
                            ?>
                        <p>
                        <strong><?php 
                            echo $_smarty_tpl->__("vendor");
                            ?>
:&nbsp;</strong><?php 
                            echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['group']->value['name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8');
                            ?>

                        </p>
                        <?php 
                            if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) {
                                ?>
                            <ul>
                            <?php 
                                $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["product"]->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['group']->value['products'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
                                    $_smarty_tpl->tpl_vars["product"]->_loop = true;
                                    ?>
                                <li>
                                    <?php 
                                    if ($_smarty_tpl->tpl_vars['product']->value['product']) {
                                        ?>
                                        <?php 
                                        echo $_smarty_tpl->tpl_vars['product']->value['product'];
                                        ?>

                                    <?php 
                                    } else {
                                        ?>
                                        <?php 
                                        echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                                        ?>

                                    <?php 
                                    }
                                    ?>
                                </li>
                            <?php 
                                }
                                ?>
                            </ul>
                        <?php 
                            }
                            ?>

                        <?php 
                            if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) {
                                ?>
                            <?php 
                                $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['group']->value['shippings'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                                    $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                                    ?>

                                <?php 
                                    if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0);
                                        ?>
                                <?php 
                                    } else {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0);
                                        ?>
                                <?php 
                                    }
                                    ?>

                                <?php 
                                    if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0);
                                        ?>
                                <?php 
                                    } else {
                                        ?>
                                    <?php 
                                        $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0);
                                        ?>
                                <?php 
                                    }
                                    ?>

                                <?php 
                                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation_method"));
                                    $_block_repeat = true;
                                    echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), null, $_smarty_tpl, $_block_repeat);
                                    while ($_block_repeat) {
                                        ob_start();
                                        ?>

                                <?php 
                                        if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) {
                                            ?>
                                    <?php 
                                            $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null);
                                            ob_start();
                                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0);
                                            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                                            if (!empty($_capture_buffer)) {
                                                if (isset($_capture_assign)) {
                                                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                                                }
                                                if (isset($_capture_append)) {
                                                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                                                }
                                                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                                            } else {
                                                $_smarty_tpl->capture_error();
                                            }
                                            ?>
                                    <?php 
                                            if ($_smarty_tpl->tpl_vars['shipping']->value['inc_tax']) {
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0);
                                                ?>
                                        <?php 
                                                if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) {
                                                    ?>
                                            <?php 
                                                    $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null);
                                                    ob_start();
                                                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0);
                                                    list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                                                    if (!empty($_capture_buffer)) {
                                                        if (isset($_capture_assign)) {
                                                            $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                                                        }
                                                        if (isset($_capture_append)) {
                                                            $_smarty_tpl->append($_capture_append, ob_get_contents());
                                                        }
                                                        Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                                                    } else {
                                                        $_smarty_tpl->capture_error();
                                                    }
                                                    ?>
                                            <?php 
                                                    $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0);
                                                    ?>
                                        <?php 
                                                }
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0);
                                                ?>
                                        <?php 
                                                $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0);
                                                ?>
                                    <?php 
                                            }
                                            ?>
                                <?php 
                                        } else {
                                            ?>
                                    <?php 
                                            $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0);
                                            ?>
                                <?php 
                                        }
                                        ?>

                                <p>
                                    <input type="radio" class="ty-valign" id="sh_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" name="shipping_ids[<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
]" value="<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" onclick="fn_calculate_total_shipping();" <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
 /><label for="sh_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                                        ?>
" class="ty-valign"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
                                        ?>
 <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
 - <?php 
                                        echo $_smarty_tpl->tpl_vars['rate']->value;
                                        ?>
</label>
                                </p>
                                <?php 
                                        $_block_content = ob_get_clean();
                                        $_block_repeat = false;
                                        echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), $_block_content, $_smarty_tpl, $_block_repeat);
                                    }
                                    array_pop($_smarty_tpl->smarty->_tag_stack);
                                    ?>

                            <?php 
                                }
                                ?>

                        <?php 
                            } else {
                                ?>
                            <?php 
                                if ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("no_shipping_required");
                                    ?>
</p>
                            <?php 
                                } elseif ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping']) {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("free_shipping");
                                    ?>
</p>
                            <?php 
                                } else {
                                    ?>
                                <p><?php 
                                    echo $_smarty_tpl->__("text_no_shipping_methods");
                                    ?>
</p>
                            <?php 
                                }
                                ?>
                        <?php 
                            }
                            ?>

                    <?php 
                        }
                        ?>

                    <p><strong><?php 
                        echo $_smarty_tpl->__("total");
                        ?>
:</strong>&nbsp;<?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0);
                        ?>
</p>

                    <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>


                    <div class="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
                        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select"), 'but_role' => "text", 'but_name' => "dispatch[checkout.update_shipping]", 'but_id' => "but_select_shipping", 'but_meta' => "cm-dialog-closer"), 0);
                    ?>

                    </div>

                    </form>
                <?php 
                } else {
                    ?>
                    <p class="ty-error-text">
                        <?php 
                    echo $_smarty_tpl->__("text_no_shipping_methods");
                    ?>

                    </p>
                <?php 
                }
                ?>

            <?php 
            }
            ?>
        <!--shipping_estimation<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") {
                ?>
_sidebox<?php 
            }
            echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></div>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") {
                ?>
    </div>
</div>
<?php 
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['location']->value == "popup") {
                ?>
<div class="ty-estimation-buttons buttons-container" id="shipping_estimation_buttons">
    <?php 
                if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") {
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("recalculate_rates"), 'but_external_click_id' => "but_get_rates", 'but_role' => "text", 'but_meta' => "ty-btn__secondary cm-external-click ty-float-right ty-estimation-buttons__rate"), 0);
                    ?>


        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select_shipping_method"), 'but_external_click_id' => "but_select_shipping", 'but_meta' => "ty-btn__secondary cm-external-click cm-dialog-closer"), 0);
                    ?>

    <?php 
                } else {
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_external_click_id' => "but_get_rates", 'but_meta' => "ty-btn__secondary cm-external-click"), 0);
                    ?>

    <?php 
                }
                ?>
<!--shipping_estimation_buttons--></div>
<?php 
            }
        }
    }
Beispiel #4
0
            }
        }
        exit;
    }
    return array(CONTROLLER_STATUS_OK, 'suppliers' . $suffix);
}
if ($mode == 'manage') {
    list($suppliers, $search) = fn_get_suppliers($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'));
    $view = Tygh::$app['view'];
    $view->assign('search', $search);
    $view->assign('suppliers', $suppliers);
    $view->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    $view->assign('states', fn_get_all_states());
} elseif ($mode == 'update' || $mode == 'add') {
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'products' => array('title' => __('products'), 'js' => true), 'shippings' => array('title' => __('shippings'), 'js' => true)));
    $supplier = !empty($_REQUEST['supplier_id']) ? fn_get_supplier_data($_REQUEST['supplier_id']) : array();
    $condition = " AND ?:shippings.status = 'A'";
    if (Registry::get('runtime.company_id') && !fn_allowed_for('ULTIMATE')) {
        $condition = fn_get_company_condition('?:shippings.company_id');
        $company_data = Registry::get('runtime.company_data');
        if (!empty($company_data['shippings'])) {
            $condition .= db_quote(" OR ?:shippings.shipping_id IN (?n)", explode(',', $company_data['shippings']));
        }
    }
    $shippings = db_get_hash_array("SELECT ?:shippings.shipping_id, ?:shipping_descriptions.shipping FROM ?:shippings LEFT JOIN ?:shipping_descriptions ON ?:shippings.shipping_id = ?:shipping_descriptions.shipping_id AND ?:shipping_descriptions.lang_code = ?s LEFT JOIN ?:companies ON ?:companies.company_id = ?:shippings.company_id WHERE 1 {$condition} ORDER BY ?:shippings.position", 'shipping_id', CART_LANGUAGE);
    $view = Tygh::$app['view'];
    $view->assign('shippings', $shippings);
    $view->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
    $view->assign('states', fn_get_all_states());
    $view->assign('supplier', $supplier);
}
Beispiel #5
0
        if (!empty($_REQUEST['state_id'])) {
            db_query("DELETE FROM ?:states WHERE state_id = ?i", $_REQUEST['state_id']);
            db_query("DELETE FROM ?:state_descriptions WHERE state_id = ?i", $_REQUEST['state_id']);
        }
    }
    return array(CONTROLLER_STATUS_OK, 'states.manage?country_code=' . $_REQUEST['country_code']);
}
if ($mode == 'manage') {
    $params = $_REQUEST;
    if (empty($params['country_code'])) {
        $params['country_code'] = Registry::get('settings.General.default_country');
    }
    list($states, $search) = fn_get_states($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
    Tygh::$app['view']->assign('states', $states);
    Tygh::$app['view']->assign('search', $search);
    Tygh::$app['view']->assign('countries', fn_get_simple_countries(false, DESCR_SL));
}
function fn_update_state($state_data, $state_id = 0, $lang_code = DESCR_SL)
{
    if (empty($state_id)) {
        if (!empty($state_data['code']) && !empty($state_data['state'])) {
            $state_data['state_id'] = $state_id = db_query("REPLACE INTO ?:states ?e", $state_data);
            foreach (fn_get_translation_languages() as $state_data['lang_code'] => $_v) {
                db_query('REPLACE INTO ?:state_descriptions ?e', $state_data);
            }
        }
    } else {
        db_query("UPDATE ?:state_descriptions SET ?u WHERE state_id = ?i AND lang_code = ?s", $state_data, $state_id, $lang_code);
    }
    return $state_id;
}
    }
    return array(CONTROLLER_STATUS_OK, "localizations{$suffix}");
}
if ($mode == 'update') {
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    Registry::get('view')->assign('localization', $localizaton);
    Registry::get('view')->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    Registry::get('view')->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    Registry::get('view')->assign('localization_languages', array_diff(fn_get_simple_languages(true), $localizaton['languages']));
    Registry::get('view')->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    Registry::get('view')->assign('localization_countries', fn_get_simple_countries());
    Registry::get('view')->assign('localization_currencies', fn_get_simple_currencies());
    Registry::get('view')->assign('localization_languages', fn_get_simple_languages(true));
    Registry::get('view')->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    Registry::get('view')->assign('localizations', fn_get_localizations(DESCR_SL));
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['localization_id'])) {
        fn_delete_localization((array) $_REQUEST['localization_id']);
    }
    return array(CONTROLLER_STATUS_OK, "localizations.manage");
}
function fn_delete_localization($localization_ids)
{
    $loc_objects = fn_get_localization_objects();
Beispiel #7
0
    }
    return array(CONTROLLER_STATUS_OK, 'localizations' . $suffix);
}
if ($mode == 'update') {
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    Tygh::$app['view']->assign('localization', $localizaton);
    Tygh::$app['view']->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    Tygh::$app['view']->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    Tygh::$app['view']->assign('localization_languages', array_diff(fn_get_simple_languages(true), $localizaton['languages']));
    Tygh::$app['view']->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    Tygh::$app['view']->assign('localization_countries', fn_get_simple_countries());
    Tygh::$app['view']->assign('localization_currencies', fn_get_simple_currencies());
    Tygh::$app['view']->assign('localization_languages', fn_get_simple_languages(true));
    Tygh::$app['view']->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'details' => array('title' => __('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    Tygh::$app['view']->assign('localizations', fn_get_localizations(DESCR_SL));
}
function fn_delete_localization($localization_ids)
{
    $loc_objects = fn_get_localization_objects();
    fn_set_progress('parts', sizeof($localization_ids) * sizeof($loc_objects));
    foreach ($localization_ids as $loc_id) {
        foreach ($loc_objects as $table) {
            fn_set_progress('echo', __('converting_data_in_table', array('[table]' => $table)));
            db_query("UPDATE ?:{$table} SET localization = ?p", fn_remove_from_set('localization', $loc_id));
Beispiel #8
0
} elseif ($mode == 'translations') {
    $sections = array('translations' => array('title' => __('translations'), 'href' => fn_url('languages.translations')), 'manage_languages' => array('title' => __('manage_languages'), 'href' => fn_url('languages.manage')));
    Registry::set('navigation.dynamic.sections', $sections);
    Registry::set('navigation.dynamic.active_section', 'translations');
    list($lang_data, $search) = LanguageValues::getVariables($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'));
    Registry::get('view')->assign('lang_data', $lang_data);
    Registry::get('view')->assign('search', $search);
} elseif ($mode == 'update') {
    $lang_data = Languages::get(array('lang_id' => $_REQUEST['lang_id']), 'lang_id');
    if (empty($lang_data[$_REQUEST['lang_id']])) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    } else {
        $lang_data = $lang_data[$_REQUEST['lang_id']];
    }
    Registry::get('view')->assign('lang_data', $lang_data);
    Registry::get('view')->assign('countries', fn_get_simple_countries(false, DESCR_SL));
} elseif ($mode == 'update_translation') {
    $lang_data = Languages::get(array('lang_id' => $_REQUEST['lang_id']), 'lang_id');
    if (empty($lang_data[$_REQUEST['lang_id']])) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    } else {
        $lang_data = $lang_data[$_REQUEST['lang_id']];
    }
    Registry::get('view')->assign('lang_data', $lang_data);
}
/**
 * @deprecated
 *
 * Updates language
 *
 * @param array $language_data Language data
    function content_55db8bf92e8236_50589251($_smarty_tpl)
    {
        if (!is_callable('smarty_block_inline_script')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.inline_script.php';
        }
        if (!is_callable('smarty_modifier_in_array')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.in_array.php';
        }
        fn_preload_lang_vars(array('no_items', 'multiple_selectbox_notice', 'no_items', 'select_country', 'select_state', 'browse', 'no_items'));
        if ($_smarty_tpl->tpl_vars['item']->value['update_for_all'] && $_smarty_tpl->tpl_vars['settings']->value['Stores']['default_state_update_for_all'] == 'not_active' && !$_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["disable_input"] = new Smarty_variable(true, null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['parent_item']->value) {
            $_smarty_tpl->smarty->_tag_stack[] = array('inline_script', array());
            $_block_repeat = true;
            echo smarty_block_inline_script(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                echo '<script';
                ?>
 type="text/javascript">
(function($, _) {
    $('#<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['parent_item_html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
').on('click', function() {
        $('#container_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
').toggle();
    });
}(Tygh.$, Tygh));
<?php 
                echo '</script';
                ?>
><?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_inline_script(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
        ?>


<?php 
        if ($_smarty_tpl->tpl_vars['item']->value['type'] == "O") {
            ?>
    <div><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['info'];
            ?>
</div>
<?php 
        } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "E") {
            ?>
    <div><?php 
            echo $_smarty_tpl->getSubTemplate("addons/" . (string) $_REQUEST['addon'] . "/settings/" . (string) $_smarty_tpl->tpl_vars['item']->value['value'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
            ?>
</div>
<?php 
        } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "Z") {
            ?>
    <div><?php 
            echo $_smarty_tpl->getSubTemplate("addons/" . (string) $_REQUEST['addon'] . "/settings/" . (string) $_smarty_tpl->tpl_vars['item']->value['value'], $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('skip_addon_check' => true), 0);
            ?>
</div>
<?php 
        } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "H") {
            ?>
    <?php 
            if (Smarty::$_smarty_vars['capture']['header_first'] == 'true') {
                ?>
            </fieldset>
        </div>
    <?php 
            }
            ?>
    <?php 
            $_smarty_tpl->_capture_stack[0][] = array("header_first", null, null);
            ob_start();
            ?>
true<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['item']->value['description'], 'target' => "#collapsable_" . (string) $_smarty_tpl->tpl_vars['html_id']->value), 0);
            ?>

    <div id="collapsable_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="in collapse">
        <fieldset>
<?php 
        } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] != "D" && $_smarty_tpl->tpl_vars['item']->value['type'] != "B") {
            ?>
    
    <div id="container_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="control-group<?php 
            if ($_smarty_tpl->tpl_vars['class']->value) {
                ?>
 <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['class']->value, ENT_QUOTES, 'UTF-8');
            }
            ?>
 <?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['section_name'], ENT_QUOTES, 'UTF-8');
            ?>
 <?php 
            if ($_smarty_tpl->tpl_vars['parent_item']->value && $_smarty_tpl->tpl_vars['parent_item']->value['value'] != "Y") {
                ?>
hidden<?php 
            }
            ?>
">
        <label for="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="control-label <?php 
            if ($_smarty_tpl->tpl_vars['highlight']->value && smarty_modifier_in_array($_smarty_tpl->tpl_vars['item']->value['name'], $_smarty_tpl->tpl_vars['highlight']->value)) {
                ?>
highlight<?php 
            }
            ?>
" ><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['description'];
            if ($_smarty_tpl->tpl_vars['item']->value['tooltip']) {
                echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => $_smarty_tpl->tpl_vars['item']->value['tooltip']), 0);
            }
            ?>
:
        </label>

        <div class="controls">
            <?php 
            if ($_smarty_tpl->tpl_vars['item']->value['type'] == "P") {
                ?>
                <input id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" type="password" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" size="30" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['value'], ENT_QUOTES, 'UTF-8');
                ?>
" class="input-text" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
 />
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "T") {
                ?>
                <textarea id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" rows="5" cols="19" class="input-large" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['value'], ENT_QUOTES, 'UTF-8');
                ?>
</textarea>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "C") {
                ?>
                <input type="hidden" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" value="N" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
 />
                <input id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" type="checkbox" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" value="Y" <?php 
                if ($_smarty_tpl->tpl_vars['item']->value['value'] == "Y") {
                    ?>
checked="checked"<?php 
                }
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
 disabled="disabled"<?php 
                }
                ?>
 />
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "S") {
                ?>
                <select id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                    <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                        <option value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'] == $_smarty_tpl->tpl_vars['k']->value) {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</option>
                    <?php 
                }
                ?>
                </select>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "R") {
                ?>
                <div class="select-field" id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
                <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                    <label for="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="radio">
                        <input type="radio" name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'] == $_smarty_tpl->tpl_vars['k']->value) {
                        ?>
checked="checked"<?php 
                    }
                    ?>
 id="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                        ?>
disabled="disabled"<?php 
                    }
                    ?>
> <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>

                    </label>
                <?php 
                }
                if (!$_smarty_tpl->tpl_vars['v']->_loop) {
                    ?>
                    <?php 
                    echo $_smarty_tpl->__("no_items");
                    ?>

                <?php 
                }
                ?>
                </div>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "M") {
                ?>
                <select id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
[]" multiple="multiple" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                <option value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'][$_smarty_tpl->tpl_vars['k']->value] == "Y") {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</option>
                <?php 
                }
                ?>
                </select>
                <div class="muted"><?php 
                echo $_smarty_tpl->__("multiple_selectbox_notice");
                ?>
</div>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "N") {
                ?>
                <div class="select-field" id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
                    <input type="hidden" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" value="N" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
 />
                    <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                        <label for="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="checkbox">
                            <input type="checkbox" name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
[]" id="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'][$_smarty_tpl->tpl_vars['k']->value] == "Y") {
                        ?>
checked="checked"<?php 
                    }
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                        ?>
disabled="disabled"<?php 
                    }
                    ?>
>
                            <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>

                        </label>
                    <?php 
                }
                if (!$_smarty_tpl->tpl_vars['v']->_loop) {
                    ?>
                        <?php 
                    echo $_smarty_tpl->__("no_items");
                    ?>

                    <?php 
                }
                ?>
                </div>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "X") {
                ?>
                <select class="cm-country cm-location-billing" id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                    <option value="">- <?php 
                echo $_smarty_tpl->__("select_country");
                ?>
 -</option>
                    <?php 
                $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(''), null, 0);
                ?>
                    <?php 
                $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["country"]->_loop = false;
                $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['countries']->value;
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) {
                    $_smarty_tpl->tpl_vars["country"]->_loop = true;
                    $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key;
                    ?>
                        <option value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['code']->value == $_smarty_tpl->tpl_vars['item']->value['value']) {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</option>
                    <?php 
                }
                ?>
                </select>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "W") {
                ?>
                <select class="cm-state cm-location-billing" id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                    <option value="">- <?php 
                echo $_smarty_tpl->__("select_state");
                ?>
 -</option>
                </select>
                <input type="text" id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
_d" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['value'], ENT_QUOTES, 'UTF-8');
                ?>
" size="32" maxlength="64" disabled="disabled" class="cm-state cm-location-billing hidden" />
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "F") {
                ?>
                <div class="input-append">
                    <input id="file_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" type="text" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['value'], ENT_QUOTES, 'UTF-8');
                ?>
" size="30" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                    <button id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" type="button" class="btn" onclick="Tygh.fileuploader.init('box_server_upload', this.id);" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
><?php 
                echo $_smarty_tpl->__("browse");
                ?>
</button>
                </div>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "G") {
                ?>
                <div id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
                    <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                        <label for="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="checkbox">
                            <input type="checkbox" class="cm-combo-checkbox" id="variant_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['name'], ENT_QUOTES, 'UTF-8');
                    ?>
_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" name="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                    ?>
[]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'][$_smarty_tpl->tpl_vars['k']->value] == "Y") {
                        ?>
checked="checked"<?php 
                    }
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                        ?>
disabled="disabled"<?php 
                    }
                    ?>
>
                            <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>

                        </label>
                    <?php 
                }
                if (!$_smarty_tpl->tpl_vars['v']->_loop) {
                    ?>
                        <?php 
                    echo $_smarty_tpl->__("no_items");
                    ?>

                    <?php 
                }
                ?>
                </div>
            <?php 
            } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "K") {
                ?>
                <select id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" class="cm-combo-select" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
>
                    <?php 
                $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars['v']->_loop = false;
                $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['item']->value['variants'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
                    $_smarty_tpl->tpl_vars['v']->_loop = true;
                    $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
                    ?>
                        <option value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['item']->value['value'] == $_smarty_tpl->tpl_vars['k']->value) {
                        ?>
selected="selected"<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</option>
                    <?php 
                }
                ?>
                </select>
            <?php 
            } else {
                ?>
                <input id="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" type="text" name="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['html_name']->value, ENT_QUOTES, 'UTF-8');
                ?>
" size="30" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value['value'], ENT_QUOTES, 'UTF-8');
                ?>
" class="<?php 
                if ($_smarty_tpl->tpl_vars['item']->value['type'] == "U") {
                    ?>
 cm-value-integer<?php 
                }
                ?>
" <?php 
                if ($_smarty_tpl->tpl_vars['disable_input']->value) {
                    ?>
disabled="disabled"<?php 
                }
                ?>
 />
            <?php 
            }
            ?>
            <div class="right update-for-all">
                <?php 
            echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['item']->value['update_for_all'], 'object_id' => $_smarty_tpl->tpl_vars['item']->value['object_id'], 'name' => "update_all_vendors[" . (string) $_smarty_tpl->tpl_vars['item']->value['object_id'] . "]", 'hide_element' => $_smarty_tpl->tpl_vars['html_id']->value), 0);
            ?>

            </div>
        </div>
    </div>
<?php 
        } elseif ($_smarty_tpl->tpl_vars['item']->value['type'] == "B") {
            ?>
    <div class="control-group">
        <?php 
            echo $_smarty_tpl->getSubTemplate("common/selectable_box.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('addon' => $_smarty_tpl->tpl_vars['section']->value, 'name' => $_smarty_tpl->tpl_vars['html_name']->value, 'id' => $_smarty_tpl->tpl_vars['html_id']->value, 'fields' => $_smarty_tpl->tpl_vars['item']->value['variants'], 'selected_fields' => $_smarty_tpl->tpl_vars['item']->value['value']), 0);
            ?>

    </div>
<?php 
        }
        if ($_smarty_tpl->tpl_vars['total']->value == $_smarty_tpl->tpl_vars['index']->value && Smarty::$_smarty_vars['capture']['header_first'] == 'true') {
            ?>
    </fieldset>
        </div>
<?php 
        }
    }
    function content_55d5c53cb17bd4_19534470($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_script')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('continue', 'select', 'select_country', 'select_state', 'submit', 'continue', 'select', 'select_country', 'select_state', 'submit'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['page']->value['page_type'] == @constant('PAGE_TYPE_FORM')) {
                ?>
    <?php 
                if ($_REQUEST['sent'] == "Y") {
                    ?>

        <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:form_sent"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "pages:form_sent"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

        <?php 
                        $_smarty_tpl->tpl_vars["form_submit_const"] = new Smarty_variable(@constant('FORM_SUBMIT'), null, 0);
                        ?>
        <p><?php 
                        echo $_smarty_tpl->tpl_vars['page']->value['form']['general'][$_smarty_tpl->tpl_vars['form_submit_const']->value];
                        ?>
</p>
        <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "pages:form_sent"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>


        <div class="ty-form-builder__buttons buttons-container">
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("continue"), 'but_meta' => "ty-btn__secondary", 'but_href' => fn_url($_smarty_tpl->tpl_vars['continue_url']->value), 'but_role' => "action"), 0);
                    ?>

        </div>
    <?php 
                } else {
                    ?>

    <?php 
                    if ($_smarty_tpl->tpl_vars['page']->value['description']) {
                        ?>
        <div class="ty-form-builder__description"><?php 
                        echo $_smarty_tpl->tpl_vars['page']->value['description'];
                        ?>
</div>
    <?php 
                    }
                    ?>

<div class="ty-form-builder">
    <form action="<?php 
                    echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                    ?>
" method="post" name="forms_form" enctype="multipart/form-data">
    <input type="hidden" name="fake" value="1" />
    <input type="hidden" name="page_id" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['page']->value['page_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" />

    <?php 
                    $_smarty_tpl->tpl_vars["element"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["element"]->_loop = false;
                    $_smarty_tpl->tpl_vars["element_id"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['page']->value['form']['elements'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["element"]->key => $_smarty_tpl->tpl_vars["element"]->value) {
                        $_smarty_tpl->tpl_vars["element"]->_loop = true;
                        $_smarty_tpl->tpl_vars["element_id"]->value = $_smarty_tpl->tpl_vars["element"]->key;
                        ?>

    <?php 
                        if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_SEPARATOR')) {
                            ?>
        <hr class="ty-form-builder__separator" />
    <?php 
                        } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_HEADER')) {
                            ?>

    <?php 
                            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['element']->value['description']), 0);
                            ?>


    <?php 
                        } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] != @constant('FORM_IP_ADDRESS') && $_smarty_tpl->tpl_vars['element']->value['element_type'] != @constant('FORM_REFERER')) {
                            ?>
        <div class="ty-control-group">
            <label for="<?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_FILE')) {
                                ?>
type_<?php 
                                echo htmlspecialchars(md5("fb_files[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]"), ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                            }
                            ?>
" class="ty-control-group__title <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['required'] == "Y") {
                                ?>
cm-required<?php 
                            }
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL')) {
                                ?>
 cm-email<?php 
                            }
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_PHONE')) {
                                ?>
 cm-phone<?php 
                            }
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_CB')) {
                                ?>
cm-multiple-checkboxes<?php 
                            }
                            ?>
"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['description'], ENT_QUOTES, 'UTF-8');
                            ?>
</label>

            <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_SELECT')) {
                                ?>
                <select id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__select" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]">
                    <option label="" value="">- <?php 
                                echo $_smarty_tpl->__("select");
                                ?>
 -</option>
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                    <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                <?php 
                                }
                                ?>
                </select>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_RADIO')) {
                                ?>
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                $_smarty_tpl->tpl_vars['smarty']->value['foreach']["rd"]['iteration'] = 0;
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    $_smarty_tpl->tpl_vars['smarty']->value['foreach']["rd"]['iteration']++;
                                    ?>
                <label class="ty-form-builder__radio-label">
                    <input class="ty-form-builder__radio radio" <?php 
                                    if (!$_smarty_tpl->tpl_vars['form_values']->value && $_smarty_tpl->getVariable('smarty')->value['foreach']['rd']['iteration'] == 1 || $_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
checked="checked"<?php 
                                    }
                                    ?>
 type="radio" name="form_values[<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
]" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" /><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
&nbsp;&nbsp;
                </label>
                <?php 
                                }
                                ?>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_CHECKBOX')) {
                                ?>
                <input type="hidden" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="N" />
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__checkbox checkbox" <?php 
                                if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == "Y") {
                                    ?>
checked="checked"<?php 
                                }
                                ?>
 type="checkbox" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="Y" />
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_SB')) {
                                ?>
                <select class="ty-form-builder__multiple-select" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
][]" multiple="multiple" >
                    <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                        <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                    <?php 
                                }
                                ?>
                </select>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_CB')) {
                                ?>
                <div id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
">
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                    <label class="ty-form-builder__checkbox-label">
                        <input class="ty-form-builder__checkbox" type="checkbox" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
checked="checked"<?php 
                                    }
                                    ?>
 id="elm_<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
_<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" name="form_values[<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
][]" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" />
                        <?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>

                    </label>
                <?php 
                                }
                                ?>
                </div>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_INPUT')) {
                                ?>
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__input-text ty-input-text" size="50" type="text" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
" />

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_TEXTAREA')) {
                                ?>
                <textarea id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__textarea" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" cols="67" rows="10"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
</textarea>

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_DATE')) {
                                ?>
                <?php 
                                echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_name' => "form_values[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]", 'date_id' => "elm_" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'], 'date_val' => $_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value]), 0);
                                ?>


            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL') || $_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_NUMBER') || $_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_PHONE')) {
                                ?>

                <?php 
                                if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL')) {
                                    ?>
                <input type="hidden" name="customer_email" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" />
                <?php 
                                }
                                ?>
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-input-text" size="50" type="text" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
" />
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_COUNTRIES')) {
                                ?>

                <?php 
                                $_smarty_tpl->tpl_vars['_country'] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['elm_id']->value]) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['settings']->value['General']['default_country'] : $tmp, null, 0);
                                ?>
                <select id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" class="ty-form-builder__country cm-country cm-location-billing">
                    <option value="">- <?php 
                                echo $_smarty_tpl->__("select_country");
                                ?>
 -</option>
                    <?php 
                                $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0);
                                ?>
                    <?php 
                                $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["country"]->_loop = false;
                                $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable();
                                $_from = $_smarty_tpl->tpl_vars['countries']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) {
                                    $_smarty_tpl->tpl_vars["country"]->_loop = true;
                                    $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key;
                                    ?>
                    <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['_country']->value == $_smarty_tpl->tpl_vars['code']->value) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                    <?php 
                                }
                                ?>
                </select>

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_STATES')) {
                                ?>

                <?php 
                                echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => fn_get_all_states(1)), 0);
                                ?>


                <?php 
                                $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['elm_id']->value]) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['settings']->value['General']['default_state'] : $tmp, null, 0);
                                ?>
                <select class="ty-form-builder__state cm-state cm-location-billing" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]">
                    <option label="" value="">- <?php 
                                echo $_smarty_tpl->__("select_state");
                                ?>
 -</option>
                </select>
                <input type="text" class="cm-state cm-location-billing ty-input-text hidden" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
_d" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" size="32" maxlength="64" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" disabled="disabled" />
            
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_FILE')) {
                                ?>
                <?php 
                                echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl);
                                ?>

                <?php 
                                echo $_smarty_tpl->getSubTemplate("common/fileuploader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('var_name' => "fb_files[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]"), 0);
                                ?>

            <?php 
                            }
                            ?>

            <?php 
                            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:form_elements"));
                            $_block_repeat = true;
                            echo smarty_block_hook(array('name' => "pages:form_elements"), null, $_smarty_tpl, $_block_repeat);
                            while ($_block_repeat) {
                                ob_start();
                                ?>

            <?php 
                                $_block_content = ob_get_clean();
                                $_block_repeat = false;
                                echo smarty_block_hook(array('name' => "pages:form_elements"), $_block_content, $_smarty_tpl, $_block_repeat);
                            }
                            array_pop($_smarty_tpl->smarty->_tag_stack);
                            ?>

        </div>
    <?php 
                        }
                        ?>
    <?php 
                    }
                    ?>

    <?php 
                    echo $_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_form_builder"), 0);
                    ?>


    <div class="ty-form-builder__buttons buttons-container">
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "submit", 'but_text' => __("submit"), 'but_meta' => "ty-btn__secondary", 'but_name' => "dispatch[pages.send_form]"), 0);
                    ?>

    </div>

    </form>

    <?php 
                }
                ?>

    <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:page_content"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "pages:page_content"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "pages:page_content"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>


</div>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="addons/form_builder/hooks/pages/page_content.override.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "addons/form_builder/hooks/pages/page_content.override.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            if ($_smarty_tpl->tpl_vars['page']->value['page_type'] == @constant('PAGE_TYPE_FORM')) {
                ?>
    <?php 
                if ($_REQUEST['sent'] == "Y") {
                    ?>

        <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:form_sent"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "pages:form_sent"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

        <?php 
                        $_smarty_tpl->tpl_vars["form_submit_const"] = new Smarty_variable(@constant('FORM_SUBMIT'), null, 0);
                        ?>
        <p><?php 
                        echo $_smarty_tpl->tpl_vars['page']->value['form']['general'][$_smarty_tpl->tpl_vars['form_submit_const']->value];
                        ?>
</p>
        <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "pages:form_sent"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>


        <div class="ty-form-builder__buttons buttons-container">
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("continue"), 'but_meta' => "ty-btn__secondary", 'but_href' => fn_url($_smarty_tpl->tpl_vars['continue_url']->value), 'but_role' => "action"), 0);
                    ?>

        </div>
    <?php 
                } else {
                    ?>

    <?php 
                    if ($_smarty_tpl->tpl_vars['page']->value['description']) {
                        ?>
        <div class="ty-form-builder__description"><?php 
                        echo $_smarty_tpl->tpl_vars['page']->value['description'];
                        ?>
</div>
    <?php 
                    }
                    ?>

<div class="ty-form-builder">
    <form action="<?php 
                    echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                    ?>
" method="post" name="forms_form" enctype="multipart/form-data">
    <input type="hidden" name="fake" value="1" />
    <input type="hidden" name="page_id" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['page']->value['page_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" />

    <?php 
                    $_smarty_tpl->tpl_vars["element"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["element"]->_loop = false;
                    $_smarty_tpl->tpl_vars["element_id"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['page']->value['form']['elements'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["element"]->key => $_smarty_tpl->tpl_vars["element"]->value) {
                        $_smarty_tpl->tpl_vars["element"]->_loop = true;
                        $_smarty_tpl->tpl_vars["element_id"]->value = $_smarty_tpl->tpl_vars["element"]->key;
                        ?>

    <?php 
                        if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_SEPARATOR')) {
                            ?>
        <hr class="ty-form-builder__separator" />
    <?php 
                        } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_HEADER')) {
                            ?>

    <?php 
                            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['element']->value['description']), 0);
                            ?>


    <?php 
                        } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] != @constant('FORM_IP_ADDRESS') && $_smarty_tpl->tpl_vars['element']->value['element_type'] != @constant('FORM_REFERER')) {
                            ?>
        <div class="ty-control-group">
            <label for="<?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_FILE')) {
                                ?>
type_<?php 
                                echo htmlspecialchars(md5("fb_files[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]"), ENT_QUOTES, 'UTF-8');
                            } else {
                                ?>
elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                            }
                            ?>
" class="ty-control-group__title <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['required'] == "Y") {
                                ?>
cm-required<?php 
                            }
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL')) {
                                ?>
 cm-email<?php 
                            }
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_PHONE')) {
                                ?>
 cm-phone<?php 
                            }
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_CB')) {
                                ?>
cm-multiple-checkboxes<?php 
                            }
                            ?>
"><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['description'], ENT_QUOTES, 'UTF-8');
                            ?>
</label>

            <?php 
                            if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_SELECT')) {
                                ?>
                <select id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__select" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]">
                    <option label="" value="">- <?php 
                                echo $_smarty_tpl->__("select");
                                ?>
 -</option>
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                    <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                <?php 
                                }
                                ?>
                </select>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_RADIO')) {
                                ?>
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                $_smarty_tpl->tpl_vars['smarty']->value['foreach']["rd"]['iteration'] = 0;
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    $_smarty_tpl->tpl_vars['smarty']->value['foreach']["rd"]['iteration']++;
                                    ?>
                <label class="ty-form-builder__radio-label">
                    <input class="ty-form-builder__radio radio" <?php 
                                    if (!$_smarty_tpl->tpl_vars['form_values']->value && $_smarty_tpl->getVariable('smarty')->value['foreach']['rd']['iteration'] == 1 || $_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
checked="checked"<?php 
                                    }
                                    ?>
 type="radio" name="form_values[<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
]" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" /><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
&nbsp;&nbsp;
                </label>
                <?php 
                                }
                                ?>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_CHECKBOX')) {
                                ?>
                <input type="hidden" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="N" />
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__checkbox checkbox" <?php 
                                if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == "Y") {
                                    ?>
checked="checked"<?php 
                                }
                                ?>
 type="checkbox" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="Y" />
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_SB')) {
                                ?>
                <select class="ty-form-builder__multiple-select" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
][]" multiple="multiple" >
                    <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                        <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                    <?php 
                                }
                                ?>
                </select>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_MULTIPLE_CB')) {
                                ?>
                <div id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
">
                <?php 
                                $_smarty_tpl->tpl_vars['var'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['var']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['element']->value['variants'];
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['var']->key => $_smarty_tpl->tpl_vars['var']->value) {
                                    $_smarty_tpl->tpl_vars['var']->_loop = true;
                                    ?>
                    <label class="ty-form-builder__checkbox-label">
                        <input class="ty-form-builder__checkbox" type="checkbox" <?php 
                                    if ($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value] == $_smarty_tpl->tpl_vars['var']->value['element_id']) {
                                        ?>
checked="checked"<?php 
                                    }
                                    ?>
 id="elm_<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
_<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" name="form_values[<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
][]" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" />
                        <?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value['description'], ENT_QUOTES, 'UTF-8');
                                    ?>

                    </label>
                <?php 
                                }
                                ?>
                </div>
                
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_INPUT')) {
                                ?>
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__input-text ty-input-text" size="50" type="text" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
" />

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_TEXTAREA')) {
                                ?>
                <textarea id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-form-builder__textarea" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" cols="67" rows="10"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
</textarea>

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_DATE')) {
                                ?>
                <?php 
                                echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_name' => "form_values[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]", 'date_id' => "elm_" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'], 'date_val' => $_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value]), 0);
                                ?>


            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL') || $_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_NUMBER') || $_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_PHONE')) {
                                ?>

                <?php 
                                if ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_EMAIL')) {
                                    ?>
                <input type="hidden" name="customer_email" value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                    ?>
" />
                <?php 
                                }
                                ?>
                <input id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-input-text" size="50" type="text" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['element_id']->value], ENT_QUOTES, 'UTF-8');
                                ?>
" />
                
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_COUNTRIES')) {
                                ?>

                <?php 
                                $_smarty_tpl->tpl_vars['_country'] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['elm_id']->value]) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['settings']->value['General']['default_country'] : $tmp, null, 0);
                                ?>
                <select id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" class="ty-form-builder__country cm-country cm-location-billing">
                    <option value="">- <?php 
                                echo $_smarty_tpl->__("select_country");
                                ?>
 -</option>
                    <?php 
                                $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0);
                                ?>
                    <?php 
                                $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars["country"]->_loop = false;
                                $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable();
                                $_from = $_smarty_tpl->tpl_vars['countries']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) {
                                    $_smarty_tpl->tpl_vars["country"]->_loop = true;
                                    $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key;
                                    ?>
                    <option value="<?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
" <?php 
                                    if ($_smarty_tpl->tpl_vars['_country']->value == $_smarty_tpl->tpl_vars['code']->value) {
                                        ?>
selected="selected"<?php 
                                    }
                                    ?>
><?php 
                                    echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8');
                                    ?>
</option>
                    <?php 
                                }
                                ?>
                </select>

            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_STATES')) {
                                ?>

                <?php 
                                echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => fn_get_all_states(1)), 0);
                                ?>


                <?php 
                                $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['form_values']->value[$_smarty_tpl->tpl_vars['elm_id']->value]) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['settings']->value['General']['default_state'] : $tmp, null, 0);
                                ?>
                <select class="ty-form-builder__state cm-state cm-location-billing" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]">
                    <option label="" value="">- <?php 
                                echo $_smarty_tpl->__("select_state");
                                ?>
 -</option>
                </select>
                <input type="text" class="cm-state cm-location-billing ty-input-text hidden" id="elm_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
_d" name="form_values[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['element']->value['element_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" size="32" maxlength="64" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" disabled="disabled" />
            
            <?php 
                            } elseif ($_smarty_tpl->tpl_vars['element']->value['element_type'] == @constant('FORM_FILE')) {
                                ?>
                <?php 
                                echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl);
                                ?>

                <?php 
                                echo $_smarty_tpl->getSubTemplate("common/fileuploader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('var_name' => "fb_files[" . (string) $_smarty_tpl->tpl_vars['element']->value['element_id'] . "]"), 0);
                                ?>

            <?php 
                            }
                            ?>

            <?php 
                            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:form_elements"));
                            $_block_repeat = true;
                            echo smarty_block_hook(array('name' => "pages:form_elements"), null, $_smarty_tpl, $_block_repeat);
                            while ($_block_repeat) {
                                ob_start();
                                ?>

            <?php 
                                $_block_content = ob_get_clean();
                                $_block_repeat = false;
                                echo smarty_block_hook(array('name' => "pages:form_elements"), $_block_content, $_smarty_tpl, $_block_repeat);
                            }
                            array_pop($_smarty_tpl->smarty->_tag_stack);
                            ?>

        </div>
    <?php 
                        }
                        ?>
    <?php 
                    }
                    ?>

    <?php 
                    echo $_smarty_tpl->getSubTemplate("common/image_verification.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('option' => "use_for_form_builder"), 0);
                    ?>


    <div class="ty-form-builder__buttons buttons-container">
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "submit", 'but_text' => __("submit"), 'but_meta' => "ty-btn__secondary", 'but_name' => "dispatch[pages.send_form]"), 0);
                    ?>

    </div>

    </form>

    <?php 
                }
                ?>

    <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "pages:page_content"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "pages:page_content"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "pages:page_content"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>


</div>
<?php 
            }
        }
    }
Beispiel #11
0
            db_query("DELETE FROM ?:rus_city_descriptions WHERE city_id = ?i", $params['city_id']);
        }
    }
    $redirect_url = "cities.manage?country_code={$params['country_code']}";
    if (!empty($params['state_code'])) {
        $redirect_url .= "&state_code={$params['state_code']}";
    }
    return array(CONTROLLER_STATUS_OK, $redirect_url);
}
if ($mode == 'manage') {
    if (empty($_REQUEST['country_code'])) {
        $params['country_code'] = Registry::get('settings.General.default_country');
    }
    list($cities, $search) = fn_get_cities($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
    $states = fn_get_all_states();
    $countries = fn_get_simple_countries(false, DESCR_SL);
    if (!empty($cities)) {
        foreach ($cities as $key => $city) {
            $cities[$key]['state_name'] = fn_get_state_name($city['state_code'], $city['country_code'], DESCR_SL);
            $cities[$key]['country_name'] = $countries[$city['country_code']];
        }
    }
    Tygh::$app['view']->assign('countries', $countries);
    Tygh::$app['view']->assign('states', $states);
    Tygh::$app['view']->assign('cities', $cities);
    Tygh::$app['view']->assign('search', $search);
}
function fn_update_city($city_data, $city_id = 0, $lang_code = DESCR_SL)
{
    if (empty($city_id)) {
        if (!empty($city_data['city']) && !empty($city_data['city_code'])) {
Beispiel #12
0
}
if ($mode == 'update') {
    fn_add_breadcrumb(fn_get_lang_var('localizations'), "localizations.manage");
    $localizaton = fn_get_localization_data($_REQUEST['localization_id'], DESCR_SL, true);
    if (empty($localizaton)) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    $view->assign('localization', $localizaton);
    $view->assign('localization_countries', array_diff(fn_get_simple_countries(), $localizaton['countries']));
    $view->assign('localization_currencies', array_diff(fn_get_simple_currencies(), $localizaton['currencies']));
    $view->assign('localization_languages', array_diff(fn_get_simple_languages(), $localizaton['languages']));
    $view->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'details' => array('title' => fn_get_lang_var('items_title'), 'js' => true)));
} elseif ($mode == 'add') {
    fn_add_breadcrumb(fn_get_lang_var('localizations'), "localizations.manage");
    $view->assign('localization_countries', fn_get_simple_countries());
    $view->assign('localization_currencies', fn_get_simple_currencies());
    $view->assign('localization_languages', fn_get_simple_languages());
    $view->assign('default_localization', fn_get_default_localization(DESCR_SL));
    Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'details' => array('title' => fn_get_lang_var('items_title'), 'js' => true)));
} elseif ($mode == 'manage') {
    $view->assign('localizations', fn_get_localizations(DESCR_SL));
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['localization_id'])) {
        fn_delete_localization((array) $_REQUEST['localization_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "localizations.manage");
}
function fn_delete_localization($localization_ids)
{
    fn_start_scroller();