Blame view

common/modules/product/views/manage/import.php 1.4 KB
8724ec1f   Karnovsky A   -
1
2
3
4
5
6
7
8
  <?php
  
  use yii\helpers\Html;
  use yii\widgets\ActiveForm;
  ?>
  
  <div class="product-import-form">
      <?php $form = ActiveForm::begin([
5ee9ab1f   Karnovsky A   -
9
          'enableClientValidation' => false,
8724ec1f   Karnovsky A   -
10
11
12
13
14
15
16
17
18
19
          'options' => ['enctype' => 'multipart/form-data']
      ]); ?>
  
      <?php if($model->errors) :?>
      <div class="error">
          <?= implode("<br>\n", $model->errors);?>
      </div>
      <?php endif?>
  
      <?php if($model->output) :?>
5ee9ab1f   Karnovsky A   -
20
21
          <h2>Лог операции</h2>
      <div class="success" style="height: 10em;overflow: auto;border: 1px solid #000">
8724ec1f   Karnovsky A   -
22
23
24
25
          <?= implode("<br>\n", $model->output);?>
      </div>
      <?php endif?>
  
5ee9ab1f   Karnovsky A   -
26
27
28
29
30
31
32
33
      <?= $form->field($model, 'type')->radioList([
          'products' => Yii::t('product', 'Load products'),
          'prices' => Yii::t('product', 'Load prices'),
      ]);?>
  
      <?= $form->field($model, 'file')->fileInput(['multiple' => false,])?>
  
      <?php /*= $form->field($model, 'file')->widget(\kartik\file\FileInput::classname(), [
8724ec1f   Karnovsky A   -
34
35
36
37
38
39
40
41
42
43
          'language' => 'ru',
          'options' => [
              'multiple' => false,
          ],
          'pluginOptions' => [
              'allowedFileExtensions' => ['csv'],
              'overwriteInitial' => true,
              'showRemove' => false,
              'showUpload' => false,
          ],
5ee9ab1f   Karnovsky A   -
44
      ])*/?>
8724ec1f   Karnovsky A   -
45
46
47
48
49
50
51
  
      <div class="form-group">
          <?= Html::submitButton(Yii::t('product', 'Import'), ['class' => 'btn btn-primary']) ?>
      </div>
  
      <?php ActiveForm::end(); ?>
  </div>