$gift_cert_data = fn_get_gift_certificate_info($gift_cert_id); 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));
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"); ?> : </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> <?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"); ?> : </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> <?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 } } }
if (empty($gift_cert_data)) { return array(CONTROLLER_STATUS_NO_PAGE); } // [Page sections] Registry::set('navigation.tabs', array('detailed' => array('title' => fn_get_lang_var('detailed_info'), 'js' => true), 'log' => array('title' => fn_get_lang_var('history'), 'js' => true))); // [/Page sections] list($log, $sort_order, $sort_by) = fn_get_gift_certificate_log($gift_cert_id, $_REQUEST); $view->assign('log', $log); $view->assign('sort_order', $sort_order); $view->assign('sort_by', $sort_by); if (false != ($last_item = reset($log))) { $gift_cert_data['amount'] = $last_item['debit']; $gift_cert_data['products'] = $last_item['debit_products']; } $view->assign('templates', fn_get_gift_certificate_templates()); $view->assign('states', fn_get_all_states()); $view->assign('countries', fn_get_countries(CART_LANGUAGE, true)); $view->assign('amount_variants', fn_get_gift_certificate_amount_variants()); $view->assign('gift_cert_data', $gift_cert_data); } elseif ($mode == 'manage') { list($gift_certificates, $search) = fn_get_gift_certificates($_REQUEST); $view->assign('gift_certificates', $gift_certificates); $view->assign('search', $search); fn_gift_certificates_generate_sections('manage'); } elseif ($mode == 'delete') { if (!empty($_REQUEST['gift_cert_id'])) { $result = fn_delete_gift_certificate($_REQUEST['gift_cert_id'], @$_REQUEST['extra']); return array(CONTROLLER_STATUS_REDIRECT, !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : "gift_certificates." . ($result ? "manage" : "update?gift_cert_id=" . $_REQUEST['gift_cert_id'])); } } elseif ($mode == 'update_status') { $old_status = db_get_field("SELECT status FROM ?:gift_certificates WHERE gift_cert_id = ?i", $_REQUEST['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_55cdd47237dd25_46223753($_smarty_tpl) { if (!is_callable('smarty_function_script')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php'; } fn_preload_lang_vars(array('settings')); echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl); ?> <?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 if ($_REQUEST['highlight']) { $_smarty_tpl->tpl_vars["highlight"] = new Smarty_variable(explode(",", $_REQUEST['highlight']), null, 0); } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); ?> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="settings_form" class=" form-horizontal form-edit form-setting"> <input name="section_id" type="hidden" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['section_id']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" id="selected_section" name="selected_section" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected_section']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <?php $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars['subsection'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['subsection']->_loop = false; $_smarty_tpl->tpl_vars["ukey"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['options']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['subsection']->key => $_smarty_tpl->tpl_vars['subsection']->value) { $_smarty_tpl->tpl_vars['subsection']->_loop = true; $_smarty_tpl->tpl_vars["ukey"]->value = $_smarty_tpl->tpl_vars['subsection']->key; ?> <div id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ukey']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['subsections']->value[$_smarty_tpl->tpl_vars['section']->value]['type'] == "SEPARATE_TAB") { ?> class="cm-hide-save-button"<?php } ?> > <?php $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['item']->_loop = false; $_from = $_smarty_tpl->tpl_vars['subsection']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['item']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['smarty']->value['foreach']["section"]['total'] = $_smarty_tpl->tpl_vars['item']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["section"]['iteration'] = 0; foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) { $_smarty_tpl->tpl_vars['item']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["section"]['iteration']++; ?> <?php echo $_smarty_tpl->getSubTemplate("common/settings_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('item' => $_smarty_tpl->tpl_vars['item']->value, 'section' => $_smarty_tpl->tpl_vars['section_id']->value, 'html_id' => "field_" . (string) $_smarty_tpl->tpl_vars['section']->value . "_" . (string) $_smarty_tpl->tpl_vars['item']->value['name'] . "_" . (string) $_smarty_tpl->tpl_vars['item']->value['object_id'], 'html_name' => "update[" . (string) $_smarty_tpl->tpl_vars['item']->value['object_id'] . "]", 'index' => $_smarty_tpl->getVariable('smarty')->value['foreach']['section']['iteration'], 'total' => $_smarty_tpl->getVariable('smarty')->value['foreach']['section']['total']), 0); ?> <?php } ?> </div> <?php } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[settings.update]", 'but_role' => "submit-link", 'but_target_form' => "settings_form"), 0); ?> <?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 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/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'track' => true), 0); ?> </form> <?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 ob_start(); echo $_smarty_tpl->__("settings"); $_tmp1 = ob_get_clean(); echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_tmp1 . ": " . (string) $_smarty_tpl->tpl_vars['settings_title']->value, 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'sidebar_position' => "left"), 0); ?> <?php }
function content_55ccdf864081b0_25610907($_smarty_tpl) { if (!is_callable('smarty_function_script')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php'; } if (!is_callable('smarty_block_hook')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php'; } fn_preload_lang_vars(array('marketplace', 'marketplace_find_more', 'installed_addons', 'browse_all_available_addons', 'no_data', 'no_data', 'upload_addon', 'upload_addon', 'addons')); 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 echo smarty_function_script(array('src' => "js/tygh/tabs.js"), $_smarty_tpl); ?> <?php echo smarty_function_script(array('src' => "js/tygh/filter_table.js"), $_smarty_tpl); ?> <?php echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl); ?> <script type="text/javascript"> (function(_, $) { $(document).ready(function(){ var search_field = $("#elm_addon"); var search_clear = $("#elm_addon_clear"); // Init plugin search_field.ceFilterTable({ table: ".table-addons", empty: ".no-items" }); // Clear input search_clear.on("click", function() { search_field.val("").trigger("input"); search_clear.addClass("hidden"); }); // Show clear button if search filed isn't empty search_field.on("keyup input", function() { if(search_field.val().length > 0) { search_clear.removeClass("hidden"); } else { search_clear.addClass("hidden"); } }); }); }(Tygh, Tygh.$)); </script> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "addons.manage"), 0); ?> <hr> <div class="sidebar-row marketplace"> <h6><?php echo $_smarty_tpl->__("marketplace"); ?> </h6> <p class="marketplace-link"><?php echo $_smarty_tpl->__("marketplace_find_more", array("[href]" => $_smarty_tpl->tpl_vars['config']->value['resources']['marketplace_url'])); ?> </p> </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(); } ?> <?php $_smarty_tpl->tpl_vars["c_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("upload_addon", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/upload_addon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?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(); } ?> <div class="items-container" id="addons_list"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "addons:manage")); $_block_repeat = true; echo smarty_block_hook(array('name' => "addons:manage"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="tabs cm-j-tabs clear"> <ul class="nav nav-tabs"> <li id="tab_installed_addons" class="cm-js active"><a><?php echo $_smarty_tpl->__("installed_addons"); ?> </a></li> <li id="tab_browse_all_available_addons" class="cm-js"><a><?php echo $_smarty_tpl->__("browse_all_available_addons"); ?> </a></li> </ul> </div> <div class="cm-tabs-content"> <div id="content_tab_installed_addons"> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('show_installed' => true), 0); ?> <p class="no-items hidden"><?php echo $_smarty_tpl->__("no_data"); ?> </p> </div> <div id="content_tab_browse_all_available_addons"> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <p class="no-items hidden"><?php echo $_smarty_tpl->__("no_data"); ?> </p> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "addons:manage"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <!--addons_list--></div> <?php $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null); ob_start(); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "addons:adv_buttons")); $_block_repeat = true; echo smarty_block_hook(array('name' => "addons:adv_buttons"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && !defined("RESTRICTED_ADMIN")) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "upload_addon", 'text' => __("upload_addon"), 'title' => __("upload_addon"), 'content' => Smarty::$_smarty_vars['capture']['upload_addon'], 'act' => "general", 'link_class' => "cm-dialog-auto-size", 'icon' => "icon-plus", 'link_text' => ''), 0); ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "addons:adv_buttons"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?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 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(); } echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("addons"), 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons']), 0); }
function fn_twg_get_states() { $states = fn_get_all_states(); // Unset country_code field foreach ($states as $country_id => $country) { foreach ($country as $state_id => $state) { unset($states[$country_id][$state_id]['country_code']); } } return $states; }
$destination_data['states'] = db_get_array("SELECT a.state_id, b.state, a.code, d.country FROM ?:states as a LEFT JOIN ?:state_descriptions as b ON b.state_id = a.state_id AND b.lang_code = ?s LEFT JOIN ?:destination_elements as c ON c.element_type = 'S' AND c.element = a.state_id LEFT JOIN ?:country_descriptions as d ON d.code = a.country_code AND d.lang_code = ?s WHERE c.destination_id = ?i", DESCR_SL, DESCR_SL, $_REQUEST['destination_id']); $destination_data['countries'] = db_get_array("SELECT a.code, b.country FROM ?:countries as a LEFT JOIN ?:country_descriptions as b ON b.code = a.code AND b.lang_code = ?s LEFT JOIN ?:destination_elements as c ON c.element_type = 'C' AND c.element = a.code WHERE c.destination_id = ?i", DESCR_SL, $_REQUEST['destination_id']); $destination_data['zipcodes'] = db_get_hash_single_array("SELECT element_id, element FROM ?:destination_elements WHERE element_type = 'Z' AND destination_id = ?i", array('element_id', 'element'), $_REQUEST['destination_id']); $destination_data['zipcodes'] = implode("\n", $destination_data['zipcodes']); $destination_data['cities'] = db_get_hash_single_array("SELECT element_id, element FROM ?:destination_elements WHERE element_type = 'T' AND destination_id = ?i", array('element_id', 'element'), $_REQUEST['destination_id']); $destination_data['cities'] = implode("\n", $destination_data['cities']); $destination_data['addresses'] = db_get_hash_single_array("SELECT element_id, element FROM ?:destination_elements WHERE element_type = 'A' AND destination_id = ?i", array('element_id', 'element'), $_REQUEST['destination_id']); $destination_data['addresses'] = implode("\n", $destination_data['addresses']); $view->assign('destination_data', $destination_data); $view->assign('destination', $destination); $view->assign('states', fn_get_all_states(DESCR_SL, true, false)); $view->assign('countries', fn_get_countries()); // Add destination } elseif ($mode == 'add') { fn_add_breadcrumb(fn_get_lang_var('locations'), "destinations.manage"); $view->assign('states', fn_get_all_states(DESCR_SL, true, false)); $view->assign('countries', fn_get_countries()); // Destinations list } elseif ($mode == 'manage') { $destinations = fn_get_destinations(DESCR_SL); $view->assign('destinations', $destinations); } elseif ($mode == 'delete') { if (!empty($_REQUEST['destination_id'])) { fn_delete_destinations((array) $_REQUEST['destination_id']); } return array(CONTROLLER_STATUS_REDIRECT, "destinations.manage"); } function fn_delete_destinations($destination_ids) { foreach ($destination_ids as $dest_id) { if (!empty($dest_id) && $dest_id != 1) {
function content_55ccecc7627375_26321283($_smarty_tpl) { if (!is_callable('smarty_function_script')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php'; } $_smarty_tpl->tpl_vars["_addon"] = new Smarty_variable($_REQUEST['addon'], null, 0); if ($_smarty_tpl->tpl_vars['separate']->value) { ?> <?php echo smarty_function_script(array('src' => "js/tygh/tabs.js"), $_smarty_tpl); ?> <?php echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl); ?> <?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 } ?> <?php if ($_smarty_tpl->tpl_vars['separate']->value) { $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); } ?> <div id="content_group<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div class="tabs cm-j-tabs <?php if ($_smarty_tpl->tpl_vars['separate']->value) { ?> cm-track<?php } ?> <?php if (count($_smarty_tpl->tpl_vars['subsections']->value) == 1) { ?> hidden<?php } ?> "> <ul class="nav nav-tabs"> <?php $_smarty_tpl->tpl_vars["subs"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["subs"]->_loop = false; $_smarty_tpl->tpl_vars["section"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['subsections']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["subs"]->key => $_smarty_tpl->tpl_vars["subs"]->value) { $_smarty_tpl->tpl_vars["subs"]->_loop = true; $_smarty_tpl->tpl_vars["section"]->value = $_smarty_tpl->tpl_vars["subs"]->key; ?> <?php $_smarty_tpl->tpl_vars["tab_id"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['_addon']->value . "_" . (string) $_smarty_tpl->tpl_vars['section']->value, null, 0); ?> <li class="cm-js <?php if ($_REQUEST['selected_section'] == $_smarty_tpl->tpl_vars['tab_id']->value) { ?> active<?php } ?> " id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tab_id']->value, ENT_QUOTES, 'UTF-8'); ?> "><a><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['subs']->value['description'], ENT_QUOTES, 'UTF-8'); ?> </a></li> <?php } ?> </ul> </div> <div class="cm-tabs-content" id="tabs_content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> "> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="update_addon_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> _form" class=" form-edit form-horizontal" enctype="multipart/form-data"> <input type="hidden" name="selected_section" value="<?php echo htmlspecialchars($_REQUEST['selected_section'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="addon" value="<?php echo htmlspecialchars($_REQUEST['addon'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php if ($_REQUEST['return_url']) { ?> <input type="hidden" name="redirect_url" value="<?php echo htmlspecialchars($_REQUEST['return_url'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php } ?> <?php $_smarty_tpl->tpl_vars["field_item"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["field_item"]->_loop = false; $_smarty_tpl->tpl_vars["section"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['options']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["field_item"]->key => $_smarty_tpl->tpl_vars["field_item"]->value) { $_smarty_tpl->tpl_vars["field_item"]->_loop = true; $_smarty_tpl->tpl_vars["section"]->value = $_smarty_tpl->tpl_vars["field_item"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['subsections']->value[$_smarty_tpl->tpl_vars['section']->value]['type'] == "SEPARATE_TAB") { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("separate_section", null, null); ob_start(); ?> <?php } ?> <div id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['section']->value, ENT_QUOTES, 'UTF-8'); ?> " class="settings<?php if ($_smarty_tpl->tpl_vars['subsections']->value[$_smarty_tpl->tpl_vars['section']->value]['type'] == "SEPARATE_TAB") { ?> cm-hide-save-button<?php } ?> "> <?php $_smarty_tpl->_capture_stack[0][] = array("header_first", null, null); ob_start(); ?> false<?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 $_smarty_tpl->tpl_vars["data"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["data"]->_loop = false; $_smarty_tpl->tpl_vars["name"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['field_item']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars["data"]->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['smarty']->value['foreach']["fe_addons"]['total'] = $_smarty_tpl->tpl_vars["data"]->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["fe_addons"]['iteration'] = 0; foreach ($_from as $_smarty_tpl->tpl_vars["data"]->key => $_smarty_tpl->tpl_vars["data"]->value) { $_smarty_tpl->tpl_vars["data"]->_loop = true; $_smarty_tpl->tpl_vars["name"]->value = $_smarty_tpl->tpl_vars["data"]->key; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["fe_addons"]['iteration']++; ?> <?php if ($_smarty_tpl->tpl_vars['data']->value['parent_id'] && $_smarty_tpl->tpl_vars['field_item']->value[$_smarty_tpl->tpl_vars['data']->value['parent_id']]) { ?> <?php $_smarty_tpl->tpl_vars['parent_item'] = new Smarty_variable($_smarty_tpl->tpl_vars['field_item']->value[$_smarty_tpl->tpl_vars['data']->value['parent_id']], null, 0); ?> <?php $_smarty_tpl->tpl_vars['parent_item_html_id'] = new Smarty_variable("addon_option_" . (string) $_smarty_tpl->tpl_vars['_addon']->value . "_" . (string) $_smarty_tpl->tpl_vars['parent_item']->value['name'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['parent_item'] = new Smarty_variable(array(), null, 0); ?> <?php $_smarty_tpl->tpl_vars['parent_item_html_id'] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("common/settings_fields.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('item' => $_smarty_tpl->tpl_vars['data']->value, 'section' => $_smarty_tpl->tpl_vars['_addon']->value, 'html_id' => "addon_option_" . (string) $_smarty_tpl->tpl_vars['_addon']->value . "_" . (string) $_smarty_tpl->tpl_vars['data']->value['name'], 'html_name' => "addon_data[options][" . (string) $_smarty_tpl->tpl_vars['data']->value['object_id'] . "]", 'index' => $_smarty_tpl->getVariable('smarty')->value['foreach']['fe_addons']['iteration'], 'total' => $_smarty_tpl->getVariable('smarty')->value['foreach']['fe_addons']['total'], 'class' => "setting-wide", 'parent_item' => $_smarty_tpl->tpl_vars['parent_item']->value, 'parent_item_html_id' => $_smarty_tpl->tpl_vars['parent_item_html_id']->value), 0); ?> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['subsections']->value[$_smarty_tpl->tpl_vars['section']->value]['type'] == "SEPARATE_TAB") { ?> <?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 $_smarty_tpl->tpl_vars["sep_sections"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['sep_sections']->value . " " . (string) Smarty::$_smarty_vars['capture']['separate_section'], null, 0); ?> <?php } ?> <?php } ?> <div class="buttons-container<?php if ($_smarty_tpl->tpl_vars['separate']->value) { ?> buttons-bg<?php } ?> cm-toggle-button"> <?php if ($_smarty_tpl->tpl_vars['separate']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[addons.update]", 'but_target_form' => "update_addon_" . (string) $_smarty_tpl->tpl_vars['_addon']->value . "_form", 'hide_second_button' => true, 'breadcrumbs' => $_smarty_tpl->tpl_vars['breadcrumbs']->value, 'save' => true), 0); ?> <?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 } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[addons.update]", 'cancel_action' => "close", 'save' => true), 0); ?> <?php } ?> </div> </form> <?php if ($_smarty_tpl->tpl_vars['subsections']->value[$_smarty_tpl->tpl_vars['section']->value]['type'] == "SEPARATE_TAB") { ?> <?php echo $_smarty_tpl->tpl_vars['sep_sections']->value; ?> <?php } ?> </div> <!--content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <!--content_group<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_addon']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php if ($_smarty_tpl->tpl_vars['separate']->value) { ?> <?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/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['addon_name']->value, 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons']), 0); ?> <?php } }
function content_55db8c5b5f26f2_62007688($_smarty_tpl) { if (!is_callable('smarty_function_script')) { include '/var/www/html/market/app/functions/smarty_plugins/function.script.php'; } if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } fn_preload_lang_vars(array('marketplace', 'marketplace_find_more', 'installed_addons', 'browse_all_available_addons', 'upload_addon', 'upload_addon', 'addons')); 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 echo smarty_function_script(array('src' => "js/tygh/tabs.js"), $_smarty_tpl); ?> <?php echo smarty_function_script(array('src' => "js/tygh/filter_table.js"), $_smarty_tpl); ?> <?php echo smarty_function_script(array('src' => "js/tygh/fileuploader_scripts.js"), $_smarty_tpl); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "addons.manage"), 0); ?> <hr> <div class="sidebar-row marketplace"> <h6><?php echo $_smarty_tpl->__("marketplace"); ?> </h6> <p class="marketplace-link"><?php echo $_smarty_tpl->__("marketplace_find_more", array("[href]" => $_smarty_tpl->tpl_vars['config']->value['resources']['marketplace_url'])); ?> </p> </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(); } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("upload_addon", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/upload_addon.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?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(); } ?> <div class="items-container" id="addons_list"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "addons:manage")); $_block_repeat = true; echo smarty_block_hook(array('name' => "addons:manage"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="tabs cm-j-tabs clear"> <ul class="nav nav-tabs"> <li id="tab_installed_addons" class="cm-js active"><a><?php echo $_smarty_tpl->__("installed_addons"); ?> </a></li> <li id="tab_browse_all_available_addons" class="cm-js"><a><?php echo $_smarty_tpl->__("browse_all_available_addons"); ?> </a></li> </ul> </div> <div class="cm-tabs-content"> <div id="content_tab_installed_addons"> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('show_installed' => true), 0); ?> </div> <div id="content_tab_browse_all_available_addons"> <?php echo $_smarty_tpl->getSubTemplate("views/addons/components/addons_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "addons:manage"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <!--addons_list--></div> <?php $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null); ob_start(); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "addons:adv_buttons")); $_block_repeat = true; echo smarty_block_hook(array('name' => "addons:adv_buttons"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && !defined("RESTRICTED_ADMIN")) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "upload_addon", 'text' => __("upload_addon"), 'title' => __("upload_addon"), 'content' => Smarty::$_smarty_vars['capture']['upload_addon'], 'act' => "general", 'link_class' => "cm-dialog-auto-size", 'icon' => "icon-plus", 'link_text' => ''), 0); ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "addons:adv_buttons"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?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 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(); } echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("addons"), 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons']), 0); ?> <?php }
/** * Prepare all settings, wich should be passed to js */ function fn_twg_get_all_settings() { $settings = fn_twg_get_boot_settings(); $addon_settings = TwigmoSettings::get(); $settings['currency'] = Registry::get('currencies.' . CART_SECONDARY_CURRENCY); $settings['primaryCurrency'] = Registry::get('currencies.' . CART_PRIMARY_CURRENCY); $settings['url_for_facebook'] = isset($addon_settings['url_for_facebook']) ? fn_twg_get_external_info_url($addon_settings['url_for_facebook']) : ''; $settings['url_for_twitter'] = isset($addon_settings['url_for_twitter']) ? fn_twg_get_external_info_url($addon_settings['url_for_twitter']) : ''; $needed_langvars = Lang::getNeededLangvars(); $settings['lang'] = array(); foreach ($needed_langvars as $needed_langvar) { $settings['lang'][$needed_langvar] = __($needed_langvar); } $settings['lang'] = array_merge($settings['lang'], Lang::getCustomerLangVars()); // Countries/states list($countries) = fn_get_countries(array('only_avail' => true)); $settings = array_merge($settings, Api::getAsList('countries', $countries)); $states = fn_get_all_states(); // Unset country_code field foreach ($states as $country_id => $country) { foreach (array_keys($country) as $state_id) { unset($states[$country_id][$state_id]['country_code']); } } $settings['states'] = $states; // Info pages $pages_location = $addon_settings['home_page_content'] == 'tw_home_page_blocks' ? 'twigmo.post' : 'index.index'; $pages = TwigmoBlock::getBlocksForLocation($pages_location, array('pages')); $settings['info_pages'] = array(); foreach ($pages as $page) { $settings['info_pages'] = array_merge($settings['info_pages'], $page['pages']['page']); } // If page link begin with # then interpret this link as twigmo page foreach ($settings['info_pages'] as $k => $page) { if (preg_match('/^\\#.*$/', $page['link'])) { $settings['info_pages'][$k]['twigmo_page'] = substr($page['link'], 1); } } // Only required profile fields $only_required = isset($addon_settings['only_req_profile_fields']) ? $addon_settings['only_req_profile_fields'] : 'N'; $settings['profileFields'] = fn_twg_prepare_profile_fields(fn_get_profile_fields(), $only_required); $settings['profileFieldsCheckout'] = fn_twg_prepare_profile_fields(fn_get_profile_fields('O'), $only_required); $settings['titles'] = array(); //array_values(fn_twg_get_static_data_section('T')); $user_info_params = array('user_id' => $_SESSION['auth']['user_id'], 'mode' => Registry::get('runtime.mode')); $settings['profile'] = fn_twg_get_user_info($user_info_params); $settings['cart'] = fn_twg_api_get_session_cart($_SESSION['cart']); $settings['sortings'] = fn_twg_get_sortings(); $settings['security_hash'] = fn_generate_security_hash(); $settings['productType'] = PRODUCT_EDITION; $settings['languages'] = array_values(Lang::getLanguages()); $settings['cart_language'] = CART_LANGUAGE; $settings['cart_prices_w_taxes'] = Registry::get('settings.Appearance.cart_prices_w_taxes'); $settings['show_prices_taxed_clean'] = Registry::get('settings.Appearance.show_prices_taxed_clean'); $settings['no_image_path'] = Registry::get('config.no_image_path'); // Suppliers $settings['suppliers_vendor'] = Registry::get('settings.Suppliers.apply_for_vendor'); $settings['display_supplier'] = Registry::get('settings.Suppliers.display_supplier'); // General section $fields = array('use_email_as_login', 'min_order_amount', 'min_order_amount_type', 'address_position', 'agree_terms_conditions', 'allow_negative_amount', 'inventory_tracking', 'allow_anonymous_shopping', 'disable_anonymous_checkout', 'tax_calculation'); foreach ($fields as $field) { $settings[$field] = Registry::get('settings.General.' . $field); } if (version_compare(PRODUCT_VERSION, '4.0.2', '>=')) { $anonymous_shopping_settings_map = array('allow_shopping' => 'Y', 'hide_price_and_add_to_cart' => 'P', 'hide_add_to_cart' => 'B'); $settings['allow_anonymous_shopping'] = $anonymous_shopping_settings_map[$settings['allow_anonymous_shopping']]; } $settings['default_location'] = array('country' => Registry::get('settings.General.default_country'), 'state' => Registry::get('settings.General.default_state')); $settings['show_modifiers'] = Registry::get('settings.General.display_options_modifiers'); $settings['SEOEnabled'] = Registry::get('addons.seo.status') == 'A'; $settings['GATrackEcommerce'] = Registry::get('addons.google_analytics.status') == 'A' && Registry::get('addons.google_analytics.track_ecommerce') == 'Y' && file_exists(Registry::get('config.dir.addons') . 'google_analytics/controllers/frontend/checkout.post.php'); if (fn_allowed_for('MULTIVENDOR')) { $settings['company_data'] = !empty($_SESSION['auth']['company_id']) ? fn_get_company_data($_SESSION['auth']['company_id']) : array(); } else { $settings['company_data'] = array(); } fn_set_hook('twg_get_all_settings', $settings); // Langvars postprocessing $langvars = array(); $pattern = '/(twg_|msg_|lbl_|btn_|text_)/'; $replace = ''; foreach ($settings['lang'] as $langvar_id => $langvar_value) { $tidy_key = preg_replace($pattern, $replace, $langvar_id); $langvars[$tidy_key] = $langvar_value; } $settings['lang'] = $langvars; return $settings; }
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'); ?> </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'); ?> </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 } } }
db_query("DELETE FROM ?:rus_cities WHERE city_id = ?i", $params['city_id']); 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)) {
function content_55db8c18746198_22874697($_smarty_tpl) { 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); }