<table class="header mobile_hide" cellpadding="0" cellspacing="0" width="100%">
    <tbody>
    <tr>
        <td>
            <div class="max_width">
                <table class="root_table__top__wrap" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td class="top_left">
                            <div class="top_left__switcher">
                                <?php
                                $culture = $this->context->getUser()->getCulture();
                                ?>
                                <table class="swicher_table" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td valign="bottom">RU</td>
                                        <td valign="bottom">
                                            <a class="btn_all" style="border-bottom: none;" href="<?php echo LangHelper::urlOtherLang($culture); ?>">
                                                <div class="swicher_lang swicher_sprite_<?php echo $culture ?>"></div>
                                            </a></td>
                                        <td valign="bottom">EN</td>
                                    </tr>
                                </table>
                            </div>
                            <?php
                            /*<div class="region"><a href="" class="green_link bbs_d">Уфа, Респ. Башкортостан</a></div>*/
                            if (csSettings::get('phone')) {
                                echo '<div class="header__phone">' . __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '">' . csSettings::get('phone') . '</a></div>';
                            }
                            if (csSettings::get('email')) {
                                echo '<div><nobr>' . __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a></div>';
                            }
                            ?>
                        </td>
                        <td class="top_right">
                            <a href="" class="callback_open_link green_link bbs_d" onclick="callback.open();return false;"><?php echo __('Заказать звонок');?></a>
                        </td>
                    </tr>
                </table>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <div class="max_width header__main" style="height: 100%;">
                <table class="second_floor__table" style="width: 100%; height: 100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <?php
                        if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
                            $active_discount = $sf_user->getAttribute('active_discount');
                        }
                        $module_action = $sf_request->getParameter('module') . '_' . $sf_request->getParameter('action');
                        echo '<td width="100' . ($module_action == 'basket_complete' ? '%' : '') . '" align="center">';
                        $logo = '<img width="100" height="51" src="/i/logo.svg" />';
                        echo (in_array($sf_request->getPathInfo(), array('/ru/', '/en/')) ? $logo : '<a style="border: none" href="' . url_for('@homepage') . '">' . $logo . '</a>');
                        echo '</td>';
                        if($module_action != 'basket_complete'){
                            echo '<td class="top_menu">';
                            include_component('main', 'menu');
                            echo '</td>';
                            echo '<td style="position: relative;" class="top_right ' . ($module_action == 'basket_index' ? (isset($active_discount) ? 'discount_basket' : '') : (isset($active_discount) ? 'discount d' . $active_discount : '') )  . '">';
                            if($module_action != 'search_search'){
                                echo '<div class="search_btn" onclick="search._show();"></div>';
                            }
                            $basket_page = ($module_action == 'basket_index');
                            $basket_info = $sf_user->getBasketInfo();
                            echo '<' . ($basket_page ? 'span' : 'a href="' . url_for('@basket') . '"') . ' class="btn white_b_btn basket_btn' . ($basket_info['offerCount'] > 0 ? ' basket_btn_full' : '') . ' ' . ($basket_page ? 'basket_btn_disabled' : '') . '">';
                            echo '<div class="basket_btn__empty">' . __('Корзина') . '</div>';
                            echo '<div class="basket_btn__product_count">' . $basket_info['offerCountText'] . '</div>';
                            echo '<div class="basket_btn__price"><span class="basket_btn__price__val">' . $basket_info['priceText'] . '</span>&nbsp;<span class="rub">i</span></div>';
                            echo '</' . ($basket_page ? 'span' : 'a') . '>';
                            echo '</td>';
                        }
                        ?>
                    </tr>
                </table>
            </div>
        </td>
    </tr>
    </tbody>
</table>