Blame view

frontend/views/search/customer.php 8.72 KB
06b4c223   Administrator   01.03.16
1
  <?php
f94a00a6   Yarik   test
2
3
4
      /**
       * @var CustomerSearch     $model
       * @var ActiveDataProvider $dataProvider
f94a00a6   Yarik   test
5
       */
658a5f37   Yarik   test
6
      use common\models\CustomerSearch;
c0bffebb   Yarik   test
7
      use kartik\select2\Select2;
f94a00a6   Yarik   test
8
9
      use yii\data\ActiveDataProvider;
      use yii\helpers\Html;
90924316   Yarik   test
10
      use yii\jui\SliderInput;
c0bffebb   Yarik   test
11
      use yii\web\JsExpression;
f94a00a6   Yarik   test
12
13
14
      use yii\widgets\ActiveForm;
      use yii\widgets\LinkSorter;
      use yii\widgets\ListView;
658a5f37   Yarik   test
15
  
2fd40ee7   Yarik   test
16
17
18
19
      $sort_array = $dataProvider->sort->getAttributeOrders();
      $active_key = array_keys($sort_array)[ 0 ];
      $active_value = $sort_array[ $active_key ];
      $sort_name = ( ( $active_value == 4 ) ? '-' : '' ) . $active_key;
0dd06a3e   Виталий   tokar commit
20
  ?>
fa403e14   Виталий   tokar commit
21
  <div class="section-box-22 section-box-customer">
0dd06a3e   Виталий   tokar commit
22
23
      <div class="box-wr">
          <div class="box-all">
f94a00a6   Yarik   test
24
              <?php
2fd40ee7   Yarik   test
25
                  // == Left filter ==
f94a00a6   Yarik   test
26
              ?>
0dd06a3e   Виталий   tokar commit
27
              <div class="left-search-work">
f94a00a6   Yarik   test
28
                  <?php
2fd40ee7   Yarik   test
29
30
31
32
33
                      $form = ActiveForm::begin([
                          'method'  => 'get',
                          'options' => [ 'class' => 'search-work-form' ],
                          'action'  => [ '' ],
                      ]);
0dd06a3e   Виталий   tokar commit
34
  
c0bffebb   Yarik   test
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
                      echo $form->field($model, 'city')
                                ->widget(Select2::classname(), [
                                    'options'       => [ 'placeholder' => 'Выбор города ...' ],
                                    'pluginOptions' => [
                                        'allowClear'         => true,
                                        'minimumInputLength' => 3,
                                        'ajax'               => [
                                            'url'      => \yii\helpers\Url::to([ 'site/city' ]),
                                            'dataType' => 'json',
                                            'data'     => new JsExpression('function(params) { return {q:params.term}; }'),
                                        ],
                                        'escapeMarkup'       => new JsExpression('function (markup) { return markup; }'),
                                        'templateResult'     => new JsExpression('function(city) { return city.text; }'),
                                        'templateSelection'  => new JsExpression('function (city) { return city.text; }'),
                                    ],
                                ]);
0dd06a3e   Виталий   tokar commit
51
  
f94a00a6   Yarik   test
52
53
54
55
56
57
58
59
60
61
62
                      echo $form->field($model, 'type', [
                          'options'  => [
                              'class' => 'blocks-check-list-wrapp',
                          ],
                          'template' => "<div class='blocks-check-title'>{label}</div>\n{input}<div class='select-after'></div>\n{hint}\n{error}",
                      ])
                                ->dropDownList([
                                    1 => 'Физическое лицо',
                                    2 => 'Компания',
                                ], [ 'prompt' => 'Любой' ]);
                  ?>
2fd40ee7   Yarik   test
63
                  <div class="blocks-check-list-wrapp">
90924316   Yarik   test
64
65
66
                      <div id="slider-value"></div>
                      <?php
                          echo $form->field($model, 'rating', [
c0bffebb   Yarik   test
67
68
69
70
                              'template'     => "{label}<br><div id='{$form->id}-rating'>{$model->rating}</div><br>{input}\n{hint}\n{error}",
                              'labelOptions' => [
                                  'class' => 'blocks-check-title',
                              ],
90924316   Yarik   test
71
72
73
74
75
76
77
78
                          ])
                                    ->widget(SliderInput::className(), [
                                        'clientOptions' => [
                                            'min'  => 0,
                                            'max'  => 5,
                                            'step' => 0.5,
                                        ],
                                        'clientEvents'  => [
c0bffebb   Yarik   test
79
                                            'slide' => "function( event, ui ) {
90924316   Yarik   test
80
81
82
83
84
85
86
                                           $( '#{$form->id}-rating' ).text(ui.value);
                                           $('input[name=\"{$model->formName()}[rating]\"]').val(ui.value);
  
                                       }",
                                        ],
                                    ]);
                      ?>
2fd40ee7   Yarik   test
87
                  </div>
0dd06a3e   Виталий   tokar commit
88
  
