Blame view

views/order/_form.php 24.1 KB
e0906f08   Alexey Boroda   -Fixing existing ...
1
2
  <?php
      
bb962a6d   Alexey Boroda   -Order in process
3
      use artweb\artbox\ecommerce\models\Label;
e0906f08   Alexey Boroda   -Fixing existing ...
4
      use artweb\artbox\ecommerce\models\Order;
30b799f2   Alexey Boroda   -Order in process 2
5
      use artweb\artbox\ecommerce\models\OrderPayment;
2ad65823   Alexey Boroda   -Added date range...
6
      use artweb\artbox\ecommerce\models\OrderProduct;
01185786   Alexey Boroda   -Sms in process
7
      use backend\models\SmsTemplate;
d57c8c00   Alexey Boroda   -Blocking in process
8
      use common\models\User;
7520dc0e   Alexey Boroda   -Grid with input ...
9
      use kartik\grid\GridView;
bb962a6d   Alexey Boroda   -Order in process
10
      use kartik\widgets\DatePicker;
2ad65823   Alexey Boroda   -Added date range...
11
      use kartik\widgets\Select2;
bb962a6d   Alexey Boroda   -Order in process
12
      use kartik\widgets\SwitchInput;
7520dc0e   Alexey Boroda   -Grid with input ...
13
      use yii\data\ActiveDataProvider;
e0906f08   Alexey Boroda   -Fixing existing ...
14
15
      use yii\helpers\Html;
      use yii\bootstrap\ActiveForm;
6f14188b   Alexey Boroda   -Product card fixed
16
17
      use yii\helpers\ArrayHelper;
      use artweb\artbox\ecommerce\models\Delivery;
7520dc0e   Alexey Boroda   -Grid with input ...
18
      use yii\web\View;
2ad65823   Alexey Boroda   -Added date range...
19
      use yii\web\JsExpression;
e0906f08   Alexey Boroda   -Fixing existing ...
20
      
7520dc0e   Alexey Boroda   -Grid with input ...
21
22
23
24
25
      /**
       * @var View               $this
       * @var Order              $model
       * @var ActiveForm         $form
       * @var ActiveDataProvider $dataProvider
28b51b30   Alexey Boroda   -Order module bug...
26
       * @var User               $user
7520dc0e   Alexey Boroda   -Grid with input ...
27
       */
2ad65823   Alexey Boroda   -Added date range...
28
      
28b51b30   Alexey Boroda   -Order module bug...
29
30
      $user = \Yii::$app->user->identity;
      
2ad65823   Alexey Boroda   -Added date range...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
      $js = <<< JS
  $(document).on('submit', '#add-product-form', function(e) {
      e.preventDefault();
      var addFormData = $(this).serializeArray();
      var addFormAction = this.action;
      $.ajax({
          url: addFormAction,
          type: "POST",
          data: addFormData,
          success: function (data) {
               if (data.status === "success") {
                   $.pjax.reload({container:"#order-products-grid"});  //Reload GridView
               }
          },
          error: function () {
          }
      });
  });
  JS;
      
      $this->registerJs($js, View::POS_READY);
bb962a6d   Alexey Boroda   -Order in process
52
53
54
55
56
57
58
59
      
      $js = <<< JS
  $('#order-phone, #order-phone2').mask('+38(000)000-00-00', {
      placeholder: '+38(___)___-__-__'
  });
  JS;
      
      $this->registerJs($js, View::POS_READY);
01185786   Alexey Boroda   -Sms in process
60
61
62
63
      
      $js = <<< JS
  $(document).on('change', '#sms-template-selector', function(event) {
      var text = $('#select2-sms-template-selector-container').attr('title');
db3040d3   Alexey Boroda   -Order module alm...
64
65
66
67
68
      var val = $('option:contains(' + text + ')').attr('value');
      $('#sms-text-area').val(val);
  });
  
  $(document).on('click', '#send-sms-action', function(event) {
b0c7d586   Alexey Boroda   -Bykov fixes
69
70
71
72
73
74
75
76
      var variant = $('input[name=send-phone]:checked').val();
      var content = $('#sms-text-area').val();
      if (variant == 1) {
          var phone = $('input#order-phone').val();    
      } else if (variant == 2) {
          var phone = $('input#order-phone2').val();    
      }
      console.log(phone);
db3040d3   Alexey Boroda   -Order module alm...
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
      $.ajax({
          url: "/admin/ecommerce/order/send-sms",
          method: "POST",
          data: { 
              phone: phone,
              content: content
           },
          success: function(data) {
            console.log(data);
            var newButton = document.createElement('button');
            newButton.classList.add('btn', 'btn-default');
            newButton.innerText = 'Отправлено';
            var current = document.getElementById("send-sms-action");
            var parentDiv = current.parentNode;
            parentDiv.replaceChild(newButton, current);
          }
      });
01185786   Alexey Boroda   -Sms in process
94
95
96
97
  });
  JS;
      
      $this->registerJs($js, View::POS_READY);
