index.php 17.2 KB
<?php
use yii\widgets\ListView;
use yii\widgets\MyListView;
use yii\widgets\Menu;
use yii\helpers\Html;
use \yii\base\Controller;
$this->title = 'Главная';

?>
<div class="wrapper content-wrapper clearfix">

    <div class="slider-feature-wrap clearfix">
        <!-- Slider -->
        <script type="text/javascript">
            jQuery(document).ready(function() {

                jQuery('.home-bxslider').bxSlider( {
                    pager: false,
                    auto: true,

                });
                jQuery('.second-bxslider').bxSlider( {
                    pager: false,
                    auto: true,

                });
            })
        </script>
        <div class="slider-section">
            <ul class="home-bxslider">
                <?php foreach($blog as $one_blog):?>
                <li>
                    <img src="<?= $one_blog->image ?>" />
                    <div class="slider-desc">
                        <div class="slider-details">
                            <div class="slide-title"><?=  Html::a($one_blog->name,['articles/view', 'type'=> 'blog', 'translit' =>$one_blog->translit ]) ?></div>
                            <div class="slide-caption"><?= $one_blog->shortenString($one_blog->body, 400)?></div>
                            <div class="slide-date">
                                <i class="fa fa-calendar"></i><?= $one_blog->date ?>
                            </div>
                        </div>
                    </div>
                </li>
                <?php endforeach;?>
            </ul>
        </div>

        <!-- Featured Post Beside Slider -->

        <div class="besides-block">
            <?php foreach($gallery as $one_gallery):?>
            <div class="beside-post clearfix">
                    <figure class="beside-thumb clearfix">
                        <?=  Html::a(Html::img($one_gallery->image),['gallery/view', 'translit' =>$one_gallery->translit ])  ?>
                    </figure>
                    <div class="beside-caption clearfix">
                        <h3 class="post-title"><?=  Html::a($one_gallery->title,['gallery/view', 'translit' =>$one_gallery->translit ])  ?></h3>
                        <div class="post-date"><i class="fa fa-calendar"></i><?=$one_gallery->date?></div>
                    </div>
            </div>
            <?php endforeach;?>

        </div><!-- .beides-block -->

    </div>
    <div id="home-content" class="site-content">
        <div id="primary" class="content-area">
            <div id="gray-bg-wr"><div id="gray-bg"></div></div>
            <main id="main" class="site-main" role="main">
                <div class="home-featured-block">
                    <h2 class="block-title"><span class="bordertitle-red"></span>КАЙТ-ТРИПЫ</h2>
                    <div class="feature-post-wrap clearfix">
                        <?php foreach($trips as $one_trip):?>
                        <div class="featured-post clearfix">
                                <figure class="post-thumb clearfix">

                                    <?=  Html::a(Html::img($one_trip->image),['articles/view', 'type'=> 'trips', 'translit' =>$one_trip->translit ])  ?>

                                </figure>

                                <div class="post-desc clearfix">
                                    <h3 class="feature-main-title"><?=  Html::a($one_trip->title,['articles/view', 'type'=> 'trips', 'translit' =>$one_trip->translit ])?></h3>
                                    <div class="post-date feature-main-date"><?= $one_trip->shortenString($one_trip->body, 400)?></div>
                                </div>
                        </div>
                        <?php endforeach;?>


                    </div>
                </div>





                <!-- Featured Block Three -->
                <div class="home-featured-block block-3 clearfix">
                    <h2 class="block-title"><span class="bordertitle-red"></span>Акции</h2>
                        <figure class="post-thumb-mini clearfix">
                        </figure>

                        <div class="post-desc slider-section clearfix event-slider">
                            <ul class="second-bxslider">
                                <?php foreach($events as $one_event):?>
                                    <li>
                                        <?=  Html::a(Html::img( $one_event->cover),['events/view','translit' =>$one_event->translit ])  ?>
                                    </li>
                                <?php endforeach;?>
                            </ul>

                        </div>
                    </div>
                <!-- End Featured Block Three -->







                <div class="single-col clearfix">

                    <!-- Featured Block Left -->
                    <div class="home-featured-block-single-col">
                        <h2 class="block-title"><span class="bordertitle-red"></span>Школы</h2>
                        <?php foreach($schools as $one_schools):?>
                            <div class="featured-post-block-coltype clearfix">
                                <figure class="post-thumb-mini clearfix">
                                    <?=  Html::a(Html::img($one_schools->image),['schools/view', 'translit' =>$one_schools->translit ])  ?>
                                </figure>

                                <div class="post-desc clearfix">
                                    <h3 class="feature-main-title"><?=  Html::a($one_schools->name,['schools/view', 'translit' =>$one_schools->translit ])?></h3>
                                    <div class="post-date feature-main-date"><?= $one_schools->shortenString($one_schools->description, 400)?></div>
                                </div>
                            </div>
                        <?php endforeach;?>

                    </div>
                    <!-- End Featured Block Lefte -->



                    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>

                    <!-- Featured Block Right -->
                    <div class="home-featured-block-single-col">
                        <h2 class="block-title"><span class="bordertitle-red"></span>Споты</h2>



                        <?php foreach($spots as $one_spot):?>
                            <div class="featured-post-block-coltype clearfix">
                                <figure class="post-thumb-mini clearfix">
                                    <div id="google-map_<?=$one_spot->id?>" style="width: 130px;height: 130px"></div>
                                </figure>

                                <div class="post-desc clearfix">
                                    <h3 class="feature-main-title"><?=  Html::a($one_spot->name,['spots/view',  'translit' =>$one_spot->translit ])?></h3>
                                    <div class="post-date feature-main-date"><?= $one_spot->shortenString($one_spot->description, 400)?></div>
                                </div>
                            </div>
                            <script>
                                function map_initialize_<?= $one_spot->id ?>( map_element_id )
                                {

                                    var image = '/images/icon_map.png';

                                    var myOptions_<?= $one_spot->id ?> = {
                                        zoom: 10,
                                        center: new google.maps.LatLng(<?= $one_spot->coordinates_x?>,<?= $one_spot->coordinates_y?>),
                                        mapTypeId: google.maps.MapTypeId.ROADMAP,
                                        mapTypeControl: true,
                                        mapTypeControlOptions: {
                                            style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
                                        },
                                        scrollwheel: false
                                    };


                                    var map_<?= $one_spot->id ?> = new google.maps.Map(document.getElementById( map_element_id ),myOptions_<?= $one_spot->id ?>);


                                    var mapLat_<?= $one_spot->id ?> = <?= $one_spot->coordinates_x?>;
                                    var mapLng_<?= $one_spot->id?> = <?= $one_spot->coordinates_y?>;




                                    var latlng_<?= $one_spot->id?> = new google.maps.LatLng(mapLat_<?= $one_spot->id?>,mapLng_<?= $one_spot->id?>);


                                    var marker_<?= $one_spot->id?> = new google.maps.Marker({
                                        position: latlng_<?= $one_spot->id?>,
                                        map: map_<?= $one_spot->id ?>,
                                        icon: image
                                    });


                                    var contentString_<?= $one_spot->id?> = '';




                                    var infowindow_<?= $one_spot->id?> = new google.maps.InfoWindow({
                                        content: contentString_<?= $one_spot->id?>
                                    });


                                    google.maps.event.addListener(marker_<?= $one_spot->id?>, 'click', function() {
                                        infowindow_<?= $one_spot->id?>.open(map_<?= $one_spot->id ?>,marker_<?= $one_spot->id?>);
                                    });



                                }

                                $(function () {
                                    if( document.getElementById('google-map_<?=$one_spot->id?>') )
                                    {
                                        map_initialize_<?= $one_spot->id ?>( 'google-map_<?=$one_spot->id?>' );
                                    }
                                });



                            </script>
                        <?php endforeach;?>

                    </div>

                </div><!--single-col-->
                <!-- End Featured Block Left -->



                <!-- FORECAST-->
                <div class="home-featured-block block-4">
                    <h2 class="block-title"><span class="bordertitle-red"></span>Прогнозы</h2>
                    <div class="featured-excerpt-block clearfix">
                        <div class="featured-post-main clearfix">
                            <?php foreach($spots as $one_spot):?>
                                <div>
                                    <div class="name"><?=  Html::a($one_spot->name,['spots/view',  'translit' =>$one_spot->translit ])?></div>
                                    <?=$this->render('@app/views/spots/_forecast', [
                                        'model'=>$one_spot
                                    ]);?>
                                </div>
                            <?php endforeach;?>
                        </div>
                    </div>
                </div>
                <!-- END FORECAST -->



                <!-- Popular Widget Area -->
                <div class="home-featured-block popular-widget-area clearfix">
                </div>
                <!-- End Popular Widget Area -->


                <!-- Media Gallery -->

                <!-- End Media Gallery -->








            </main><!-- #main -->
        </div><!-- #primary -->


        <div id="secondary-right" class="widget-area secondary-sidebar f-right clearfix" role="complementary">
            <div id="sidebar-section-top" class="widget-area sidebar clearfix">
                <aside id="text-2" class="widget widget_text">			<div class="textwidget"><div class = "ukraine" style = "width: 272px; height: 167px">
                            <a href="spots/index"><img src = "/images/ukraine.png" style = "width: 272px;
