Blame view

frontend/views/performer/common.php 11 KB
eb7e82fb   Administrator   29.02.16
1
2
  <?php

  

225c5168   Yarik   test
3
      use common\models\User;

0eb4e7fc   Yarik   test
4
      use kartik\rating\StarRating;

38a6e1dd   Yarik   test
5
6
      use yii\helpers\ArrayHelper;

      use \yii\helpers\Html;

eb7e82fb   Administrator   29.02.16
7
  

225c5168   Yarik   test
8
      /* @var yii\web\View $this

76f36646   Yarik   test
9
       * @var User  $user

225c5168   Yarik   test
10
11
12
       * @var array $developments

       * @var array $educations

       * @var array $courses

5d627502   Yarik   test
13
       * @var int[]   $geography

38a6e1dd   Yarik   test
14
15
       */

      $this->params[ 'user' ] = $user;

eb7e82fb   Administrator   29.02.16
16
  

38a6e1dd   Yarik   test
17
      $this->title = 'My Yii Application';

76f36646   Yarik   test
18
  

5d627502   Yarik   test
19
20
21
22
23
24
25
26
27
28
29
      $geographyString = '';

  

      $first = 1;

      foreach($geography as $city => $count) {

          if(!$first) {

              $geographyString .= ', ';

          }

          $geographyString .= $city . ' ('.$count.')';

          $first = 0;

      }

      unset($first);

eb7e82fb   Administrator   29.02.16
30
31
  ?>

  <div class="proektant-profile-content">

225c5168   Yarik   test
32
      <?php

76f36646   Yarik   test
33
          if(!empty( $user->userInfo->about )) {

225c5168   Yarik   test
34
              ?>

76f36646   Yarik   test
35
36
37
38
39
40
41
              <div class="proektant-profile-hidden-txt">

                  <?= $user->userInfo->about ?>

              </div>

              <a href="#" class="profile-see-all"></a>

              <?php

          }

      ?>

38a6e1dd   Yarik   test
42
      <?php

76f36646   Yarik   test
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
          if(!empty( $educations )) {

              ?>

              <div class="proektant-profile-courses-wr style">

                  <div class="proektant-profile-courses">

                      <div class="proektant-profile-courses-title">Образование:</div>

                      <?php

                          foreach($educations as $education) {

                              ?>

                              <div class="proektant-profile-courses-year"><?= isset( $education[ 'year_from' ] ) ? $education[ 'year_from' ] : '' ?>-<?= isset( $education[ 'year_to' ] ) ? $education[ 'year_to' ] : 'настоящее время' ?></div>

                              <div class="proektant-profile-courses-content"><?= isset( $education[ 'name' ] ) ? $education[ 'name' ] : '' ?></div>

                              <?php

                          }

                      ?>

                  </div>

              </div>

              <?php

          }

225c5168   Yarik   test
60
61
      ?>

      <?php

76f36646   Yarik   test
62
          if(!empty( $developments )) {

225c5168   Yarik   test
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
              ?>

              <div class="proektant-profile-courses-wr style">

                  <div class="proektant-profile-courses">

                      <div class="proektant-profile-courses-title">Собственные разработки, патенты:</div>

                      <?php

                          foreach($developments as $development) {

                              ?>

                              <div class="proektant-profile-courses-year"><?= isset( $development[ 'year' ] ) ? $development[ 'year' ] : '' ?></div>

                              <div class="proektant-profile-courses-content"><?= isset( $development[ 'name' ] ) ? $development[ 'name' ] : '' ?></div>

                              <?php

                          }

                      ?>

                  </div>

              </div>

              <?php

          }

      ?>

      <?php

