_customer_list_view.php
3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
/**
* @var User $model
* @var mixed $key
* @var integer $index
* @var ListView $widget
*/
use common\models\Bookmark;
use common\models\Project;
use common\models\User;
use kartik\rating\StarRating;
use yii\bootstrap\Html;
use yii\widgets\ListView;
?>
<div class="search_perform_txt-wr">
<div class="search_perform_title">
<?php
if($model->type == 2) {
echo Html::a($model->companyInfo->name, [
'company/common',
'company_id' => $model->id,
]);
} else {
echo Html::a($model->firstname . $model->lastname, [
'performer/common',
'performer_id' => $model->id,
]);
}
?>
</div>
<div class="search_perform-stars-wr">
<?php
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',
],
]);
}
?>
<div class="search_perform-stars-txt">
<?= count($model->comments) ?> отзывов
<?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">
<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);
}
?>
</div>
<div class="search_perform_projets_nam">
<?= Html::a("Заказов " . count($model->projects), [
'search/project',
(new Project())->formName() . '[user_id]' => $model->id,
]) ?>
</div>
</div>
<div class="right_search_perform_block-wr">
<div class="right_search_perform_foto-wr">
<div>
<?php
echo Html::img($model->userInfo->image ? : "/images/search_performer_img-1.jpg", [ 'class' => 'search_customer_image' ]);
?>
</div>
</div>
<?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,
]);
}
}
?>
</div>