<?php
    
    /**
     * @var View $this
     */
use common\models\Articles;
use common\models\Basket;
    use frontend\assets\AppAsset;
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\web\View;
    use yii\widgets\Breadcrumbs;
use frontend\widgets\Seo;
use common\models\Event;

    AppAsset::register($this);
?>
<?php $this->beginPage() ?>
    <!DOCTYPE html>
    <head>
        
        <?php $this->head() ?>

    <meta charset="<?= Yii::$app->charset ?>"/>
    <?= Html::csrfMetaTags () ?>
    <title><?= Seo::widget([ 'row'=>'title'])?></title>
    <?= Seo::widget([ 'row'=>'description'])?>
    <?= Seo::widget([ 'row'=>'meta'])?>
        <link rel="icon" type="image/vnd.microsoft.icon" href="/images/icon.ico"/>
        <link type="image/ico" href="http://www.linija-svitla.ua/images/icon.ico" rel="SHORTCUT ICON"/>
        <link rel="icon" href="http://www.linija-svitla.ua/images/icon.ico" type="image/x-icon"/>
        

        <meta name="google-site-verification" content="m60Ax2153voy05Xdtit_bnBVjuZG-fv0Zu14jLjb4Tk"/>
        
        
        <script language="javascript">
            var ga_exist = false;
        </script>
        
        
        <!--google analitycs-->
        <script>
            (function(i, s, o, g, r, a, m)
            {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function()
                    {
                        (i[r].q = i[r].q || []).push(arguments)
                    }, i[r].l = 1 * new Date();
                a = s.createElement(o), m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
            
            ga('create', 'UA-77115612-1', 'auto');
            ga('send', 'pageview');
        
        </script>
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer','GTM-NMXP4K');</script>
    <!-- End Google Tag Manager -->
    </head>
<?php $this->beginBody() ?>
    <body>
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NMXP4K"
                      height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    
    <div class="wraper">
        <div class="border">
            <div class="barEmpty"></div>
            <div class="container">
                <div id="bottom">
                
                
                </div>
            </div>
            
            
            <!-- Add your site or application content here -->
            <div id="top-nav-wrapper">
                <div id="top-nav">
                    <div class="container">
                        <div class="col-md-9 col-lg-10">
                            <ul class="top-menu pull-left">
                                <li class="sale_catalog">
                                    <a href="#" class="new_cat_link">Распродажа</a>
                                    <div>
                                        <ul>
                                            <?php foreach(Event::getSaleEvents() as $sale):?>
                                                <li><?php echo Html::a('Скидка -'.$sale['percent'].'%',Url::to (['event/sale', 'percent' => $sale['percent']])) ?></li>
                                            <?php endforeach;?>
                                        </ul>
                                    </div>
                                </li>
                                <li><?php echo Html::a('Магазины',Url::to (['text/main', 'translit' => 'magaziny'])) ?></li>
                                <li><?php echo Html::a('Гарантии', Url::to (['text/main', 'translit' => 'garantii'])) ?></li>
                                <li><?php echo Html::a('Оплата', Url::to (['text/main', 'translit' => 'oplata'])) ?></li>
                                <li><?php echo Html::a('Доставка', Url::to (['text/main', 'translit' => 'dostavka-tovarov'])) ?></li>
                            </ul>
                        </div>
                        <div class="col-md-3 col-lg-2">
                            <?php
                                if(Yii::$app->user->isGuest) {
                                    echo Html::a('<span>Личный кабинет</span>', Url::to('#'), [
                                        'data-toggle' => 'modal',
                                        'data-target' => '#myAccount',
                                        'class'       => 'cabinet_link_',
                                    ]);
                                } else {
                                    echo Html::a('<span>' . Yii::$app->user->identity->username . '</span>', Url::toRoute([ 'cabinet/main' ]), [ 'class' => 'cabinet_link_' ]);
                                }
                            ?>
                        </div>
                        
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
            <header>
                <div class="container" itemscope itemtype="http://schema.org/Organization">
                    <table cellpadding="0" cellspacing="0" border="0" class="header_tb">
                        <tr>
                            <td valign="middle" class="col-md-2 col-lg-3">
                                <a href="/" itemprop="url"><img class="header-new-img" itemprop="logo" src="/images/new_img/new_logo.png" alt=""></a>
                            </td>
                            <td align="center" valign="middle" class="col-md-4 col-lg-4">
                                <table class="tb_phones" cellspacing="0" cellpadding="0" border="0">
                                    <tr>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td>
                                                        <img src="/images/new_img/ico/ico-7.png" alt="">
                                                    </td>
                                                    <td><p class="header_phones" itemprop="telephone">
                                                            <span>(044)</span> 339-92-33</p></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td>
                                                        <img src="/images/new_img/ico/ico-9.png" alt="">
                                                    </td>
                                                    <td><p class="header_phones" itemprop="telephone">
                                                            <span>(095)</span> 282-85-08</p></td>
                                                </tr>
                                            </table>
                                        
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td>
                                                        <img src="/images/new_img/ico/ico-8.png" alt="">
                                                    </td>
                                                    <td><p class="header_phones" itemprop="telephone">
                                                            <span>(068)</span> 776-60-67</p></td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                <tr>
                                                    <td>
                                                        <a href="#" class="callback header_callback" data-toggle="modal" data-target="#myCallback">перезвонить мне</a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    
                                    </tr>
                                
                                </table>
                            </td>
                            <td valign="middle" class="col-md-3 col-lg-3 new_search">
                                <form id="search_products" method="get" action="/search/main">
                                    <div class="input-group">
                                        <input type="text" name="word" class="form-control" placeholder="введите артикул или ID" value="" required>
                                        <input class="new-btn-search" type="submit" value="">
                                    </div>
                                </form>
                            </td>
                            <td id="top-cart-content" valign="middle" class="col-md-3 col-lg-2" style="padding-left: 0">
                                <?php
                                    echo $this->render('/basket/cart', [
                                        'count' => \Yii::$app->basket->getCount(),
                                        'sum'   => \Yii::$app->basket->getSum(),
                                    ])
                                ?>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="clearfix"></div>
            </header>
            <div id="brand_bar">

                <div class="container">
                <?php if($this->beginCache('brand_list',[
                    'duration' => 3600 *24
                ])){ ?>

                        <?= $this->render('../partial/brand_list')?>

                <?php $this->endCache(); } ?>
                </div>
            </div>
            
            <?php if($this->beginCache('main-menu',[
                'duration' => 3600 *24
            ])){ ?>
            <?= $this->render('main-menu') ?>
            <?php $this->endCache(); } ?>

            <div class="wrapper white">
                <div class="container">
                    
                    <!---test--->
                    <?php
                        if (isset($this->params['breadcrumbs'])) {
                            $links = $this->params['breadcrumbs'];
                            foreach($links as $index => $link) {
                                if(is_array($link)) {
                                    $links[$index]['itemprop'] = 'url';
                                    $links[$index]['label'] = '<span itemprop="title">'.$links[$index]['label'].'</span>';
                                }
                            }
                        }
                        echo Breadcrumbs::widget([
                            'encodeLabels' => false,
                            'itemTemplate' => "<li><span itemscope itemtype=\"http://data-vocabulary.org/Breadcrumb\">{link}</span></li>\n",
                            'links'        => isset($links) ? $links : [],
                            'homeLink'     => [
                                'label' => '<span itemprop="title">Интернет-магазин светильников</span>',
                                'url' => Url::to([ '/' ]),
                                'itemprop' => 'url',
                            ],
                            'activeItemTemplate' => '<li class="active"><span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">{link}</span></span></li>',
                        ])
                    ?>
                
                
                </div>
                
                <?= $content ?>
            
            </div><!-- /.wrapper.white -->
            
            <div class="section-posts-wr style">
                <div class="container">
                    <div class="row">
                        <div class="col-md-12">
                            <span class="search-title">Вы еще ничего не искали у нас на сайте</span>
                        </div>
                        <div class="col-md-12 blog-search">
                            <form id="search_products" method="get" action="/search/main">
                                <div class="input-group">
                                    <input type="text" name="word" class="form-control" placeholder="Найдите то, что нужно Вам среди более 5000 светильников" value="" required>
                                    <input class="new-btn-search" type="submit" value="">
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="row posts-margin">
                        <div class="col-md-12">
                            <div class="row">
                                <div class="col-md-4">
                                    <?php if($this->beginCache('articles_show',[
                                        'duration' => 3600*24
                                    ]) ){?>
                                    <span class="posts-title">Статьи</span>
                                    <ul class="posts-links style">
                                        <?php foreach(Articles::find()->all() as $article):?>
                                            <li>
                                                <?= Html::a($article->title, Url::to([
                                                    'articles/show',
                                                    'translit' => $article->translit
                                                ]))?>
                                            </li>
                                        <?php endforeach;?>
                                    </ul>
                                    <div class="posts-line-wr style">
                                        <?= Html::a('Все статьи', Url::to('/articles/main'))?>
                                        <div><span></span></div>
                                    </div>

                                    <?php $this->endCache(); } ?>
                                </div>
                                <div class="col-md-8">
                                    <?php
                                    $seo_text = Seo::widget([ 'row'=>'seo_text']);
                                    if($seo_text){
                                        ?>
                                        <div class="seo-text style">
                                            <?= $seo_text?>
                                        </div>
                                        <div class="posts-line-wr style">
                                            <a class="all_seo_text" href="#">Развернуть текст</a>
                                            <div><span></span></div>
                                        </div>

                                    <?php } ?>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="fb-wrapper_">
                <div class="container">
                    <div class="facebook_container">
                        <div class="fb-page" data-href="https://www.facebook.com/linija.svitla" data-width="500" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="true" data-show-posts="false">
                            <div class="fb-xfbml-parse-ignore">
                                <blockquote cite="https://www.facebook.com/linija.svitla">
                                    <a href="https://www.facebook.com/linija.svitla">Лінія Світла</a>
                                </blockquote>
                            </div>
                        </div>
                        <div id="fb-root"></div>
                        <script>(function(d, s, id)
                            {
                                var js, fjs = d.getElementsByTagName(s)[0];
                                if(d.getElementById(id))
                                {
                                    return;
                                }
                                js = d.createElement(s);
                                js.id = id;
                                js.src = "//connect.facebook.net/uk_UA/sdk.js#xfbml=1&version=v2.5&appId=770340233026349";
                                fjs.parentNode.insertBefore(js, fjs);
                            }(document, 'script', 'facebook-jssdk'));
                        </script>
                    </div>
                </div>
            </div>
            
            <footer>
                <div class="container margin-top-40">
                    <div class="row">
                        <div class="col-md-3 col-lg-3" itemscope itemtype="http://schema.org/Organization">
                            <div class="footer-title_new">Есть к нам вопросы?</div>
                            <table class="footer-phones-wr" cellspacing="0" cellpadding="0" border="0" width="100%">
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td><img src="/images/new_img/ico/ico-7.png" alt="">
                                                </td>
                                                <td><p class="footer_phones" itemprop="telephone">
                                                        <span>(044)</span> 339-92-33</p></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td><img src="/images/new_img/ico/ico-8.png" alt="">
                                                </td>
                                                <td><p class="footer_phones" itemprop="telephone">
                                                        <span>(068)</span> 776-60-67</p></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0" border="0">
                                            <tr>
                                                <td><img src="/images/new_img/ico/ico-9.png" alt="">
                                                </td>
                                                <td><p class="footer_phones" itemprop="telephone">
                                                        <span>(095)</span> 282-85-08</p></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <a href="#" class="callback footer_callback header_callback" data-toggle="modal" data-target="#myCallback">перезвонить мне</a>
                        
                        </div>
                        <div class="col-md-3 col-lg-3">
                        </div>
                        <div class="col-md-3 col-lg-3">
<!--                            <div class="footer-title_new">Корпоративным клиентам</div>-->
<!--                            <a class="catalogs-link-footer" href="http://www.linija-svitla.ua/catalogues.htm">каталоги</a>-->
                        </div>
                        <div class="col-md-3 col-lg-3">
                            <div class="footer-title_new">Интернет-магазин в соцсетях</div>
                            <div class="fblock-content">
                                <p class="seti-txt_">Присоединяйтесь к интернет-магазину Лiнiя Свiтла в социальных сетях. Вы всегда будете в курсе акций, распродаж и новинок.</p>
                                <ul class="ul soc">
                                    <li>
                                        <a href="https://www.facebook.com/linija.svitla" class="facebook" target="_blank" rel="nofollow"></a>
                                    </li>
                                    <li>
                                        <a href="http://vk.com/linija_svitla" class="vkontakte" target="_blank" rel="nofollow"></a>
                                    </li>
                                    <li>
                                        <a href="#" class="twitter" target="_blank" rel="nofollow"></a>
                                    </li>
                                    <li>
                                        <a href="#" class="youtube" target="_blank" rel="nofollow"></a>
                                    </li>
                                    <li>
                                        <a href="https://plus.google.com/101559938155454540015/posts" class="google" target="_blank" rel="nofollow"></a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <ul class="copy first_list_copy col-md-12">
                            <li><?php echo Html::a('Магазины',Url::to (['text/main', 'translit' => 'magaziny'])) ?></li>
                            <li><?php echo Html::a('Гарантии', Url::to (['text/main', 'translit' => 'garantii'])) ?></li>
                            <li><?php echo Html::a('Оплата', Url::to (['text/main', 'translit' => 'oplata'])) ?></li>
                            <li><?php echo Html::a('Доставка', Url::to (['text/main', 'translit' => 'dostavka-tovarov'])) ?></li>
                            <li><?php echo Html::a('Дисконтная программа', Url::to (['text/main', 'translit' => 'diskontnaya-programma'])) ?></li>
                            <li><?php echo Html::a('О проекте', Url::to (['text/main', 'translit' => 'o-proekte'])) ?></li>
                            <li><?php echo Html::a('Каталоги', Url::to (['text/main', 'translit' => 'katalogi'])) ?></li>
                        </ul>
                    </div>
                </div>
                <div class="box-studio-wr style">
                    <div class="container">
                        <div class="row">
                            <div class="col-md-9 col-lg-9">
                                <p>© 2010-<?= date('Y'); ?> «Лiнiя свiтла» - интернет магазин продажи светильников, ламп, бра, торшеров и других осветительных систем. </p>
                            </div>
                            <div class="col-md-3 col-lg-3">
                                <div class="artweb-wr">
                                    <a target="_blank" href="http://artweb.ua/">Создание сайтов</a>
                                    <div class="artweb-img">
                                        <a target="_blank" href="http://artweb.ua/"><img src="/images/new_img/ico/ico-11.png"></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </footer>
            
            <div class="btn-fixeds fixed-events"><a href="/event/main">акции</a></div>
<!--            <div class="btn-fixeds fixed-sale"><a href="/event">Распродажа</a></div>-->

            <table border="0" cellspacing="0" cellpadding="0" class="reqsBox">
            </table>
            <div class="debug"></div>
        </div>
    </div>
    
    
    <!-- Modal's -->
    
    
    <!-- login window -->
    <?= $this->render('/modal/login_window_model_window') ?>
    
    <!-- registration window -->
    <?= $this->render('/modal/registration_window_model_window') ?>
    
    <!-- forgot password form -->
    <?= $this->render('/modal/forgot_password_form_model_window') ?>
    <div class="modal fade" id="price_drop" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3">
        <div class="modal-dialog auth" role="document">
            <div class="modal-content">

                
                <div class="modal-body">
                    
                    <form>
                        <div class="form-group">
                            <label for="InputName3">Имя:</label>
                            <input type="name" class="form-control" id="InputName3" placeholder="" required>
                        </div>
                        <div class="form-group">
                            <label for="InputPhone3">Телефон:</label>
                            <input type="email" class="form-control" id="InputPhone3" placeholder="" required>
                        </div>
                        <div class="form-group">
                            <label for="InputEmail3">Email:</label>
                            <input type="email" class="form-control" id="InputEmail3" placeholder="">
                        </div>
                        
                        <button type="submit" class="btn btn-default btn-large">Отправить</button>
                        <div class="clearfix"></div>
                    </form>
                    
                    
                    <br/>
                    <div class="clearfix"></div>
                </div>
            
            </div>
        </div>
    </div>
    

    
    

    
    <div class="modal fade" id="returnСonditions" tabindex="-1" role="dialog" aria-labelledby="myModalLabel4">
        <div class="modal-dialog text-dialog" role="document">
            <div class="modal-content">
                
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <span class="modal-title" id="myModalLabel4">Можно ли вернуть или обменять товар, если он мне не подошел?</span>
                </div>
                
                <div class="modal-body">
                    <p>Да, но только в течение первых 14 дней и только если вы его не использовали, то есть товар не имеет признаков эксплуатации и изменений. При этом должна быть сохранена упаковка со всеми компонентами. У вас должен быть чек или иной документ, подтверждающий оплату.</p>
                    <p>Обмен или возврат товараденежных средств производится по адресу: г. Киев, ул. Глубочецкая, 53., с понедельника по пятницу с 10.00 до 19.00 и в субботу с 10.00 до 16.00. Телефон: (044) 428-6545. </p>
                    <p>При желании вы можете воспользоваться нашей службой доставки (в случае если отказ от товара происходит не по вине продавца транспортные услуги будут платными).</p>
                    <br/>
                    <div class="clearfix"></div>
                </div>
            
            </div>
        </div>
    </div>
    
    <!-- consultation_modal -->
    <?= $this->render('/modal/my_callback_modal_window') ?>
    

    
    <div class="modal fade" id="myWishlistAdded" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog wishlist" role="document">
            <div class="modal-content">
                
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <span class="modal-title" id="myModalLabel">Товар добавлен в закладки</span>
                </div>
                
                <div class="modal-body">
                    <br/>
                </div>
            
            </div>
        </div>
    </div>
    
    <!-- Cart -->
    <div class="modal fade" id="buyForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <?= $this->render('/basket/modal_items', [
            'basket' => new Basket(),
            'models' => [],
        ]) ?>
    </div>
    
    
    <?php $this->endBody() ?>
    </body>
    </html>
<?php $this->endPage() ?>