gallery-company.php 14.8 KB
<?php

    use kartik\rating\StarRating;
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\Breadcrumbs;
    use yii\widgets\Menu;

    \frontend\assets\AdminAsset::register($this);
    /* @var $content string */
    $this->beginContent('@app/views/layouts/main.php');
?>
    <div class="section-box content">
        <div class="section-box-14" style="background: url('<?= $this->params[ 'company' ]->userInfo->poster; ?>') 50% no-repeat">
            <div class="box-wr">
                <div class="box-all">
                    <?php
                        if($this->params[ 'company' ]->id != \Yii::$app->user->getId()) {
                            // Форма "оставить заявку"
                            echo $this->render('//company/_feedback_company', ['company' => $this->params['company']]);
                            // Конец формы "оставить заявку"
                            if(!empty( \Yii::$app->user->identity )) {
                                ?>
                                <div class="performance-vacancy-add-favorite">
                                    <?php
                                        if($this->params[ 'company' ]->isBookmarked) {
                                            echo Html::a('', [ '#' ], [
                                                'class'   => 'artbox_bookmark_remove_performer',
                                                'data-id' => $this->params[ 'company' ]->id,
                                            ]);
                                        } else {
                                            echo Html::a('', [ '#' ], [
                                                'class'   => 'artbox_bookmark_add_performer',
                                                'data-id' => $this->params[ 'company' ]->id,
                                            ]);
                                        }
                                    ?>
                                </div>
                                <?php
                            }
                        }
                    ?>
                </div>
            </div>
        </div>
        <div class="section-box menu-content-wr">
            <div class="box-wr">
                <div class="box-all">
                    <?php
                        echo Menu::widget([
                            'options'        => [
                                'class' => 'menu-content',
                            ],
                            'activeCssClass' => 'active-menu-content',
                            'items'          => [
                                [
                                    'label' => 'Общее',
                                    'url'   => [
                                        'company/common',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                                [
                                    'label'   => 'Выполненные работы',
                                    'url'     => [
                                        'company/portfolio',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                    'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false,
                                ],
                                [
                                    'label'   => 'Заказанные работы',
                                    'url'     => [
                                        'company/projects',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                    'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false,
                                ],
                                [
                                    'label' => 'Команда',
                                    'url'   => [
                                        'company/team',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                                [
                                    'label' => 'Вакансии',
                                    'url'   => [
                                        'company/vacancy-list',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                                [
                                    'label' => 'Блог',
                                    'url'   => [
                                        'company/blog-list',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                                [
                                    'label' => 'Мнения',
                                    'url'   => [
                                        'company/review',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                                [
                                    'label' => 'Галерея',
                                    'url'   => [
                                        'company/gallery',
                                        'company_id' => $this->params[ 'company' ]->id,
                                        'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                    ],
                                ],
                            ],
                        ]);
                    ?>
                </div>
            </div>
        </div>
        <div class="section-box-15">
            <div class="box-wr">
                <div class="box-all">
                    <div class="performer-vacancy-sidebar-left-wr gallery-page-sidebar">
                        <div class="performer-vacancy-sidebar-left">
                            <div class="performance-vacancy-sidebar-company-wr">
                                <div class="performance-vacancy-sidebar-company-title style"><?= $this->params[ 'company' ]->name ?></div>
                                <div class="performance-vacancy-sidebar-company-job style">
                                    <ul>
                                        <li class="activejob">
                                            <?php
                                                if($this->params[ 'company' ]->userInfo->is_freelancer xor $this->params[ 'company' ]->userInfo->is_customer) {
                                                    if(!empty($this->params[ 'type' ]) && $this->params[ 'type' ] == 'customer') {
                                                        echo Html::tag('span', 'Заказчик', [ 'class' => 'activejob_span' ]);
                                                    } else {
                                                        echo Html::tag('span', 'Исполнитель', [ 'class' => 'activejob_span' ]);
                                                    }
                                                } else {
                                                    if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'implementer') {
                                                        echo Html::a('Исполнитель', Url::current([ 'type' => 'implementer' ]));
                                                    } elseif(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') {
                                                        echo Html::a('Заказчик', Url::current([ 'type' => NULL ]));
                                                    } else {
                                                        echo Html::a('Исполнитель', Url::current([ 'type' => NULL ]));
                                                    }
                                                    ?>
                                                    <div class="sidebar-droped-wr style">
                                                        <ul>
                                                            <li>
                                                                <?php
                                                                    if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'implementer') {
                                                                        echo Html::a('Заказчик', Url::current([ 'type' => 'customer' ]));
                                                                    } elseif(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') {
                                                                        echo Html::a('Исполнитель', Url::current([ 'type' => NULL ]));
                                                                    } else {
                                                                        echo Html::a('Заказчик', Url::current([ 'type' => 'customer' ]));
                                                                    }
                                                                ?>
                                                            </li>
                                                            <li style="display: none">
                                                                <?php
                                                                    if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'implementer') {
                                                                        echo Html::a('Исполнитель', Url::current([ 'type' => 'implementer' ]));
                                                                    } elseif(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') {
                                                                        echo Html::a('Заказчик', Url::current([ 'type' => NULL ]));
                                                                    } else {
                                                                        echo Html::a('Исполнитель', Url::current([ 'type' => NULL ]));
                                                                    }
                                                                ?>
                                                        </ul>
                                                    </div>
                                                    <?php
                                                }
                                            ?>
                                        </li>
                                    </ul>
                                </div>
                                <div class="performance-vacancy-sidebar-stars style">
                                    <?php
                                        echo StarRating::widget([
                                            'name'          => 'rating_company',
                                            'value'         => $this->params[ 'company' ]->userInfo->rating,
                                            'pluginOptions' => [
                                                'displayOnly' => true,
                                                'size'        => 'xxs',
                                                'min'         => 0,
                                                'max'         => 10,
                                                'stars'       => 10,
                                            ],
                                        ]);
                                    ?>
                                </div>
                                <div class="performance-vacancy-sidebar-comm style"><?= count($this->params[ 'company' ]->comments) ?> мнений</div>
                                <?php
                                    if($this->params[ 'company' ]->id != \Yii::$app->user->getId()) {
                                        echo Html::a('написать мнение', [
                                            'company/review',
                                            'company_id' => $this->params[ 'company' ]->id,
                                            'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                                        ], [ 'class' => 'performance-vacancy-sidebar-write style' ]);
                                    }
                                ?>
                            </div>
                            <div class="performer-vacancy-sidebar-img style">
                                <?= Html::img($this->params[ 'company' ]->userInfo->image); ?>
                            </div>
                        </div>
                    </div>
                    <div class="section-box-21">
                        <div class="box-wr">
                            <div class="box-all">
                                <?= $content ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $('div.rating').rating(
            {
                fx : 'full',
                readOnly : 'true',
                url : 'rating.php'
            }
        );
    </script>
<?php $this->endContent() ?>