<?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;

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

$assetUrl = $this->getAssetManager()->getBundle(MainAsset::className())->baseUrl;
$this->registerJsFile($assetUrl . '/js/receivable.js', ['depends' => MainAsset::className()]);
$this->title = '对账单导入';
?>
<div class="modal-window">
    <?= Alert::widget(); ?>
    <form id="main-form" class="informationform f14" action="<?= Url::to([$this->context->id . '/import-map']) ?>" method="post" enctype="multipart/form-data">

        <table cellpadding="0" cellspacing="10" width="100%">
            <tbody>
                <tr>
                    <td align="right">收款银行：</td>
                    <td class="field-receivable-rece_bank">
                        <select id="statementaccount-bank_id" class="form-control select_bank" name="bank_id">
                            <?php foreach (Bank::getBankList() as $key => $bank): ?>
                                <option value="<?= $key ?>"><?= $bank ?></option>
                            <?php endforeach ?>
                        </select>

                    </td>			
                    <td><span class="redstar">*</span></td>
                </tr>
                <tr>
                    <td align="right">收款账号：</td>
                    <td class="field-receivable-rece_account">
                        <select class="form-control select_account" name="account_no"></select>
                    </td>			
                    <td><span class="redstar">*</span></td>
                </tr>
                <tr>
                    <td align="right" style="position:relative; top:-5px;">选择文件：</td>
                    <td style="padding-top:6px;">
                        <input type="file" name="excel" class="form-control" value="选择文件" class="input"/>&nbsp;
                        <input type="hidden" name="_csrf" value="<?= Yii::$app->request->getCsrfToken() ?>" class="input"/>&nbsp;
                    </td>            			
                    <td><span class="redstar">*</span></td>
                </tr>
                <tr>
                    <td colspan="2">
                        注：导入excel格式请选择用Excel 97-2003工作簿及后缀为'xls',若是'xlsx'请另存为'xls'格式。付款交易日期请选择日期格式或文本格式，如“2015-01-01”，确保数据导入准确。
                    </td>
                </tr>

            </tbody>
        </table>

    </form>
</div>
<script>
    var CSRF="<?= Yii::$app->request->getCsrfToken()?>";
    var getAccount = "<?= Url::to(['/receivable/receivable/get-account']) ?>";
</script>