Blame view

frontend/views/chat/message.php 11.9 KB
fbdb1f1c   Yarik   test
1
  <?php
7d705d85   Yarik   test
2
3
      use common\models\Message;
      use common\models\Option;
0eb4e7fc   Yarik   test
4
      use kartik\rating\StarRating;
7d705d85   Yarik   test
5
6
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
2c019f37   Alex Savenko   add image links
7
      use common\models\User;
fbdb1f1c   Yarik   test
8
  
6a97773c   Administrator   01.03.16
9
10
      $this->registerJsFile("/js/jmousewhell.js");
      $this->registerJsFile("/js/jscroll.js");
fbdb1f1c   Yarik   test
11
      $this->title = 'Мой профиль';
7d705d85   Yarik   test
12
      $this->params[ 'breadcrumbs' ][] = $this->title;;
8c448b56   Administrator   add yii jquery
13
  
fbdb1f1c   Yarik   test
14
15
16
17
18
19
20
21
22
  ?>
  
  <div class="section-box content">
      <div class="section-box-15">
          <div class="box-wr">
              <div class="box-all">
                  <div class="section-box">
                      <div class="cabinet-message-read-autor-wr style">
                          <div class="cabinet-message-read-foto-wr">
2c019f37   Alex Savenko   add image links
23
                              <div class="cabinet-message-read-foto"><?= Html::a(Html::img($chat->interlocutor->userInfo->image), $chat->interlocutor->link, ['target' => '_blank']); ?></div>
fbdb1f1c   Yarik   test
24
25
                          </div>
                          <div class="cab-mes-read-cont">
7d705d85   Yarik   test
26
                              <div class="cab-mes-read-cont-title"><?= $chat->interlocutor->userInfo->name ?></div>
fbdb1f1c   Yarik   test
27
                              <div class="cab-mes-read-cont-stars">
0eb4e7fc   Yarik   test
28
29
                                  <?php
                                      echo StarRating::widget([
93a7a3c1   Yarik   test
30
31
32
33
34
35
36
37
38
                                          'name'          => 'rating_messange',
                                          'value'         => $chat->interlocutor->userInfo->rating,
                                          'pluginOptions' => [
                                              'displayOnly' => true,
                                              'size'        => 'xxs',
                                              'min'         => 0,
                                              'max'         => 10,
                                              'stars'       => 10,
                                          ],
0eb4e7fc   Yarik   test
39
40
                                      ]);
                                  ?>
fbdb1f1c   Yarik   test
41
                              </div>
34190b33   Yarik   test
42
                              <div class="cab-mes-read-cont-com"><?= count($chat->interlocutor->comments) ?> мнений</div>
fbdb1f1c   Yarik   test
43
                              <div class="cab-mes-read-cont-soc">
af5c9885   Yarik   Fixes
44
45
46
47
48
49
50
51
52
53
54
55
56
57
                                  <?php
                                  if(!empty($chat->interlocutor->userInfo->social_fb)) {
                                      echo Html::a(Html::img('/images/ico-fb.png'), "{$chat->interlocutor->userInfo->social_fb}", [ 'target' => '_blank' ]);
                                  }
                                      if(!empty($chat->interlocutor->userInfo->social_t)) {
                                          echo Html::a(Html::img('/images/ico-tw.png'), "{$chat->interlocutor->userInfo->social_t}", [ 'target' => '_blank' ]);
                                      }
                                      if(!empty($chat->interlocutor->userInfo->social_in)) {
                                          echo Html::a(Html::img('/images/ico-in.png'), "{$chat->interlocutor->userInfo->social_in}", [ 'target' => '_blank' ]);
                                      }
                                      if(!empty($chat->interlocutor->userInfo->social_vk)) {
                                          echo Html::a(Html::img('/images/ico-vk.png'), "{$chat->interlocutor->userInfo->social_vk}", [ 'target' => '_blank' ]);
                                      }
                                  ?>
