Blame view

frontend/views/company/common.php 15.4 KB
fbdb1f1c   Yarik   test
1
  <?php
225c5168   Yarik   test
2
      /**
76f36646   Yarik   test
3
4
       * @var View               $this
       * @var User               $company
225c5168   Yarik   test
5
6
7
8
       * @var ActiveDataProvider $projectProvider
       * @var ActiveDataProvider $blogProvider
       * @var ActiveDataProvider $commentProvider
       */
004b2298   Yarik   test
9
      use common\models\Specialization;
225c5168   Yarik   test
10
11
12
      use common\models\User;
      use yii\data\ActiveDataProvider;
      use yii\helpers\ArrayHelper;
110087c2   Yarik   test
13
      use yii\helpers\Html;
225c5168   Yarik   test
14
15
16
17
18
      use yii\web\View;
      use yii\widgets\ListView;
  
      $this->params[ 'company' ] = $company;
      $this->title = 'My Yii Application';
fbdb1f1c   Yarik   test
19
  ?>
225c5168   Yarik   test
20
21
      <div class="company-performer-title style">О компании</div>
      <div class="company-performer-txt style">
0eb4e7fc   Yarik   test
22
23
24
25
26
27
28
          <?php
              if(!empty( $company->userInfo->about )) {
                  echo $company->userInfo->about;
              } else {
                  echo Yii::t('app', 'Not found');
              }
          ?>
225c5168   Yarik   test
29
      </div>
fbdb1f1c   Yarik   test
30
31
  <?php
      /*====Blocks for layout====*/
225c5168   Yarik   test
32
33
34
      /*
       * Use $projectProvider to obtain models for this block
       */
fbdb1f1c   Yarik   test
35
36
37
38
39
      $this->beginBlock('our_objects');
  ?>
      <div class="section-box-18">
          <div class="box-wr">
              <div class="box-all">
225c5168   Yarik   test
40
                  <div class="company-performer-type-title style">Наши объекты (<?= $projectProvider->totalCount ?>)</div>
004b2298   Yarik   test
41
                  <div class="settings-map-ul company_map_time" data-map="company_map">
fbdb1f1c   Yarik   test
42
                      <ul>
004b2298   Yarik   test
43
44
45
46
47
48
49
50
51
                          <li>
                              <a href="#" class="active company_map_time_link" data-start="<?= strtotime('-1 years') ?>"><span>Последний год</span></a>
                          </li>
                          <li>
                              <a href="#" class="company_map_time_link" data-start="<?= strtotime('-5 years') ?>"><span>Последние пять лет</span></a>
                          </li>
                          <li>
                              <a href="#" class="company_map_time_link" data-start="0"><span>Весь период</span></a>
                          </li>
fbdb1f1c   Yarik   test
52
53
54
55
56
                      </ul>
                  </div>
                  <div class="company-performer-type-map style">
                      <div class="section-box-map">
                          <div class="shadow-map"></div>
004b2298   Yarik   test
57
                          <div id="map_company" style="width: 100%; height:100%;" data-user="<?= $company->id ?>"></div>
fbdb1f1c   Yarik   test
58
                          <div class="company-performer-map-menu">
004b2298   Yarik   test
59
60
61
62
63
64
65
                              <?php
                                  $specializations = Specialization::find()
                                                                   ->where([ 'specialization_pid' => 0 ])
                                                                   ->with('children.children')
                                                                   ->orderBy('specialization_id')
                                                                   ->all();
                              ?>
fbdb1f1c   Yarik   test
66
                              <ul class="content-menu-first">
