company.php 17.6 KB
<?php
    /**
     * @var string $content
     * @var View   $this
     */

    use common\models\User;
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\web\View;
    use yii\widgets\Menu;

    $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()) {
                            ?>
                            <div class="performance-vacancy-call-back">
                                <div class="performance-vacancy-call-back-title">Оставьте заявку<br/>и мы вам перезвоним
                                </div>
                                <form class="callback" action="">

                                    <div class="input-blocks-wrapper">
                                        <label for="callbac_name">Имя</label>
                                        <input id="callbac_name" type="text"/>
                                    </div>

                                    <div class="input-blocks-wrapper">
                                        <label for="callbac_phone">Телефон</label>
                                        <input id="callbac_phone" type="text"/>
                                    </div>

                                    <input id="callbac_submit" type="submit" value="Перезвонить мне"/>
                                </form>
                                <div class="performance-vacancy-call-back-conf">Гарантируем конфидециальность</div>
                            </div>
                            <?php
                            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">
                        <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(!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>
                                        </li>
                                    </ul>
                                </div>
                                <div class="performance-vacancy-sidebar-stars style">
                                    <div class="rating">
                                        <!--оценка-->
                                        <input type="hidden" class="val" value="<?= $this->params[ 'company' ]->userInfo->rating ?>"/>
                                        <!--количество голосов-->
                                        <input type="hidden" class="votes" value="1"/>
                                    </div>
                                </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 class="performer-vacancy-sidebar-all style">
                                <?= $this->render('/patrial/social_list', [
                                    'params' => $this->params,
                                ]) ?>
                                <div class="performer-vacancy-sidebar-views style">
                                    <ul class="style">
                                        <li><img src="/images/sidebar-ico/ico-1.png" alt=""/>
                                            <div class="sidebarvievstxt"><?= $this->params[ 'company' ]->userInfo->view_count; ?> просмотра</div>
                                        </li>
                                        <li><img src="/images/sidebar-ico/ico-2.png" alt=""/>
                                            <div class="sidebarvievstxt">
                                                <span class="sidebar-views-txt">На сайте: </span><?= $this->params[ 'company' ]->liveTime ?>
                                            </div>
                                        </li>
                                        <li><img src="/images/sidebar-ico/ico-3.png" alt=""/>
                                            <div class="sidebarvievstxt">
                                                <span class="sidebar-views-txt">Последний визит: <br/></span><?= $this->params[ 'company' ]->userInfo->lastVisit ?>
                                            </div>
                                        </li>
                                        <li><img src="/images/sidebar-ico/ico-5.png" alt=""/>
                                            <div class="sidebarvievstxt">
                                                <span class="sidebar-views-txt">Сотрудники:<br/></span><?= $this->params[ 'company' ]->companyInfo->staff ?>
                                            </div>
                                        </li>
                                        <?= $this->render('/patrial/show_phone_list', [
                                            'phones' => $this->params[ 'company' ]->phones,
                                        ]) ?>
                                        <?= $this->render('/patrial/show_site_list', [
                                            'sites' => $this->params[ 'company' ]->site,
                                        ]) ?>
                                        <li><img src="/images/sidebar-ico/ico-8.png" alt=""/>
                                            <div class="sidebarvievstxt">
                                                <span class="sidebar-views-txt">Адрес:<br/></span><?= $this->params[ 'company' ]->address ?>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="section-box performer-vacancy-vacant-wr">
                        <?= $content ?>
                    </div>
                </div>
            </div>
        </div>
        <?php
            /*====Blocks created in view====*/
            if(isset( $this->blocks[ 'our_objects' ] )) {
                echo $this->blocks[ 'our_objects' ];
            }
            if(isset( $this->blocks[ 'blog' ] )) {
                echo $this->blocks[ 'blog' ];
            }
            if(isset( $this->blocks[ 'team' ] )) {
                echo $this->blocks[ 'team' ];
            }
            if(isset( $this->blocks[ 'review' ] )) {
                echo $this->blocks[ 'review' ];
            }
            /*====End of blocks created in view====*/
        ?>
    </div>
    <script>
        $('div.rating').rating(
            {
                fx : 'full', readOnly : 'true', url : 'rating.php'
            }
        );
    </script>
<?php $this->endContent() ?>