f94a00a6   Yarik   test
89
90
91
92
93
94
95
96
97
98
99
100
                  <?php
                      echo $form->field($model, 'online', [
                          'options'  => [
                              'class' => 'blocks-check-list-wrapp',
                          ],
                          'template' => "<div class='blocks-check-title'>{label}</div>\n{input}\n{hint}\n{error}",
                      ])
                                ->radioList([
                                    '' => 'Все',
                                    1  => 'Онлайн',
                                ], [
                                    'item'     => function($index, $label, $name, $checked, $value) use ($model) {
2fd40ee7   Yarik   test
101
102
                                        $checked = ( $model->online == $value );
                                        return "<div class='blocks-check-list'><input type='radio' id='{$model->formName()}-{$index}' name='{$name}' class='check-search' value='{$value}' " . ( $checked ? 'checked' : '' ) . "><label for='{$model->formName()}-{$index}'><span></span>{$label}</label></div>";
f94a00a6   Yarik   test
103
104
105
                                    },
                                    'unselect' => NULL,
                                ]);
0dd06a3e   Виталий   tokar commit
106
  
2fd40ee7   Yarik   test
107
                      echo '<div class="blocks-check-list-submit">' . Html::submitInput('Найти') . '</div>';
f94a00a6   Yarik   test
108
109
110
  
                      $form->end();
                  ?>
fa403e14   Виталий   tokar commit
111
                  <script>
f94a00a6   Yarik   test
112
113
                      $('div.rating').rating(
                          {
2fd40ee7   Yarik   test
114
                              fx : 'full',
f94a00a6   Yarik   test
115
116
                          }
                      );
fa403e14   Виталий   tokar commit
117
                  </script>
0dd06a3e   Виталий   tokar commit
118
119
              </div>
  
f94a00a6   Yarik   test
120
              <?php
2fd40ee7   Yarik   test
121
                  // == End of left filter ==
f94a00a6   Yarik   test
122
123
124
              ?>
  
              <?php
2fd40ee7   Yarik   test
125
                  // == Page content ==
f94a00a6   Yarik   test
126
              ?>
0dd06a3e   Виталий   tokar commit
127
128
              <div class="right-search-work">
                  <div class="search-worker-title style">Найти заказчика</div>
f94a00a6   Yarik   test
129
130
                  <div class="search-worker-title-two style">Заказчики готовые приступить к работе
                      <span><?= $dataProvider->totalCount ?></span></div>
0dd06a3e   Виталий   tokar commit
131
                  <div class="search-worker-search-wr style">
f94a00a6   Yarik   test
132
                      <?php
2fd40ee7   Yarik   test
133
134
135
136
137
                          $form2 = ActiveForm::begin([
                              'method'  => 'get',
                              'action'  => [ '' ],
                              'options' => [ 'class' => 'search-worker-form' ],
                          ]);
616c8534   Yarik   test
138
                          echo $form2->field($model, 'info', [ 'options' => [ 'tag' => 'span' ] ])
2fd40ee7   Yarik   test
139
140
                                     ->label(false)
                                     ->textInput([ 'placeholder' => $model->getAttributeLabel('info') ]);
f94a00a6   Yarik   test
141
                          echo Html::submitInput('Найти');
2fd40ee7   Yarik   test
142
                          $form2->end();
f94a00a6   Yarik   test
143
                      ?>
0dd06a3e   Виталий   tokar commit
144
145
146
147
148
                      <a href="#" class="add-to-catalog-search-worker">Добавить себя в каталог</a>
                      <div class="search-worker-sort-wr style">
                          <div class="search-worker-sort">Сортировать:&nbsp;</div>
                          <ul>
                              <li class="activejob">
2fd40ee7   Yarik   test
149
                                  <a href="#" data-sort-name="<?= $sort_name ?>"></a>
0dd06a3e   Виталий   tokar commit
150
                                  <div class="sidebar-droped-wr style">
f94a00a6   Yarik   test
151
152
153
154
155
                                      <?php
                                          echo LinkSorter::widget([
                                              'sort' => $dataProvider->sort,
                                          ]);
                                      ?>
0dd06a3e   Виталий   tokar commit
156
157
158
159
160
                                  </div>
                              </li>
                          </ul>
                      </div>
                  </div>
f94a00a6   Yarik   test
161
                  <?php
2fd40ee7   Yarik   test
162
163
164
165
166
167
168
169
170
171
172
                      echo ListView::widget([
                          'dataProvider' => $dataProvider,
                          'layout'       => "{items}\n{pager}",
                          'options'      => [
                              'class' => 'search-worker-blocks-wr style',
                          ],
                          'itemOptions'  => [
                              'class' => 'search-worker-blocks',
                          ],
                          'itemView'     => '_customer_list_view',
                      ]);
f94a00a6   Yarik   test
173
                  ?>
4ed1f788   Yarik   test
174
  
fa403e14   Виталий   tokar commit
175
                  <script>
f94a00a6   Yarik   test
176
177
178
179
180
                      $('div.rating_search_performer').rating(
                          {
                              fx : 'full', readOnly : 'true', url : 'rating.php'
                          }
                      );
fa403e14   Виталий   tokar commit
181
                  </script>
0dd06a3e   Виталий   tokar commit
182
              </div>
f94a00a6   Yarik   test
183
              <?php
2fd40ee7   Yarik   test
184
                  // == End of page content ==
f94a00a6   Yarik   test
185
              ?>
0dd06a3e   Виталий   tokar commit
186
187
188
          </div>
      </div>
  </div>