004b2298   Yarik   test
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
                                  <?php
                                      foreach($specializations as $specialization) {
                                          ?>
                                          <li data-img="<?= $specialization->image ?>">
                                              <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#" data-id="<?= $specialization->specialization_id ?>" class="map_company_filter"><?= $specialization->specialization_name ?></a>
                                              <ul>
                                                  <?php foreach($specialization->children as $child_first) { ?>
                                                      <li>
                                                          <a href="#" data-id="<?= $child_first->specialization_id ?>" class="map_company_filter"><?= $child_first->specialization_name ?></a>
                                                          <ul>
                                                              <?php foreach($child_first->children as $child_second) { ?>
                                                                  <li>
                                                                      <a href="#" title="<?= $child_second->specialization_name ?>" data-id="<?= $child_second->specialization_id ?>" class="map_company_filter"><?= $child_second->specialization_name ?></a>
                                                                  </li>
                                                              <?php } ?>
                                                          </ul>
                                                      </li>
                                                  <?php } ?>
                                              </ul>
                                          </li>
                                          <?php
                                      }
                                  ?>
fbdb1f1c   Yarik   test
90
                              </ul>
fbdb1f1c   Yarik   test
91
92
93
94
95
96
97
98
99
                          </div>
                      </div>
                  </div>
              </div>
          </div>
      </div>
  <?php
      $this->endBlock();
      $this->beginBlock('blog');
225c5168   Yarik   test
100
101
102
      /**
       * Use $blogProvider for this block
       */
0eb4e7fc   Yarik   test
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
      if(!empty( $blogProvider->models )) {
          ?>
          <div class="section-box-232">
              <div class="box-wr">
                  <div class="box-all">
                      <?php
                          echo ListView::widget([
                              'dataProvider' => $blogProvider,
                              'options'      => [
                                  'class' => 'min-post-wr',
                              ],
                              'itemView'     => '_company_common_blog',
                              'itemOptions'  => [
                                  'class' => 'min-post-block',
                              ],
                              'layout'       => '{items}',
                              'viewParams'   => [ 'parent_view' => $this ],
                          ]);
                      ?>
                  </div>
fbdb1f1c   Yarik   test
123
124
              </div>
          </div>
0eb4e7fc   Yarik   test
125
126
          <?php
      }
fbdb1f1c   Yarik   test
127
128
      $this->endBlock();
      $this->beginBlock('team');
225c5168   Yarik   test
129
130
131
      /*
       * User preloaded $company->teams models
       */
110087c2   Yarik   test
132
      $teams = ArrayHelper::index($company->teams, 'team_id', 'department.name'); // Group team members according to their department