b0c7d586   Alexey Boroda   -Bykov fixes
98
99
100
      
      $js = <<< JS
  $(document).on('click', '#page-submit', function() {
f36d238b   Alexey Boroda   -Order publish fi...
101
102
103
104
105
106
107
108
109
110
111
112
    $.ajax({
      url: "/admin/ecommerce/order/publish-order",
      type: "GET",
      data: {
          id: {$model->id}
      },
      success: function (data) {
      
      },
      error: function () {
      }
    });
b0c7d586   Alexey Boroda   -Bykov fixes
113
114
115
116
117
118
    $('#main-form').trigger('submit');
  });
  JS;
      
      $this->registerJs($js, View::POS_READY);
  
e0906f08   Alexey Boroda   -Fixing existing ...
119
120
  ?>
  
b0c7d586   Alexey Boroda   -Bykov fixes
121
  <?php $form = ActiveForm::begin([ 'id' => 'main-form' ]); ?>
6f14188b   Alexey Boroda   -Product card fixed
122
  <div class="container">
eb15a89c   Alexey Boroda   -Dancing with com...
123
      <div class="form-group">
db3040d3   Alexey Boroda   -Order module alm...
124
          <br>
eb15a89c   Alexey Boroda   -Dancing with com...
125
126
          <div class="row">
              <div class="col-sm-6">
bb962a6d   Alexey Boroda   -Order in process
127
                  
eb15a89c   Alexey Boroda   -Dancing with com...
128
129
130
131
132
133
134
135
136
                  <?= $form->field($model, 'deadline')
                           ->widget(
                               DatePicker::className(),
                               [
                      
                               ]
                           ) ?>
                  
                  <?php
28b51b30   Alexey Boroda   -Order module bug...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                      if ($user->isAdmin()) {
                          echo $form->field($model, 'pay')
                                    ->widget(
                                        SwitchInput::className(),
                                        [
                                            'name'          => 'pay',
                                            'pluginOptions' => [
                                                'onText'  => \Yii::t('app', 'Оплачено'),
                                                'offText' => \Yii::t('app', 'Не оплачено'),
                                            ],
                                        ]
                                    );
                      }
                  ?>
eb15a89c   Alexey Boroda   -Dancing with com...
151
152
153
                  
                  <?= $form->field($model, 'reason')
                           ->dropDownList(
db3040d3   Alexey Boroda   -Order module alm...
154
                               Order::REASONS,
eb15a89c   Alexey Boroda   -Dancing with com...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
                               [ 'prompt' => 'Выберите причину' ]
                           ) ?>
                  
                  <?= $form->field($model, 'label')
                           ->dropDownList(
                               ArrayHelper::map(
                                   Label::find()
                                        ->asArray()
                                        ->all(),
                                   'id',
                                   'label'
                               ),
                               [ 'prompt' => 'Выберите метку' ]
                           ); ?>
                  
                  <?= $form->field($model, 'name') ?>
                  
28b51b30   Alexey Boroda   -Order module bug...
172
173
                  <?= $form->field($model, 'phone')
                           ->textInput([ 'readonly' => $user->isAdmin() ? false : true ]) ?>
eb15a89c   Alexey Boroda   -Dancing with com...
174
175
176
                  
                  <?= $form->field($model, 'phone2') ?>
                  
28b51b30   Alexey Boroda   -Order module bug...
177
178
                  <?= $form->field($model, 'email')
                           ->textInput([ 'readonly' => $user->isAdmin() ? false : true ]) ?>
