Blame view

backend/views/unload/index.php 2.68 KB
950817c6   Alex Savenko   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  <?php
      
      use yii\helpers\Html;
      use yii\helpers\Url;
      use yiister\gentelella\widgets\Panel;
      
      /* @var $this yii\web\View */
      
      $this->title = Yii::t('catalog', 'Unload');
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
  <div class="unload-index">
      
      <?php
          $xPanel = Panel::begin(
              [
                  'header' => Html::encode($this->title),
              ]
          );
          ?>
      <div class="row">
      <?php
          echo Html::button(
              \Yii::t('catalog', 'Hotline'),
              [
                  'class' => 'btn btn-success btn-lg hotline_button',
                  'data'  => [
                      'url' => Url::to([ '/ajax/generate-hotline' ]),
                  ],
              ]
          );
          echo Html::button(
              \Yii::t('catalog', 'Nadavi'),
              [
                  'class' => 'btn btn-success btn-lg nadavi_button',
                  'data'  => [
                      'url' => Url::to([ '/ajax/generate-nadavi' ]),
                  ],
              ]
          );
      ?>
      </div>
    <div class="row">
    
      <a class="btn btn-primary" target="_blank" href="/hotline.xml"><?=\Yii::t('app', 'Открыть выгрузку Hotline')?></a>
    
      <a class="btn btn-primary" target="_blank" href="/nadavi.xml"><?=\Yii::t('app', 'Открыть выгрузку Nadavi')?></a>
  
    </div>
      <?php
          $xPanel::end();
      ?>
  </div>
  <?php
      $js = <<<JS
  $(document)
      .on('click', '.hotline_button', function() {
          $(document.body).append('<div class="animated yt-loader"></div>');
          var url = $(this)
              .data('url');
          $.get(url, function() {
              new PNotify({
                          title: "Оповещение",
                          text: "Выгрузка обновлена",
                          type: "success",
                          styling: "bootstrap3",
                          icon: "glyphicon glyphicon-exclamation-sign"
                        });
              $('.yt-loader')
                          .remove();
          });
      });
  $(document)
      .on('click', '.nadavi_button', function(e) {
          $(document.body).append('<div class="animated yt-loader"></div>');
          var url = $(this)
              .data('url');
          $.get(url, function() {
              new PNotify({
                          title: "Оповещение",
                          text: "Выгрузка обновлена",
                          type: "success",
                          styling: "bootstrap3",
                          icon: "glyphicon glyphicon-exclamation-sign"
                        });
              $('.yt-loader')
                          .remove();
          });
      });
  JS;
      $this->registerJs($js);
  ?>