height: 167px; margin-bottom:30px"></a>
                        </div></div>
                </aside><aside id="text-3" class="widget widget_text"><h3 class="widget-title"><span>НОВОСТИ</span></h3>
                    <div class="textwidget"> <div class = "sidebar-news">
                            <?php foreach($news as $one_news):?>
                                <div class = "sidebar-trips-nth" style = "height:100px; width:272px; margin-bottom: 20px">
                                    <?=  Html::a(Html::img($one_news->image),['articles/view', 'type'=> 'news','translit' =>$one_news->translit ])  ?>
                                    <div style = "float:right; height:100px; width:136px; padding: 0px 5px 5px 11px; font: 13px Roboto,sans-serif;
line-height: 24px;">
                                        <?=  Html::a($one_news->title,['articles/view', 'type'=> 'news','translit' =>$one_news->translit ])  ?>
                                    </div>
                                </div>
                            <?php endforeach; ?>
                            <?=  Html::a('ВСЕ НОВОСТИ',['articles/index', 'type'=> 'news'],['id'=>'button-news'])  ?>
                        </div></div>
                </aside><aside id="text-4" class="widget widget_text">			<div class="textwidget"><div class = "kite-cabrina" style = "width: 272px;
height: 167px">
                            <a href = "#"><img src = "/images/kite-cabrina.png" style = "width: 272px;