eb15a89c   Alexey Boroda   -Dancing with com...
179
180
181
182
183
184
185
186
187
188
189
190
191
                  
                  <?= $form->field(
                      $model,
                      'numbercard'
                  )
                           ->textInput([ 'readonly' => true ]) ?>
                  
                  <?= $form->field($model, 'comment')
                           ->textarea([ 'rows' => '3' ]) ?>
                  <?= $form->field($model, 'delivery')
                           ->dropDownList(
                               ArrayHelper::map(
                                   Delivery::find()
30b799f2   Alexey Boroda   -Order in process 2
192
                                           ->joinWith('lang')
30b799f2   Alexey Boroda   -Order in process 2
193
194
                                           ->asArray()
                                           ->all(),
eb15a89c   Alexey Boroda   -Dancing with com...
195
196
197
198
199
                                   'id',
                                   'lang.title'
                               ),
                               [ 'prompt' => \Yii::t('app', 'Выберите доставку ...') ]
                           ) ?>
3e703aac   Alexey Boroda   -Order form fixes
200
                  
d57c8c00   Alexey Boroda   -Blocking in process
201
                  <?php
e861ae92   Alexey Boroda   -Add column to pa...
202
                      
28b51b30   Alexey Boroda   -Order module bug...
203
                      if ($user->isAdmin()) {
d57c8c00   Alexey Boroda   -Blocking in process
204
205
206
207
208
209
210
211
212
213
                          echo $form->field($model, 'manager_id')
                                    ->dropDownList(
                                        ArrayHelper::map(
                                            User::find()
                                                ->asArray()
                                                ->all(),
                                            'id',
                                            'username'
                                        ),
                                        [ 'prompt' => \Yii::t('app', 'Менеджер') ]
3e703aac   Alexey Boroda   -Order form fixes
214
215
                                    );
                      }
d57c8c00   Alexey Boroda   -Blocking in process
216
                  ?>
e861ae92   Alexey Boroda   -Add column to pa...
217
                  
3e703aac   Alexey Boroda   -Order form fixes
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
248
249
250
251
                  <h2><?php echo \Yii::t('app', 'Отправить смс'); ?></h2>
                  <?php
                      echo Select2::widget(
                          [
                              'id'            => 'sms-template-selector',
                              'name'          => 'select-sms-template',
                              'data'          => ArrayHelper::map(
                                  SmsTemplate::find()
                                             ->asArray()
                                             ->all(),
                                  'text',
                                  'title'
                              ),
                              'options'       => [ 'placeholder' => \Yii::t('app', 'Выберите шаблон') ],
                              'pluginOptions' => [
                                  'allowClear' => true,
                              ],
                          ]
                      );
                  
                  ?>
                  <br>
                  <?php
                      echo Html::textarea(
                          'sms-text',
                          '',
                          [
                              'rows'  => 3,
                              'id'    => 'sms-text-area',
                              'class' => 'form-control',
                          ]
                      );
                  ?>
                  <br>
b0c7d586   Alexey Boroda   -Bykov fixes
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
                  <div class="row">
                      <div class="col-md-6">
                          <?php
                              if ($model->isNewRecord) {
                                  echo Html::button(
                                      \Yii::t('app', 'Отправить'),
                                      [
                                          'class' => 'btn btn-warning disabled',
                                      ]
                                  );
                              } else {
                                  echo Html::button(
                                      \Yii::t('app', 'Отправить'),
                                      [
                                          'class' => 'btn btn-warning',
                                          'id'    => 'send-sms-action',
                                      ]
                                  );
                              }
                          ?>
                      </div>
                      <div class="col-md-6">
                          <?php
                              echo Html::radioList(
                                  'send-phone',
                                  '1',
                                  [
                                      '1' => 'Первый номер',
                                      '2' => 'Второй номер',
                                  ]
                              );
                          ?>
                      </div>
                  </div>
3e703aac   Alexey Boroda   -Order form fixes
286
              
eb15a89c   Alexey Boroda   -Dancing with com...
287
288
289
290
291
292
293
294
295
296
297
298
299
              </div>
              <div class="col-sm-6">
                  
                  <?= $form->field($model, 'declaration') ?>
                  
                  <?= $form->field($model, 'stock') ?>
                  
                  <?= $form->field($model, 'consignment') ?>
                  
                  <?= $form->field($model, 'payment')
                           ->dropDownList(
                               ArrayHelper::map(
                                   OrderPayment::find()
eb15a89c   Alexey Boroda   -Dancing with com...
300
301
302
303
                                               ->where([ 'status' => OrderPayment::ACTIVE ])
                                               ->asArray()
                                               ->all(),
                                   'id',
3e703aac   Alexey Boroda   -Order form fixes
304
                                   'short'
eb15a89c   Alexey Boroda   -Dancing with com...
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
                               ),
                               [ 'prompt' => 'Способ оплаты ...' ]
                           ); ?>
                  
                  <?= $form->field($model, 'insurance') ?>
                  
                  <?= $form->field($model, 'amount_imposed') ?>
                  
                  <?= $form->field($model, 'shipping_by')
                           ->dropDownList(
                               ArrayHelper::getColumn(Order::SHIPPING_BY, 'label'),
                               [ 'prompt' => 'Оплата доставки ...' ]
                           ); ?>
                  
                  <?= $form->field($model, 'city') ?>
                  
                  <?= $form->field($model, 'adress') ?>
                  
                  <?= $form->field($model, 'body')
                           ->textarea([ 'rows' => '3' ]) ?>
                  
                  <?= $form->field($model, 'check') ?>
                  
                  <?= $form->field($model, 'sms') ?>