76f36646   Yarik   test
81
          if(!empty( $courses )) {

225c5168   Yarik   test
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
              ?>

              <div class="proektant-profile-courses-wr style">

                  <div class="proektant-profile-courses">

                      <div class="proektant-profile-courses-title">Пройденные курсы, тренинги:</div>

                      <?php

                          foreach($courses as $course) {

                              ?>

                              <div class="proektant-profile-courses-year"><?= isset( $course[ 'year' ] ) ? $course[ 'year' ] : '' ?></div>

                              <div class="proektant-profile-courses-content"><?= isset( $course[ 'name' ] ) ? $course[ 'name' ] : '' ?></div>

                              <?php

                          }

                      ?>

                  </div>

              </div>

              <?php

          }

      ?>

      <?php

38a6e1dd   Yarik   test
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
          if(!empty( $user->jobs )) {

              ?>

              <div class="proektant-profile-statistic-wr style">

                  <div class="proektant-profile-tb-blocks">

                      <div class="proektant-profile-stat-title">Статистика участия</div>

                      <div class="proektant-profile-stat-table">

                          <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border: 1px solid #dfdfdf; border-radius: 4px;">

                              <tr>

                                  <td width="284" style="border-left: none;">Компания</td>

                                  <td width="75">Проекты</td>

                                  <td width="117">Реализованные</td>

                              </tr>

                              <?php

                                  foreach($user->jobs as $job) {

                                      ?>

                                      <tr>

                                          <td style="border-left: none"><?= $job->name ?></td>

                                          <td><?= $job->total_count ?></td>

                                          <td><?= $job->complete_count ?></td>

                                      </tr>

                                      <?php

                                  }

                              ?>

                          </table>

                      </div>

                  </div>

eb7e82fb   Administrator   29.02.16
126
              </div>

38a6e1dd   Yarik   test
127
128
129
              <?php

          }

      ?>

eb7e82fb   Administrator   29.02.16
130
131
132
133
  </div>

  <div class="proektant-profile-sidebar-right">

      <div class="style">

          <div class="profile-phone-site style">

38a6e1dd   Yarik   test
134
135
136
137
138
139
              <?= $this->render('/patrial/show_phone', [

                  'phones' => $phones,

              ]) ?>

              <?= $this->render('/patrial/show_site', [

                  'sites' => $sites,

              ]) ?>

eb7e82fb   Administrator   29.02.16
140
141
142
          </div>

          <div class="profile-features style">

              <ul>

76f36646   Yarik   test
143
                  <?php

5d627502   Yarik   test
144
                      if(!empty( $geographyString )) {

76f36646   Yarik   test
145
146
                          ?>

                          <li>

5d627502   Yarik   test
147
                              <span>География работ: </span><?= $geographyString ?>

76f36646   Yarik   test
148
149
150
151
152
153
154
155
156
157
158
159
                          </li>

                          <?php

                      }

                  ?>

                  <li><span>Местонахождение: </span>

                      <?php

                          if(!empty( $user->userInfo->city )) {

                              echo $user->userInfo->city;

                          } else {

                              echo 'Не указано';

                          }

                      ?>

38a6e1dd   Yarik   test
160
                  </li>

eb7e82fb   Administrator   29.02.16
161
162
                  <li>

                      <div class="features-tags features-tags-profile">

38a6e1dd   Yarik   test
163
                          <?php foreach($user->specializations as $specialization): ?>

eb7e82fb   Administrator   29.02.16
164
165
166
167
                              <span><a href="#"><?= $specialization->specialization_name ?></a>, </span>

                          <?php endforeach; ?>

                      </div>

                  </li>

