Blame view

frontend/views/search/_customer_list_view.php 3.96 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">
ebc2fc3e   Виталий   git
33
  
93a7a3c1   Yarik   test
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
          <?php
              if($rating = $model->userInfo->rating) {
                  echo StarRating::widget([
                      'name'          => 'rating_customer',
                      'value'         => $rating,
                      'pluginOptions' => [
                          'displayOnly' => true,
                          'size'        => 'xxs',
                          'min'         => 0,
                          'max'         => 10,
                          'stars'       => 10,
                      ],
                  ]);
              } else {
                  echo StarRating::widget([
                      'name'          => 'rating_customer',
                      'value'         => 0,
                      'pluginOptions' => [
                          'displayOnly' => true,
                          'size'        => 'xxs',
                          'min'         => 0,
                          'max'         => 10,
                          'stars'       => 10,
                      ],
                  ]);
              }
          ?>
ebc2fc3e   Виталий   git
61
  
f94a00a6   Yarik   test
62
          <div class="search_perform-stars-txt">
34190b33   Yarik   test
63
              <?= count($model->comments) ?> мнений
f94a00a6   Yarik   test
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
              <?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
81
82
          <span>Последний визит:</span>
          <?php
0eb4e7fc   Yarik   test
83
84
85
86
87
              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
88
          ?>
f94a00a6   Yarik   test
89
90
      </div>
      <div class="search_perform_projets_nam">
0eb4e7fc   Yarik   test
91
92
93
94
          <?= Html::a("Заказов " . count($model->projects), [
              'search/project',
              (new Project())->formName() . '[user_id]' => $model->id,
          ]) ?>
4ed1f788   Yarik   test
95
      </div>
f94a00a6   Yarik   test
96
97
98
99
  </div>
  
  <div class="right_search_perform_block-wr">
      <div class="right_search_perform_foto-wr">
4ed1f788   Yarik   test
100
101
          <div>
              <?php
0eb4e7fc   Yarik   test
102
                  echo Html::img($model->userInfo->image ? : "/images/search_performer_img-1.jpg", [ 'class' => 'search_customer_image' ]);
4ed1f788   Yarik   test
103
104
              ?>
          </div>
f94a00a6   Yarik   test
105
      </div>
3c618303   Yarik   test
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
      <?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
121
  </div>