Blame view

views/order/update.php 1.65 KB
e0906f08   Alexey Boroda   -Fixing existing ...
1
  <?php
6f14188b   Alexey Boroda   -Product card fixed
2
      /**
7520dc0e   Alexey Boroda   -Grid with input ...
3
4
5
       * @var Order              $model
       * @var View               $this
       * @var ActiveDataProvider $dataProvider
6f14188b   Alexey Boroda   -Product card fixed
6
7
8
       */
      
      use artweb\artbox\ecommerce\models\Order;
7520dc0e   Alexey Boroda   -Grid with input ...
9
      use yii\data\ActiveDataProvider;
e0906f08   Alexey Boroda   -Fixing existing ...
10
      use yii\helpers\Html;
6f14188b   Alexey Boroda   -Product card fixed
11
      use yii\web\View;
e0906f08   Alexey Boroda   -Fixing existing ...
12
      
7520dc0e   Alexey Boroda   -Grid with input ...
13
      $this->title = 'Заказ #' . $model->id;
db3040d3   Alexey Boroda   -Order module alm...
14
15
16
17
      $this->params[ 'breadcrumbs' ][] = [
          'url'   => yii\helpers\Url::to([ '/ecommerce/order/index' ]),
          'label' => \Yii::t('app', 'Заказы'),
      ];
e0906f08   Alexey Boroda   -Fixing existing ...
18
      $this->params[ 'breadcrumbs' ][] = $this->title;
d57c8c00   Alexey Boroda   -Blocking in process
19
20
21
22
23
24
25
26
      
      $js = '
  $.ajax({
    type: "POST",
    url: "/admin/ecommerce/order/block-order",
    data: {
      id: ' . $model->id . '
    },
99de237f   Alexey Boroda   -Order block core...
27
    success: function(data) {
b0c7d586   Alexey Boroda   -Bykov fixes
28
29
30
31
    var message = data.time;
    if (data.user != "") {
      message += "  " + data.user;
    }
3bb55546   Alexey Boroda   -Fixing bugs
32
    $.notify({
b0c7d586   Alexey Boroda   -Bykov fixes
33
  	message:  message
3bb55546   Alexey Boroda   -Fixing bugs
34
          },{
99de237f   Alexey Boroda   -Order block core...
35
  	type: "info"
3bb55546   Alexey Boroda   -Fixing bugs
36
      });
d57c8c00   Alexey Boroda   -Blocking in process
37
38
    }
  });';
deaedeb0   Alexey Boroda   -Order module tas...
39
      
d57c8c00   Alexey Boroda   -Blocking in process
40
41
      $this->registerJs($js, View::POS_READY);
      
b0c7d586   Alexey Boroda   -Bykov fixes
42
43
44
      $js = '
      window.onbeforeunload = function(e) {
          $.ajax({
793ad526   Alexey Boroda   -Brain fuck! with...
45
              type: "POST",
b0c7d586   Alexey Boroda   -Bykov fixes
46
47
48
49
50
              url: "/admin/ecommerce/order/exit-order",
              data: {
                  id: ' . $model->id . ',
              },
              success: function() {
b0c7d586   Alexey Boroda   -Bykov fixes
51
52
53
54
55
56
              }
          });
  };
  ';
      
      $this->registerJs($js, View::POS_READY);
deaedeb0   Alexey Boroda   -Order module tas...
57
  
e0906f08   Alexey Boroda   -Fixing existing ...
58
  ?>
6f14188b   Alexey Boroda   -Product card fixed
59
  <div class="order-update">
deaedeb0   Alexey Boroda   -Order module tas...
60
61
62
63
64
65
    <div class="container">
      <h1><?php echo Html::encode($this->title) ?> | <?php echo date(
              'd-m-Y G:i',
              $model->created_at
          ); ?> | <?php echo $model->manager->username; ?></h1>
    </div>
e0906f08   Alexey Boroda   -Fixing existing ...
66
      
6f14188b   Alexey Boroda   -Product card fixed
67
68
      <?= $this->render(
          '_form',
e0906f08   Alexey Boroda   -Fixing existing ...
69
          [
7520dc0e   Alexey Boroda   -Grid with input ...
70
71
              'model'        => $model,
              'dataProvider' => $dataProvider,
e0906f08   Alexey Boroda   -Fixing existing ...
72
73
          ]
      ) ?>
6f14188b   Alexey Boroda   -Product card fixed
74
  </div>