76f36646   Yarik   test
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
                  <?php

                      if(!empty( $soft )) {

                          ?>

                          <li><span>Работа с программами: </span><?= $soft ?></li>

                          <?php

                      }

                  ?>

                  <?php

                      if(!empty( $user->userInfo->guarantee )) {

                          ?>

                          <li><span>Гарантия: </span><?= $user->userInfo->guarantee ?> года</li>

                          <?php

                      }

                  ?>

                  <?php

                      if(!empty( $user->userInfo->contract )) {

                          ?>

                          <li>

78ab7436   Yarik   test
186
                              <span>Договор: </span><?= $user->userInfo->contract ?>

76f36646   Yarik   test
187
188
189
190
191
192
193
194
                          </li>

                          <?php

                      }

                  ?>

                  <?php

                      if(!empty( $user->userInfo->estimate )) {

                          ?>

                          <li>

78ab7436   Yarik   test
195
                              <span>Смета: </span><?= $user->userInfo->estimate ?>

76f36646   Yarik   test
196
197
198
199
200
201
202
203
                          </li>

                          <?php

                      }

                  ?>

                  <?php

                      if(!empty( $user->userInfo->purchase )) {

                          ?>

                          <li>

78ab7436   Yarik   test
204
                              <span>Закупка стройматериалов: </span><?= $user->userInfo->purchase ?>

76f36646   Yarik   test
205
206
207
208
209
210
211
212
                          </li>

                          <?php

                      }

                  ?>

                  <?php

                      if(!empty( $user->userInfo->delivery )) {

                          ?>

                          <li>

78ab7436   Yarik   test
213
                              <span>Доставка стройматериалов: </span><?= $user->userInfo->delivery ?>

76f36646   Yarik   test
214
215
216
217
218
219
220
221
222
223
224
225
                          </li>

                          <?php

                      }

                  ?>

                  <li><span>Предоплата:</span>

                      <?php

                          if(!empty( $user->userInfo->prepayment )) {

                              echo $user->userInfo->prepayment . '%';

                          } else {

                              echo 'без предоплаты';

                          }

                      ?>

38a6e1dd   Yarik   test
226
                  </li>

eb7e82fb   Administrator   29.02.16
227
228
229
              </ul>

          </div>

          <div class="profile-comments style">

76f36646   Yarik   test
230
              <div class="company-performer-comm-title style">Мнений: <?= count($user->comments) ?></div>

eb7e82fb   Administrator   29.02.16
231
              <div class="company-performer-comments-wr style">

32ed90fd   Yarik   test
232
233
234
235
236
237
238
                  <?php

                      $count = ( count($user->comments) > 4 ) ? 4 : count($user->comments);

                      for($i = 0; $i < $count; $i++) {

                          ?>

                          <div class="company-performer-comments-bl">

                              <?php

                                  if(!empty( $user->comments[ $i ]->rating )) {

0eb4e7fc   Yarik   test
239
240
241
242
243
                                          echo StarRating::widget([

                                              'name' => 'rating_common',

                                              'value' => $user->comments[ $i ]->rating->value,

                                              'pluginOptions' => ['displayOnly' => true, 'size' => 'xxs']

                                          ]);

32ed90fd   Yarik   test
244
245
                                  }

                              ?>

b9a54f61   Yarik   test
246
                              <div class="company-performer-comments-autor">Мнение от: <?= $user->comments[ $i ]->getAuthor(' (Гость)') ?></div>

76f36646   Yarik   test
247
                              <div class="company-performer-comments-txt"><?= $user->comments[ $i ]->text ?></div>

32ed90fd   Yarik   test
248
249
250
251
252
                              <a href="#" class="company-comm-see-all"><span>Развернуть</span></a>

                          </div>

                          <?php

                      }

                  ?>

eb7e82fb   Administrator   29.02.16
253
              </div>

32ed90fd   Yarik   test
254
255
              <div class="company-performer-comm-see-all-butt style">

                  <?php

76f36646   Yarik   test
256
257
258
259
260
                      echo Html::a('Читать все мнения', [

                          'performer/review',

                          'performer_id' => $user->id,

                          'type'         => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL,

                      ]);

32ed90fd   Yarik   test
261
                  ?>

38a6e1dd   Yarik   test
262
              </div>

eb7e82fb   Administrator   29.02.16
263
264
265
          </div>

      </div>

  </div>