common.php 22.9 KB
<?php
    /**
     * @var View               $this
     * @var User               $company
     * @var ActiveDataProvider $projectProvider
     * @var ActiveDataProvider $blogProvider
     * @var ActiveDataProvider $commentProvider
     */
    use common\models\User;
    use yii\data\ActiveDataProvider;
    use yii\helpers\ArrayHelper;
    use yii\helpers\Html;
    use yii\web\View;
    use yii\widgets\ListView;

    $this->params[ 'company' ] = $company;
    $this->title = 'My Yii Application';
?>
    <div class="company-performer-title style">О компании</div>
    <div class="company-performer-txt style">
        <?= $company->userInfo->about ?>
    </div>
<?php
    /*====Blocks for layout====*/
    /*
     * Use $projectProvider to obtain models for this block
     */
    $this->beginBlock('our_objects');
?>
    <div class="section-box-18">
        <div class="box-wr">
            <div class="box-all">
                <div class="company-performer-type-title style">Наши объекты (<?= $projectProvider->totalCount ?>)</div>
                <div class="settings-map-ul">
                    <ul>
                        <li><a href="#" class="active"><span>Последний год</span></a></li>
                        <li><a href="#"><span>Последние пять лет</span></a></li>
                        <li><a href="#"><span>Весь период</span></a></li>
                    </ul>
                </div>
                <div class="company-performer-type-map style">
                    <div class="section-box-map">
                        <div class="shadow-map"></div>
                        <div id="map_cloud" style="display: none;">
                            <script type="text/javascript">
                                function initialize()
                                {
                                    var start_position = new google.maps.LatLng('49', '33');
                                    var settings = {
                                        zoom : 7, scrollwheel : true, center : start_position,
                                        mapTypeControl : false,
                                        mapTypeControlOptions : {style : google.maps.MapTypeControlStyle.DROPDOWN_MENU},
                                        navigationControl : false,
                                        navigationControlOptions : {style : google.maps.NavigationControlStyle.SMALL},
                                        scaleControl : false, streetViewControl : false,
                                        rotateControl : false, zoomControl : true,
                                        mapTypeId : google.maps.MapTypeId.ROADMAP
                                    };
                                    var map = new google.maps.Map(document.getElementById("map_canvas"), settings);

                                    var image1 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-1.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image2 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-2.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image3 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-3.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image4 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-4.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image5 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-5.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image6 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-6.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image7 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-7.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image8 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-8.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image9 = new google.maps.MarkerImage(
                                        '/images/markers/marker-we-9.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image10 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-1.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image11 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-2.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image12 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-3.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image13 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-4.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image14 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-5.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image15 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-6.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image16 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-7.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image17 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-8.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );
                                    var image18 = new google.maps.MarkerImage(
                                        '/images/markers/marker-empl-9.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
                                    );

                                    var markers = [];

                                    var marker = new google.maps.Marker(
                                        {
                                            position : new google.maps.LatLng('49', '32.3'),
                                            map : map, title : 'Marker Title2', icon : image1
                                        }
                                    );
                                    markers.push(marker);

                                    var marker = new google.maps.Marker(
                                        {
                                            position : new google.maps.LatLng('49', '36'),
                                            map : map, title : 'Marker Title2', icon : image2
                                        }
                                    );
                                    markers.push(marker);

                                    var marker = new google.maps.Marker(
                                        {
                                            position : new google.maps.LatLng('49', '34.5'),
                                            map : map, title : 'Marker Title3', icon : image18
                                        }
                                    );
                                    markers.push(marker);

                                    var marker = new google.maps.Marker(
                                        {
                                            position : new google.maps.LatLng('49', '35'),
                                            map : map, title : 'Marker Title4', icon : image15
                                        }
                                    );
                                    markers.push(marker);

                                    var clusterStyles = [
                                        {
                                            url : '/images/markers/clasters.png', height : 36,
                                            width : 36
                                        }

                                    ];
                                    markerClusterer = new MarkerClusterer(
                                        map, markers, {
                                            maxZoom : 10, gridSize : 100, styles : clusterStyles
                                        }
                                    );
                                }
                            </script>
                        </div>
                        <div id="map_canvas" style="width: 100%; height:100%;"></div>
                        <div class="company-performer-map-menu">

                            <ul class="content-menu-first">
                                <li>
                                    <span data-menu-bg="#bb0f3f" style="background: #bb0f3f"></span><a href="#">Жилые</a>
                                    <ul>
                                        <li><a href="#">Жилые дома</a></li>
                                        <li><a href="#">Виллы</a></li>
                                        <li><a href="#">Коттеджи</a></li>
                                        <li><a href="#">Гостиницы</a></li>
                                        <li><a href="#">Базы отдыха</a></li>
                                        <li><a href="#">Таунхаусы</a></li>
                                        <li><a href="#">Квартиры</a></li>
                                        <li><a href="#">Квартиры</a></li>
                                        <li><a href="#">Квартиры</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <span data-menu-bg="#ea640b" style="background: #ea640b"></span><a href="#">Офисные</a>
                                    <ul>
                                        <li><a href="#">Коттеджи</a></li>
                                        <li><a href="#">Гостиницы</a></li>
                                        <li><a href="#">Базы отдыха</a></li>
                                    </ul>
                                </li>
                                <li><span data-menu-bg="#f7a901" style="background: #f7a901"></span><a href="#">Торговые</a>
                                </li>
                                <li><span data-menu-bg="#53a827" style="background: #53a827"></span><a href="#">Мосты</a>
                                </li>
                                <li><span data-menu-bg="#018232" style="background: #018232"></span><a href="#">Дороги</a>
                                </li>
                                <li><span data-menu-bg="#02857d" style="background: #02857d"></span><a href="#">Сооружения</a>
                                </li>
                                <li><span data-menu-bg="#019abf" style="background: #019abf"></span><a href="#">Склады</a>
                                </li>
                                <li><span data-menu-bg="#116da8" style="background: #116da8"></span><a href="#">Заводы</a>
                                </li>
                                <li><span data-menu-bg="#413e7f" style="background: #413e7f"></span><a href="#">Разное</a>
                                </li>
                            </ul>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php
    $this->endBlock();
    $this->beginBlock('blog');
    /**
     * Use $blogProvider for this block
     */
?>
    <div class="section-box-232">
        <div class="box-wr">
            <div class="box-all">
                <?php
                    echo ListView::widget([
                        'dataProvider' => $blogProvider,
                        'options'      => [
                            'class' => 'min-post-wr',
                        ],
                        'itemView'     => '_company_common_blog',
                        'itemOptions'  => [
                            'class' => 'min-post-block',
                        ],
                        'layout'       => '{items}',
                        'viewParams'   => [ 'parent_view' => $this ],
                    ]);
                ?>
            </div>
        </div>
    </div>
<?php
    $this->endBlock();
    $this->beginBlock('team');
    /*
     * User preloaded $company->teams models
     */
    $teams = ArrayHelper::index($company->teams, 'team_id', 'department.name'); // Group team members according to their department
?>
    <div class="section-box-233">
        <div class="box-wr">
            <div class="box-all">
                <div class="table-team-title style">Состав команды</div>
                <div class="table-team-wr style">
                    <div class="table-team-left">
                        <?php
                            for($i = 0; $i < count($teams); $i = $i + 2) {
                                ?>
                                <div class="tb-team-wr">
                                    <table class="title-table" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td width="337">
                                                <?php
                                                    if(!empty( array_keys($teams)[ $i ] )) {
                                                        echo array_keys($teams)[ $i ];
                                                    } else {
                                                        echo 'Не определен';
                                                    }
                                                ?>
                                            </td>
                                            <td align="center"></td>
                                        </tr>
                                    </table>
                                    <table class="all-table-first" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" width="32"></td>
                                            <td align="center" width="323">Ф.И.О.</td>
                                            <td align="center" width="91">Опыт, лет</td>
                                        </tr>
                                    </table>
                                    <table class="all-table" cellspacing="0" cellpadding="0" border="0">
                                        <?php
                                            foreach($teams[ array_keys($teams)[ $i ] ] as $team) {
                                                ?>
                                                <tr>
                                                    <td align="center" width="32">
                                                        <?= Html::img('/images/portfolio-project/flag-img-1.jpg') ?>
                                                    </td>
                                                    <td align="center" width="323"><?= $team->lastname . ' ' . $team->firstname ?></td>
                                                    <td align="center" width="91">
                                                        <?php
                                                            if(!empty( $team->experience_from )) {
                                                                echo date('Y') - $team->experience_from;
                                                            } else {
                                                                echo 'Не указан';
                                                            }
                                                        ?>
                                                    </td>
                                                </tr>
                                                <?php
                                            }
                                        ?>
                                    </table>
                                </div>
                                <?php
                            }
                        ?>
                    </div>
                    <div class="table-team-right">
                        <?php
                            for($i = 1; $i < count($teams); $i = $i + 2) {
                                ?>
                                <div class="tb-team-wr">
                                    <table class="title-table" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td width="337">
                                                <?php
                                                    if(!empty( array_keys($teams)[ $i ] )) {
                                                        echo array_keys($teams)[ $i ];
                                                    } else {
                                                        echo 'Не определен';
                                                    }
                                                ?>
                                            </td>
                                            <td align="center"></td>
                                        </tr>
                                    </table>
                                    <table class="all-table-first" cellspacing="0" cellpadding="0" border="0">
                                        <tr>
                                            <td align="center" width="32"></td>
                                            <td align="center" width="323">Ф.И.О.</td>
                                            <td align="center" width="91">Опыт, лет</td>
                                        </tr>
                                    </table>
                                    <table class="all-table" cellspacing="0" cellpadding="0" border="0">
                                        <?php
                                            foreach($teams[ array_keys($teams)[ $i ] ] as $team) {
                                                ?>
                                                <tr>
                                                    <td align="center" width="32">
                                                        <?= Html::img('/images/portfolio-project/flag-img-1.jpg') ?>
                                                    </td>
                                                    <td align="center" width="323"><?= $team->lastname . ' ' . $team->firstname ?></td>
                                                    <td align="center" width="91">
                                                        <?php
                                                            if(!empty( $team->experience_from )) {
                                                                echo date('Y') - $team->experience_from;
                                                            } else {
                                                                echo 'Не указан';
                                                            }
                                                        ?>
                                                    </td>
                                                </tr>
                                                <?php
                                            }
                                        ?>
                                    </table>
                                </div>
                                <?php
                            }
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php
    $this->endBlock();
    $this->beginBlock('review');
?>
    <div class="section-box-19">
        <div class="box-wr">
            <div class="box-all">
                <div class="company-performer-comm-title style">Отзывов: <?= $commentProvider->totalCount ?></div>
                <?php
                    echo ListView::widget([
                        'dataProvider' => $commentProvider,
                        'options'      => [
                            'class' => 'company-performer-comments-wr style',
                        ],
                        'itemView'     => '_company_common_review',
                        'itemOptions'  => [
                            'class' => 'company-performer-comments-bl',
                        ],
                        'layout'       => '{items}',
                    ]);
                ?>
                <div class="company-performer-comm-see-all-butt style">
                    <?= Html::a('Читать все отзывы', [
                        'company/review',
                        'company_id' => $company->id,
                        'type' => (!empty($this->params['type']))?$this->params['type']:null,
                    ]) ?>
                </div>
            </div>
        </div>
    </div>
<?php
    $this->endBlock();
    /*====End blocks for layout====*/
?>