28b51b30   Alexey Boroda   -Order module bug...
329
330
                  
                  <?= $form->field($model, 'delivery_cost') ?>
6f14188b   Alexey Boroda   -Product card fixed
331
              
eb15a89c   Alexey Boroda   -Dancing with com...
332
              </div>
6f14188b   Alexey Boroda   -Product card fixed
333
          </div>
e0906f08   Alexey Boroda   -Fixing existing ...
334
      </div>
e0906f08   Alexey Boroda   -Fixing existing ...
335
  </div>
2ad65823   Alexey Boroda   -Added date range...
336
  
e861ae92   Alexey Boroda   -Add column to pa...
337
338
339
  <?php ActiveForm::end(); ?>
  <br>
  <br>
7520dc0e   Alexey Boroda   -Grid with input ...
340
341
342
343
344
345
  <div class="container">
      <div class="row">
          <?php
              echo GridView::widget(
                  [
                      'dataProvider' => $dataProvider,
28b51b30   Alexey Boroda   -Order module bug...
346
347
348
349
350
351
352
                      'rowOptions'   => function($model) {
                          if ($model->removed) {
                              return [ 'class' => 'danger' ];
                          } else {
                              return [];
                          }
                      },
bb962a6d   Alexey Boroda   -Order in process
353
                      'layout'       => '{items}{pager}',
7520dc0e   Alexey Boroda   -Grid with input ...
354
355
                      'columns'      => [
                          'id',
7520dc0e   Alexey Boroda   -Grid with input ...
356
                          'sku',
01185786   Alexey Boroda   -Sms in process
357
358
359
360
                          'product_name',
                          'productVariant.product.brand.lang.title',
                          'productVariant.lang.title',
                          'price',
7520dc0e   Alexey Boroda   -Grid with input ...
361
362
363
364
                          [
                              'class'           => 'kartik\grid\EditableColumn',
                              'attribute'       => 'count',
                              'editableOptions' => [
01185786   Alexey Boroda   -Sms in process
365
366
367
                                  'header'       => \Yii::t('app', 'Количество'),
                                  'inputType'    => kartik\editable\Editable::INPUT_SPIN,
                                  'options'      => [
7520dc0e   Alexey Boroda   -Grid with input ...
368
369
370
371
372
                                      'pluginOptions' => [
                                          'min' => 0,
                                          'max' => 5000,
                                      ],
                                  ],
01185786   Alexey Boroda   -Sms in process
373
374
375
                                  'pluginEvents' => [
                                      'editableSuccess' => 'function(event) { $.pjax.reload({container:"#order-products-grid"}); }',
                                  ],
7520dc0e   Alexey Boroda   -Grid with input ...
376
                              ],
7520dc0e   Alexey Boroda   -Grid with input ...
377
378
                              'format'          => [
                                  'decimal',
2ad65823   Alexey Boroda   -Added date range...
379
                                  0,
7520dc0e   Alexey Boroda   -Grid with input ...
380
                              ],
2ad65823   Alexey Boroda   -Added date range...
381
                              'pageSummary'     => false,
7520dc0e   Alexey Boroda   -Grid with input ...
382
                          ],
01185786   Alexey Boroda   -Sms in process
383
                          'sum_cost',
7520dc0e   Alexey Boroda   -Grid with input ...
384
                          [
0893579c   Alexey Boroda   -Bug fixed
385
386
387
                              'class'           => 'kartik\grid\EditableColumn',
                              'attribute'       => 'booking',
                              'editableOptions' => [
28b51b30   Alexey Boroda   -Order module bug...
388
389
390
391
                                  'header'       => \Yii::t('app', 'Бронь'),
                                  'inputType'    => kartik\editable\Editable::INPUT_TEXT,
                                  'options'      => [
                                      'class'         => 'booking-typeahead',
0893579c   Alexey Boroda   -Bug fixed
392
393
394
395
396
                                      'pluginOptions' => [
                                          'min' => 0,
                                          'max' => 20,
                                      ],
                                  ],
53c12653   Alexey Boroda   -Stattus and book...
397
398
399
                                  'pluginEvents' => [
                                      'editableSuccess' => 'function(event) { $.pjax.reload({container:"#order-products-grid"}); }',
                                  ],
0893579c   Alexey Boroda   -Bug fixed
400
401
402
403
404
405
406
407
408
409
                              ],
                              'format'          => [
                                  'text',
                              ],
                              'pageSummary'     => false,
                          ],
                          [
                              'class'           => 'kartik\grid\EditableColumn',
                              'attribute'       => 'status',
                              'editableOptions' => [
28b51b30   Alexey Boroda   -Order module bug...
410
411
412
413
                                  'header'       => \Yii::t('app', 'Статус'),
                                  'inputType'    => kartik\editable\Editable::INPUT_TEXT,
                                  'options'      => [
                                      'class'         => 'status-typeahead',
0893579c   Alexey Boroda   -Bug fixed
414
415
416
417
418
                                      'pluginOptions' => [
                                          'min' => 0,
                                          'max' => 20,
                                      ],
                                  ],
53c12653   Alexey Boroda   -Stattus and book...
419
420
421
                                  'pluginEvents' => [
                                      'editableSuccess' => 'function(event) { $.pjax.reload({container:"#order-products-grid"}); }',
                                  ],
0893579c   Alexey Boroda   -Bug fixed
422
423
424
425
426
427
                              ],
                              'format'          => [
                                  'text',
                              ],
                              'pageSummary'     => false,
                          ],
db3040d3   Alexey Boroda   -Order module alm...
428
429
430
431
                          [
                              'class'           => 'kartik\grid\EditableColumn',
                              'attribute'       => 'return',
                              'editableOptions' => [
3e703aac   Alexey Boroda   -Order form fixes
432
433
434
                                  'header'    => \Yii::t('app', 'Возврат'),
                                  'inputType' => kartik\editable\Editable::INPUT_CHECKBOX,
                                  'options'   => [],
8a5570d6   Alexey Boroda   -yes/no fix
435
436
437
                                  'pluginEvents' => [
                                      'editableSuccess' => 'function(event) { $.pjax.reload({container:"#order-products-grid"}); }',
                                  ],
db3040d3   Alexey Boroda   -Order module alm...
438
439
440
441
442
443
                              ],
                              'format'          => [
                                  'boolean',
                              ],
                              'pageSummary'     => false,
                          ],
0893579c   Alexey Boroda   -Bug fixed
444
                          [
2ad65823   Alexey Boroda   -Added date range...
445
                              'class'    => 'yii\grid\ActionColumn',
7520dc0e   Alexey Boroda   -Grid with input ...
446
                              'template' => '{delete}',
3e703aac   Alexey Boroda   -Order form fixes
447
448
                              'buttons'  => [
                                  'delete' => function($url, $model) {
28b51b30   Alexey Boroda   -Order module bug...
449
450
451
452
453
454
455
456
                                      if ($model->removed) {
                                          return '';
                                      } else {
                                          return Html::a(
                                              Html::tag('span', '', [ 'class' => 'glyphicon glyphicon-trash' ]),
                                              [
                                                  'delete-product',
                                                  'id' => $model->id,
3e703aac   Alexey Boroda   -Order form fixes
457
                                              ],
28b51b30   Alexey Boroda   -Order module bug...
458
459
460
461
462
463
464
465
                                              [
                                                  'data' => [
                                                      'confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                                                      'method'  => 'POST',
                                                  ],
                                              ]
                                          );
                                      }
3e703aac   Alexey Boroda   -Order form fixes
466
467
                                  },
                              ],
7520dc0e   Alexey Boroda   -Grid with input ...
468
469
470
471
                          ],
                      ],
                      'responsive'   => true,
                      'hover'        => true,
2ad65823   Alexey Boroda   -Added date range...
472
473
474
475
                      'pjax'         => true,
                      'pjaxSettings' => [
                          'options' => [
                              'scrollTo' => 'false',
bb962a6d   Alexey Boroda   -Order in process
476
                              'id'       => 'order-products-grid',
2ad65823   Alexey Boroda   -Added date range...
477
478
                          ],
                      ],
7520dc0e   Alexey Boroda   -Grid with input ...
479
480
481
                  ]
              );
          ?>