height: 167px; margin-bottom:30px"></a>
                        </div>
                    </div>
                </aside>
                <aside id="text-5" class="widget widget_text"><h3 class="widget-title">
                        <span>ТРИПЫ</span></h3>
                    <div class="textwidget"><div class = "sidebar-trips">
                            <?php foreach($trips as $one_trip):?>
                                <div class = "sidebar-trips-nth" style = "height:100px; width:272px; margin-bottom: 20px">
                                    <?=  Html::a(Html::img($one_trip->image),['articles/view', 'type'=> 'trips','translit' =>$one_trip->translit ])  ?>
                                    <div style = "float:right; height:100px; width:136px; padding: 0px 5px 5px 11px; font: 13px Roboto,sans-serif;
line-height: 24px;">
                                        <?=  Html::a($this->title,['articles/view', 'type'=> 'trips','translit' =>$one_trip->translit ])  ?>
                                    </div>
                                </div>
                            <?php endforeach; ?>

                        </div>
                    </div>
                </aside>
<!--                <aside id="text-6" class="widget widget_text"><h3 class="widget-title"><span>ПОПУЛЯРНЫЕ ТОВАРЫ</span></h3>			<div class="textwidget"><div class = "sidebar-pop-items">-->
<!--                            <a href = "#">-->
<!--                                <div class = "sidebar-pop-items-nth">-->
<!--                                    <img src = "/images/popular-items.png" style = "height:90px; width:100px; float:left;">-->
<!--                                    <div class = "pop-item-ins">-->
<!--                                        Комплект кайта Cabrinha , SWITCHBL ADE KC 10 2014-->
<!--                                    </div>-->
<!--                                    <div class = "pop-price">-->
<!--                                        39959 грн.-->
<!--                                    </div>-->
<!--                                    <a href="#" id = "pop-buy">КУПИТЬ</a>-->
<!--                                </div>-->
<!--                            </a>-->
<!---->
<!---->
<!--                            <a href = "#">-->
<!--                                <div class = "sidebar-pop-items-nth">-->
<!--                                    <img src = "/images/popular-items.png" style = "height:90px; width:100px; float:left;">-->
<!--                                    <div class = "pop-item-ins">-->
<!--                                        Комплект кайта Cabrinha , SWITCHBL ADE KC 10 2014-->
<!--                                    </div>-->
<!--                                    <div class = "pop-price">-->
<!--                                        39959 грн.-->
<!--                                    </div>-->
<!--                                    <a href="#" id = "pop-buy">КУПИТЬ</a>-->
<!--                                </div>-->
<!--                            </a>-->
<!---->
<!--                            <a href = "#">-->
<!--                                <div class = "sidebar-pop-items-nth">-->
<!--                                    <img src = "/images/popular-items.png" style = "height:90px; width:100px; float:left;">-->
<!--                                    <div class = "pop-item-ins">-->
<!--                                        Комплект кайта Cabrinha , SWITCHBL ADE KC 10 2014-->
<!--                                    </div>-->
<!--                                    <div class = "pop-price">-->
<!--                                        39959 грн.-->
<!--                                    </div>-->
<!--                                    <a href="#" id = "pop-buy">КУПИТЬ</a>-->
<!--                                </div>-->
<!--                            </a>-->
<!---->
<!--                        </div></div>-->
<!--                </aside>                -->
            </div>













        </div>



    </div><!-- #content -->
</div><!-- content-wrapper-->