Blame view

frontend/views/search/_customer_list_view.php 3.16 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
11
12
13
14
      use common\models\User;
      use frontend\helpers\TextHelper;
      use yii\bootstrap\Html;
      use yii\helpers\Url;
      use yii\widgets\ListView;
f94a00a6   Yarik   test
15
16
17
18
19
  ?>
  <div class="search_perform_txt-wr">
      <div class="search_perform_title">
          <?php
              if($model->type == 2) {
4ed1f788   Yarik   test
20
                  echo Html::a($model->companyInfo->name, ['company/common', 'company_id' => $model->id]);
f94a00a6   Yarik   test
21
              } else {
4ed1f788   Yarik   test
22
                  echo Html::a($model->firstname . $model->lastname, ['performer/common', 'performer_id' => $model->id]);
f94a00a6   Yarik   test
23
24
25
26
27
28
              }
          ?>
      </div>
      <div class="search_perform-stars-wr">
          <div class="rating_search_performer">
              <!--оценка-->
4ed1f788   Yarik   test
29
              <?php
2fd40ee7   Yarik   test
30
              if($rating = $model->userInfo->rating) {
4ed1f788   Yarik   test
31
32
33
34
35
                  echo "<input type='hidden' class='val' value='{$rating}'/>";
              } else {
                  echo "<input type='hidden' class='val' value='0'/>";
              }
              ?>
f94a00a6   Yarik   test
36
37
          </div>
          <div class="search_perform-stars-txt">
db659e19   Yarik   test
38
              <?= count($model->comments) ?> отзывов
f94a00a6   Yarik   test
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
              <?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
56
57
58
59
60
61
62
63
          <span>Последний визит:</span>
          <?php
          if((time() - \Yii::$app->formatter->asTimestamp($model->userInfo->date_visit)) < 1800) {
              echo 'Онлайн';
          } else {
              echo \Yii::$app->formatter->asRelativeTime($model->userInfo->date_visit);
          }
          ?>
f94a00a6   Yarik   test
64
65
      </div>
      <div class="search_perform_projets_nam">
db659e19   Yarik   test
66
          <?= Html::a("Заказано проектов ".count($model->projects), ['search/project', (new Project())->formName().'[user_id]' => $model->id]) ?>
4ed1f788   Yarik   test
67
      </div>
f94a00a6   Yarik   test
68
69
70
71
  </div>
  
  <div class="right_search_perform_block-wr">
      <div class="right_search_perform_foto-wr">
4ed1f788   Yarik   test
72
73
74
75
76
          <div>
              <?php
              echo Html::img($model->userInfo->image?:"/images/search_performer_img-1.jpg", ['class' => 'search_customer_image']);
              ?>
          </div>
f94a00a6   Yarik   test
77
      </div>
3c618303   Yarik   test
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
      <?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
93
  </div>