fbdb1f1c   Yarik   test
58
59
                              </div>
                          </div>
7d705d85   Yarik   test
60
61
62
                          <div class="performance-vacancy-add-favorite">
                              <?php
                                  echo Html::a('', [ '#' ], [
93a7a3c1   Yarik   test
63
                                      'class' => $chat->interlocutor->isBookmarked ? 'artbox_bookmark_remove_performer' : 'artbox_bookmark_add_performer',
7d705d85   Yarik   test
64
65
66
67
                                      'data'  => [ 'id' => $chat->interlocutor->id ],
                                  ]);
                              ?>
                          </div>
fbdb1f1c   Yarik   test
68
                          <div class="cab-mes-read-last-visit">
fbdb1f1c   Yarik   test
69
70
71
72
73
                              <div class="cab-mes-read-min-bl">
                                  <div class="profile-phone-site style">
                                      <div class="style">
                                          <div class="profile-phone">
                                              <img src="/images/sidebar-ico/ico-2.png" alt="">
7d705d85   Yarik   test
74
                                              <span style="font-size: 13px" class="sidebar-views-txt">На сайте: </span><?= $chat->interlocutor->liveTime ?>
fbdb1f1c   Yarik   test
75
76
77
78
79
80
                                          </div>
                                      </div>
                                  </div>
                              </div>
                              <div class="cab-mes-read-min-bl">
                                  <div class="profile-phone-site style">
7d705d85   Yarik   test
81
                                      <?php foreach($phones as $phone): ?>
8c448b56   Administrator   add yii jquery
82
83
84
                                          <div class="style">
                                              <div class="profile-phone">
                                                  <img src="/images/ico-phone.png" alt=""/>
7d705d85   Yarik   test
85
                                                  <span><?= $phone[ 'phone' ] ?></span>
8c448b56   Administrator   add yii jquery
86
                                              </div>
fbdb1f1c   Yarik   test
87
                                          </div>
8c448b56   Administrator   add yii jquery
88
                                      <?php endforeach; ?>
fbdb1f1c   Yarik   test
89
90
91
92
93
94
95
                                  </div>
                              </div>
                              <div class="cab-mes-read-min-bl">
                                  <div class="profile-phone-site style">
                                      <div class="style">
                                          <div class="profile-phone">
                                              <img src="/images/sidebar-ico/ico-3.png" alt="">
7d705d85   Yarik   test
96
97
                                              <span style="font-size: 13px" class="sidebar-views-txt">Последний визит:<br></span>
                                              <p><?= $chat->interlocutor->userInfo->lastVisit ?></p>
fbdb1f1c   Yarik   test
98
99
100
101
102
103
                                          </div>
                                      </div>
                                  </div>
                              </div>
                              <div class="cab-mes-read-min-bl">
                                  <div class="profile-phone-site style">
7d705d85   Yarik   test
104
                                      <?php foreach($sites as $site): ?>
8c448b56   Administrator   add yii jquery
105
106
107
                                          <div class="style">
                                              <div class="profile-site">
                                                  <img src="/images/ico-site.png" alt=""/>
7d705d85   Yarik   test
108
                                                  <a href="http://<?= $site[ 'site' ] ?>" target="_blank">Сайт</a>
8c448b56   Administrator   add yii jquery
109
                                              </div>
fbdb1f1c   Yarik   test
110
                                          </div>
8c448b56   Administrator   add yii jquery
111
                                      <?php endforeach; ?>
fbdb1f1c   Yarik   test
112
113
114
115
116
                                  </div>
                              </div>
                          </div>
                      </div>
                      <div class="cabinet-message-read-wr style">
