<?php

use home\assets\MainAsset;
use yii\helpers\Url;
use home\widgets\Alert;
use home\modules\statement\models\StatementAccount;
use yii\widgets\ActiveForm;
use yii\helpers\StringHelper;
use yii\helpers\ArrayHelper;
use common\assets\My97DatePickerAsset;
use home\modules\receivable\models\Bank;
use home\modules\receivable\models\Account;
use common\assets\ArtDialogAsset;

/* @var $this \yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \home\modules\rreimbursement\models\Application */

ArtDialogAsset::register($this);
$assetUrl = $this->getAssetManager()->getBundle(MainAsset::className())->baseUrl;
$this->registerJsFile($assetUrl . '/js/receivable.js', ['depends' => MainAsset::className()]);
$js = <<<JS
    art.dialog.top.$('.aui_buttons button:first').remove();
    art.dialog.top.$('.aui_buttons button:last').html('关闭');
JS;
$this->registerJs($js);
$this->title = '对账单导入';
?>
<div class="modal-window">
    <?= Alert::widget(); ?>
    <div  class="informationform f14">
        <table class="table task-table taskdetail-table">
            <tbody>
                <tr>
                    <td colspan="3">导入结果</td>
                </tr>
                <tr>
                    <td>银行流水号</td>
                    <td>导入结果</td>
                    <td>提示</td>
                </tr>
                <?php foreach ($importInfo as $key => $item): ?>
                    <tr>
                        <td><?= $item['serial_number'] ?></td>
                        <td>
                            <?php
                            if ($item['status']) {
                                echo '<i class="icon-ok"></i>';
                            } else {
                                echo '<i class="icon-remove"></i>';
                            }
                            ?>
                        </td>
                        <td><?= $item['info'] ?></td>
                    </tr>
                <?php endforeach; ?>
                <tr>
                    <td colspan="3">导入完毕！成功<?= $account_success ?>条，失败<?= $account_error ?>条。</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<script>
    var getAccount = "<?= Url::to(['/receivable/receivable/get-account']) ?>";
</script>