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

/* @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/statement.import.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 . '/do-import']) ?>"  method="post">
                <div class="btnlinks">
                    <h5 style="text-align:center">共<?= $rows ?>行记录，<?= $columns ?> 列信息，从下面的Exel列信息中选择列分别对应要导入的字段</h5>
                    <?php if(empty($list)) : ?>
                        <tr><td colspan="16" class="tac red">还没有任何数据...</td></tr>
                    <?php else : ?>
                        <?php foreach ($list as $key => $item) : ?>
                            <input class="titleButton btn btn-default" style="margin-bottom:5px; padding:0px 10px;" id="<?= $key ?>" name="<?= $key ?>" type="button" value="<?= $item ?>">
                        <?php endforeach; ?>
                    <?php endif; ?>
                </div>

                <table cellpadding="0" cellspacing="10" width="100%">
                    <tr >
                        <td align="right" width="80">对方户名：</td>
                        <td><input type="text"  size="55"  class="form-control" value=""  data-name="对方户名" /><input type="hidden" name="remittance_user"/></td>
                    </tr>
                    <tr >
                        <td align="right">对方银行：</td>
                        <td><input type="text"  size="55"  class="form-control" value="" data-name="对方银行"  /><input type="hidden" name="remittance_bank"/></td>
                    </tr>
                    <tr>
                        <td align="right">对方账号：</td>
                        <td><input type="text"  size="55"  class="form-control" value=""   data-name="对方账号"/><input type="hidden" name="remittance_no"/></td>
                    </tr>
                    <tr >
                        <td align="right">借方金额：</td>
                        <td><input type="text"  size="55"  class="form-control"  value="" data-name="借方金额"/><input type="hidden" name="account_debit"  /></td>
                    </tr>
                    <tr >
                        <td align="right">贷方金额：</td>
                        <td><input type="text"  size="55"  class="form-control"  value="" data-name="贷方金额" /><input type="hidden" name="account_credit" /></td>
                    </tr>
                    <tr >
                        <td align="right">银行流水号：</td>
                        <td><input type="text"  size="55"  class="form-control"  value="" data-name="银行流水号"  /><input type="hidden" name="serial_number"/></td>
                    </tr>
                    <tr >
                        <td align="right">付款日期：</td>
                        <td>
                            <input type="text"  size="55"  class="form-control"  value="" data-name='付款日期' />
                            <input type="hidden" name="payment_time"/>
                        </td>
                    </tr>
                    <tr >
                        <td align="right">摘要：</td>
                        <td><input type="text"  size="55"  class="form-control"  value="" data-name="摘要"/><input type="hidden" name="remark"  /></td>
                    </tr>
                    <tr>
                        <?php if(!empty($post)) : ?>
                            <?php foreach ($post as $key => $item) : ?>
                            <input name="<?= $key ?>" type="hidden" value="<?= $item ?>"/>
                        <?php endforeach; ?>
                    <?php endif; ?>

                    <td>
                        <input name="bank_id" type="hidden" value="<?= $bank_id ?>"/>
                        <input name="account_no" type="hidden" value="<?= $account_no ?>"/>
                        <input type="hidden" name="_csrf" value="<?= Yii::$app->request->getCsrfToken() ?>" class="input"/>&nbsp;
                    </td>
                    </tr>
                </table>
            </form>
</div>
<!--container-->