ad81f227   Виталий   29.12.2016
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
                          <?php
                          if(!empty($chat->messages)) {
                              ?>
                              <div class="comments_block">
                                  <div class="content">
                                      <?php foreach($chat->messages as $message): ?>
  
                                          <?php if($message->isMy()): ?>
                                              <div class="comment right">
                                                  <div class="author_pic"><?= Html::a(Html::img($message->user->minImg($message->user->image, 48, 48)), User::findIdentity($message->user_id)->link, ['target' => '_blank']); ?></div>
                                                  <div class="comment_text">
                                                      <?= $message->text ?>
                                                      <div class="comment_time">
                                                          <?= $message->date ?>
                                                      </div>
6a97773c   Administrator   01.03.16
132
                                                  </div>
ad81f227   Виталий   29.12.2016
133
134
135
136
137
138
139
140
                                                  <?php if($message->filesList): ?>
                                                      <div class="offer_link">
                                                          <?php foreach($message->filesList as $file): ?>
                                                              <?= Html::a($file->name, $file->dir, [ 'target' => '_blank' ]); ?>
                                                          <?php endforeach; ?>
                                                      </div>
                                                  <?php endif; ?>
                                                  <div style="clear:both;"></div>
6a97773c   Administrator   01.03.16
141
                                              </div>
ad81f227   Виталий   29.12.2016
142
143
144
145
146
147
148
149
                                          <?php else: $message->status = $message::READ_MESSAGE; $message->update();?>
                                              <div class="comment left">
                                                  <div class="author_pic"><?= Html::a(Html::img($message->user->minImg($message->user->image, 48, 48)), User::findIdentity($message->user_id)->link, ['target' => '_blank']); ?></div>
                                                  <div class="comment_text">
                                                      <?= $message->text ?>
                                                      <div class="comment_time">
                                                          <?= $message->date ?>
                                                      </div>
6a97773c   Administrator   01.03.16
150
                                                  </div>
ad81f227   Виталий   29.12.2016
151
152
153
154
155
156
157
158
                                                  <?php if($message->filesList): ?>
                                                      <div class="offer_link">
                                                          <?php foreach($message->filesList as $file): ?>
                                                              <?= Html::a($file->name, $file->dir, [ 'target' => '_blank' ]); ?>
                                                          <?php endforeach; ?>
                                                      </div>
                                                  <?php endif; ?>
                                                  <div style="clear:both;"></div>
6a97773c   Administrator   01.03.16
159
                                              </div>
ad81f227   Виталий   29.12.2016
160
161
162
163
                                          <?php endif; ?>
                                      <?php endforeach; ?>
                                      <div style="height:20px;"></div>
                                  </div>
fbdb1f1c   Yarik   test
164
                              </div>
ad81f227   Виталий   29.12.2016
165
166
167
                          <?php
                          }
                          ?>
fbdb1f1c   Yarik   test
168
                          <div class="comment_type">
7d705d85   Yarik   test
169
                              <?php $form = ActiveForm::begin([
93a7a3c1   Yarik   test
170
                                  'method'  => 'post',
7d705d85   Yarik   test
171
172
                                  'options' => [ 'enctype' => 'multipart/form-data' ],
                              ]); ?>
6a97773c   Administrator   01.03.16
173
174
  
                              <?= $form->field(new Message(), 'text')
7d705d85   Yarik   test
175
176
177
178
179
180
181
182
183
                                       ->textarea([ 'class' => 'message_text' ]); ?>
                              <input type="submit" class="send_mess_but" value="Отправить">
                              <div class="inputfile">
                                  <div class="tender-file-wr">
                                      <?= $form->field(new Message(), 'file[]')
                                               ->fileInput([ 'class' => 'multi' ])
                                               ->label(false) ?>
                                      <a href="#" class="addfilemulti">Прикрепить файл</a>
                                      <div class="max-size">Максимальный размер файла 5 МБ</div>
fbdb1f1c   Yarik   test
184
                                  </div>
7d705d85   Yarik   test
185
                              </div>
6a97773c   Administrator   01.03.16
186
                              <?php $form::end(); ?>
fbdb1f1c   Yarik   test
187
188
189
190
191
192
193
194
195
                          </div>
                      </div>
                  </div>
              </div>
  
          </div>
  
      </div>
  </div>