6f14188b   Alexey Boroda   -Product card fixed
482
      </div>
e0906f08   Alexey Boroda   -Fixing existing ...
483
  </div>
e0906f08   Alexey Boroda   -Fixing existing ...
484
  
2ad65823   Alexey Boroda   -Added date range...
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
  <div class="container">
      <div class="row">
          <?php $newProductForm = ActiveForm::begin(
              [
                  'action' => yii\helpers\Url::to([ 'add' ]),
                  'id'     => 'add-product-form',
              ]
          );
              $newOrderProduct = new OrderProduct();
          ?>
          <div class="col-md-8">
              <?php echo $newProductForm->field($newOrderProduct, 'id')
                                        ->widget(
                                            Select2::className(),
                                            [
                                                'options'       => [ 'placeholder' => 'Search for a product ...' ],
                                                'pluginOptions' => [
                                                    'allowClear'         => true,
bb962a6d   Alexey Boroda   -Order in process
503
                                                    'disabled'           => $model->isNewRecord ? true : false,
2ad65823   Alexey Boroda   -Added date range...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
                                                    'minimumInputLength' => 3,
                                                    'language'           => [
                                                        'errorLoading' => new JsExpression(
                                                            "function () { return 'Waiting for results...'; }"
                                                        ),
                                                    ],
                                                    'ajax'               => [
                                                        'url'      => \yii\helpers\Url::to([ 'find-product' ]),
                                                        'dataType' => 'json',
                                                        'data'     => new JsExpression(
                                                            'function(params) { return {q:params.term}; }'
                                                        ),
                                                    ],
                                                    'escapeMarkup'       => new JsExpression(
                                                        'function (markup) { return markup; }'
                                                    ),
                                                    'templateResult'     => new JsExpression(
                                                        'function(data) { return data.sku; }'
                                                    ),
                                                    'templateSelection'  => new JsExpression(
                                                        'function (data) { return data.sku; }'
                                                    ),
                                                ],
                                            ]
                                        );
              
              ?>
          </div>
          <div class="col-md-2">
