'); $.ajax({ url: "/admin/import/upload", data: formData, type: "POST", success: function(data) { console.log(data); $('.yt-loader').remove(); new PNotify({ title: "Success", text: "File updated", type: "success", styling: "bootstrap3", icon: "glyphicon glyphicon-exclamation-sign" }); }, cache: false, contentType: false, processData: false }); e.preventDefault(); }); $(document).on('click', '#generate-button', function() { $('#progress-container').html('

Process:

' + '
' + '
' + '0%' + '
' + '
'); (function updateInfo(i, finish) { if (finish) { return; } $.ajax({ type: "GET", url: "/admin/import/import?id=" + i }).done(function(data) { $('#progress-container .progress-bar').css('width', data.percent + '%'); $('#progress-container .progress-bar').html(data.percent + '%'); updateInfo(i + 1, data.finish); }); })(0, false); }); JS; $this->registerJs($js, View::POS_READY); $this->params[ 'breadcrumbs' ][] = \Yii::t('catalog', 'Import'); ?> [ 'enctype' => 'multipart/form-data', ], 'id' => 'my-form', 'action' => 'import/upload', ] ) ?> ' . \Yii::t('catalog', 'Upload Document') . ''; echo FileInput::widget( [ 'name' => 'attachment_3', ] ); ?> 'btn btn-success', ] ) ?> 'btn btn-warning', 'id' => 'generate-button', ] ); ?>