Blame view

frontend/views/search/_customer_list_view.php 3.8 KB
f94a00a6   Yarik   test
1
2
3
4
5
6
7
  <?php
      /**
       * @var User     $model
       * @var mixed    $key
       * @var integer  $index
       * @var ListView $widget
       */
3c618303   Yarik   test
8
      use common\models\Bookmark;
4ed1f788   Yarik   test
9
      use common\models\Project;
f94a00a6   Yarik   test
10
      use common\models\User;
0eb4e7fc   Yarik   test
11
      use kartik\rating\StarRating;
f94a00a6   Yarik   test
12
      use yii\bootstrap\Html;
f94a00a6   Yarik   test
13
      use yii\widgets\ListView;
0eb4e7fc   Yarik   test
14
  
f94a00a6   Yarik   test
15
16
17
18
19
  ?>
  <div class="search_perform_txt-wr">
      <div class="search_perform_title">
          <?php
              if($model->type == 2) {
0eb4e7fc   Yarik   test
20
21
22
23
                  echo Html::a($model->companyInfo->name, [
                      'company/common',
                      'company_id' => $model->id,
                  ]);
f94a00a6   Yarik   test
24
              } else {
0eb4e7fc   Yarik   test
25
26
27
28
                  echo Html::a($model->firstname . $model->lastname, [
                      'performer/common',
                      'performer_id' => $model->id,
                  ]);
f94a00a6   Yarik   test
29
30
31
32
              }
          ?>
      </div>
      <div class="search_perform-stars-wr">
0eb4e7fc   Yarik   test
33
          <div>
4ed1f788   Yarik   test
34
              <?php
0eb4e7fc   Yarik   test
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
                  if($rating = $model->userInfo->rating) {
                      echo StarRating::widget([
                          'name'          => 'rating_customer',
                          'value'         => $rating,
                          'pluginOptions' => [
                              'displayOnly' => true,
                              'size'        => 'xxs',
                          ],
                      ]);
                  } else {
                      echo StarRating::widget([
                          'name'          => 'rating_customer',
                          'value'         => 0,
                          'pluginOptions' => [
                              'displayOnly' => true,
                              'size'        => 'xxs',
                          ],
                      ]);
                  }
4ed1f788   Yarik   test
54
              ?>
f94a00a6   Yarik   test
55
56
          </div>
          <div class="search_perform-stars-txt">
db659e19   Yarik   test
57
              <?= count($model->comments) ?> отзывов
f94a00a6   Yarik   test
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
              <?php
                  if(!empty( $model->userInfo->city )) {
                      echo ", {$model->userInfo->city}";
                  }
              ?>
          </div>
      </div>
      <?php
          if($model->type == 2 && !empty( $model->companyInfo->staff )) {
              ?>
              <div class="search_perform_leng">
                  <div>Сотрудники: <?= $model->companyInfo->staff ?></div>
              </div>
              <?php
          }
      ?>
      <div class="search_perform_visit">
c0bffebb   Yarik   test
75
76
          <span>Последний визит:</span>
          <?php
0eb4e7fc   Yarik   test
77
78
79
80
81
              if(( time() - \Yii::$app->formatter->asTimestamp($model->userInfo->date_visit) ) < 1800) {
                  echo 'Онлайн';
              } else {
                  echo \Yii::$app->formatter->asRelativeTime($model->userInfo->date_visit);
              }
c0bffebb   Yarik   test
82
          ?>
f94a00a6   Yarik   test
83
84
      </div>
      <div class="search_perform_projets_nam">
0eb4e7fc   Yarik   test
85
86
87
88
          <?= Html::a("Заказов " . count($model->projects), [
              'search/project',
              (new Project())->formName() . '[user_id]' => $model->id,
          ]) ?>
4ed1f788   Yarik   test
89
      </div>
f94a00a6   Yarik   test
90
91
92
93
  </div>
  
  <div class="right_search_perform_block-wr">
      <div class="right_search_perform_foto-wr">
4ed1f788   Yarik   test
94
95
          <div>
              <?php
0eb4e7fc   Yarik   test
96
                  echo Html::img($model->userInfo->image ? : "/images/search_performer_img-1.jpg", [ 'class' => 'search_customer_image' ]);
4ed1f788   Yarik   test
97
98
              ?>
          </div>
f94a00a6   Yarik   test
99
      </div>
3c618303   Yarik   test
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
      <?php
          if(!empty( \Yii::$app->user->identity )) {
              if($model->getIsBookmarked(Bookmark::TYPE_CUSTOMER)) {
                  echo Html::a('Убрать из закладок', [ '#' ], [
                      'class'   => 'get-list artbox_bookmark_remove_customer',
                      'data-id' => $model->id,
                  ]);
              } else {
                  echo Html::a('Добавить в закладки', [ '#' ], [
                      'class'   => 'get-list artbox_bookmark_add_customer',
                      'data-id' => $model->id,
                  ]);
              }
          }
      ?>
f94a00a6   Yarik   test
115
  </div>