/
profile.php
96 lines (84 loc) · 2.18 KB
/
profile.php
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
<?php
/**
* Created by PhpStorm.
* User: reglobbe
* Date: 14/8/15
* Time: 3:06 PM
*/
use yii\widgets\DetailView;
use yii\grid\GridView;
use yii\data\ArrayDataProvider;
use yii\helpers\Html;
$this->title = 'Dealer Profile';
?>
<h1><?= $this->title; ?></h1>
<?= DetailView::widget([
'model' => $model,
'formatter' => [
'class' => 'yii\i18n\Formatter',
'nullDisplay' => ''
],
'attributes' => [
'user0.name',
'city',
'user0.email',
'contact',
'dealerSecurities.security'
],
]); ?>
<?= Html::a('Update Profile', '#', ['class' => 'btn btn-success', 'id' => 'update-profile']) ?>
<h2>Dealer Preferences</h2>
<?php $dataProvider = new ArrayDataProvider([
'allModels' => $model->dealerPreferences,
'pagination' => [
'pageSize' => 4,
],
]); ?>
<?= Html::a('Add Prefences', '#', ['class' => 'btn btn-success', 'id' => 'add-prefences']) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'header' => 'Category Name',
'value' => 'category0.name',
],
[
'header' => 'Brand Name',
'value' => 'brand0.name'
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {delete}',
'buttons' => [
'view' => function ($model) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', '#', [
'class' => 'prefeneces-view-link',
'data-id' => $model,
]);
}
]
]
]
]) ?>
<h2> Dealer Companies</h2>
<?php
$dataProvider = new ArrayDataProvider([
'allModels' => $model->dealerCompanies,
'pagination' => [
'pageSize' => 10,
],
]);
?>
<?= Html::a('Add Company', '#', ['class' => 'btn btn-success', 'id' => 'add-company']) ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'company0.name',
'company0.description',
'status',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}{delete}',
]
]
]) ?>