0eb4e7fc   Yarik   test
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
      if(!empty( $teams )) {
          ?>
          <div class="section-box-233">
              <div class="box-wr">
                  <div class="box-all">
                      <div class="table-team-title style">Состав команды</div>
                      <div class="table-team-wr style">
                          <div class="table-team-left">
                              <?php
                                  for($i = 0; $i < count($teams); $i = $i + 2) {
                                      ?>
                                      <div class="tb-team-wr">
                                          <table class="title-table" cellspacing="0" cellpadding="0" border="0">
                                              <tr>
                                                  <td width="337">
                                                      <?php
                                                          if(!empty( array_keys($teams)[ $i ] )) {
                                                              echo array_keys($teams)[ $i ];
                                                          } else {
                                                              echo 'Не определен';
                                                          }
                                                      ?>
                                                  </td>
                                                  <td align="center"></td>
                                              </tr>
                                          </table>
                                          <table class="all-table-first" cellspacing="0" cellpadding="0" border="0">
                                              <tr>
                                                  <td align="center" width="32"></td>
                                                  <td align="center" width="323">Ф.И.О.</td>
                                                  <td align="center" width="91">Опыт, лет</td>
                                              </tr>
                                          </table>
                                          <table class="all-table" cellspacing="0" cellpadding="0" border="0">
                                              <?php
                                                  foreach($teams[ array_keys($teams)[ $i ] ] as $team) {
                                                      ?>
                                                      <tr>
                                                          <td align="center" width="32">
                                                              <?= Html::img('/images/portfolio-project/flag-img-1.jpg') ?>
                                                          </td>
                                                          <td align="center" width="323"><?= $team->lastname . ' ' . $team->firstname ?></td>
                                                          <td align="center" width="91">
                                                              <?php
                                                                  if(!empty( $team->experience_from )) {
                                                                      echo date('Y') - $team->experience_from;
                                                                  } else {
                                                                      echo 'Не указан';
                                                                  }
                                                              ?>
                                                          </td>
                                                      </tr>
                                                      <?php
                                                  }
                                              ?>
                                          </table>
                                      </div>
                                      <?php
                                  }
                              ?>
                          </div>
                          <div class="table-team-right">
                              <?php
                                  for($i = 1; $i < count($teams); $i = $i + 2) {
                                      ?>
                                      <div class="tb-team-wr">
                                          <table class="title-table" cellspacing="0" cellpadding="0" border="0">
                                              <tr>
                                                  <td width="337">
                                                      <?php
                                                          if(!empty( array_keys($teams)[ $i ] )) {
                                                              echo array_keys($teams)[ $i ];
                                                          } else {
                                                              echo 'Не определен';
                                                          }
                                                      ?>
                                                  </td>
                                                  <td align="center"></td>
                                              </tr>
                                          </table>
                                          <table class="all-table-first" cellspacing="0" cellpadding="0" border="0">
                                              <tr>
                                                  <td align="center" width="32"></td>
                                                  <td align="center" width="323">Ф.И.О.</td>
                                                  <td align="center" width="91">Опыт, лет</td>
                                              </tr>
                                          </table>
                                          <table class="all-table" cellspacing="0" cellpadding="0" border="0">
                                              <?php
                                                  foreach($teams[ array_keys($teams)[ $i ] ] as $team) {
                                                      ?>
                                                      <tr>
                                                          <td align="center" width="32">
                                                              <?= Html::img('/images/portfolio-project/flag-img-1.jpg') ?>
                                                          </td>
                                                          <td align="center" width="323"><?= $team->lastname . ' ' . $team->firstname ?></td>
                                                          <td align="center" width="91">
                                                              <?php
                                                                  if(!empty( $team->experience_from )) {
                                                                      echo date('Y') - $team->experience_from;
                                                                  } else {
                                                                      echo 'Не указан';
                                                                  }
                                                              ?>
                                                          </td>
                                                      </tr>
                                                      <?php
                                                  }
                                              ?>
                                          </table>
                                      </div>
                                      <?php
                                  }
                              ?>
                          </div>
fbdb1f1c   Yarik   test
248
249
250
251
                      </div>
                  </div>
              </div>
          </div>
0eb4e7fc   Yarik   test
252
253
          <?php
      }
fbdb1f1c   Yarik   test
254
255
      $this->endBlock();
      $this->beginBlock('review');
0eb4e7fc   Yarik   test
256
257
258
259
260
      if(!empty( $commentProvider->models )) {
          ?>
          <div class="section-box-19">
              <div class="box-wr">
                  <div class="box-all">
34190b33   Yarik   test
261
                      <div class="company-performer-comm-title style">Мнений: <?= $commentProvider->totalCount ?></div>
0eb4e7fc   Yarik   test
262
263
264
265
266
267
268
269
270
271
272
273
274
275
                      <?php
                          echo ListView::widget([
                              'dataProvider' => $commentProvider,
                              'options'      => [
                                  'class' => 'company-performer-comments-wr style',
                              ],
                              'itemView'     => '_company_common_review',
                              'itemOptions'  => [
                                  'class' => 'company-performer-comments-bl',
                              ],
                              'layout'       => '{items}',
                          ]);
                      ?>
                      <div class="company-performer-comm-see-all-butt style">
34190b33   Yarik   test
276
                          <?= Html::a('Читать все мнения', [
0eb4e7fc   Yarik   test
277
278
279
280
281
                              'company/review',
                              'company_id' => $company->id,
                              'type'       => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,
                          ]) ?>
                      </div>
110087c2   Yarik   test
282
                  </div>
fbdb1f1c   Yarik   test
283
284
              </div>
          </div>
0eb4e7fc   Yarik   test
285
286
          <?php
      }
fbdb1f1c   Yarik   test
287
288
289
      $this->endBlock();
      /*====End blocks for layout====*/
  ?>