db3040d3   Alexey Boroda   -Order module alm...
533
534
535
536
537
538
539
540
541
542
              <?php echo $newProductForm->field(
                  $newOrderProduct,
                  'count'
              )
                                        ->input(
                                            'number',
                                            [
                                                'disabled' => $model->isNewRecord ? true : false,
                                            ]
                                        ); ?>
2ad65823   Alexey Boroda   -Added date range...
543
          </div>
db3040d3   Alexey Boroda   -Order module alm...
544
          <div class="col-md-2" style="margin-top: 23px">
2ad65823   Alexey Boroda   -Added date range...
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
              <?php echo Html::submitButton(
                  'Add',
                  [
                      'class' => $model->isNewRecord ? 'btn btn-primary disabled' : 'btn btn-primary',
                  ]
              ) ?>
          </div>
          <?php echo $newProductForm->field($newOrderProduct, 'order_id')
                                    ->hiddenInput(
                                        [
                                            'value' => $model->id,
                                        ]
                                    )
                                    ->label(false) ?>
          <?php ActiveForm::end(); ?>
      </div>
b0c7d586   Alexey Boroda   -Bykov fixes
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
      
      <br>
      <div class="row">
          <?= Html::button(
              $model->isNewRecord ? \Yii::t('app', 'Создать') : \Yii::t('app', 'Сохранить'),
              [
                  'class' => $model->isNewRecord ? 'btn btn-success btn-lg' : 'btn btn-primary btn-lg',
                  'id'    => 'page-submit',
              ]
          ) ?>
          <?= Html::a(
              \Yii::t('app', 'Печать'),
              yii\helpers\Url::to(
                  [
                      'order/print',
                      'order_id' => $model->id,
                  ]
              ),
              [
                  'class'  => $model->isNewRecord ? 'btn btn-info disabled btn-lg' : 'btn btn-info btn-lg',
                  'target' => '_blank',
              ]
          ) ?>
          <?= Html::a(
              \Yii::t('app', 'Выйти'),
              yii\helpers\Url::to(
                  [
                      'exit-order',
                      'id' => $model->id,
                  ]
              ),
              [
                  'class' => $model->isNewRecord ? 'btn btn-info disabled btn-lg' : 'btn btn-info btn-lg',
              ]
          ) ?>
      </div>
  
2ad65823   Alexey Boroda   -Added date range...
598
  </div>
01185786   Alexey Boroda   -Sms in process
599
600
  <br>
  <br>