<?php
use home\assets\MainAsset;
use yii\helpers\Url;
use home\modules\receivable\models\Bank;
use yii\widgets\ActiveForm;
use yii\helpers\StringHelper;

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

$this->title = '银行列表';
?>

<!--container-->
<div class="container manage-project fix">
    <?= $this->render('@home/views/site/_left-menu') ?>

    <!--manage-left -->
    <div class="manage-right">
        <div class="tab-column tab-manage">
            <div class="tab-right">
                <button type="button" title="添加收款银行" data-width="400" data-height="220" data-url='<?= Url::to([$this->context->id . '/create']) ?>' data-title="添加收款银行" class="btn btn-default btn-task open-dialog">
                   <i class="icon-plus"></i>
                </button>
            </div>
            <p class="caption">收款银行</p>
        </div>
        <?= \home\widgets\Alert::widget(); ?>
        <?php $mainForm = ActiveForm::begin([ 'id' => 'main-form', 'action' => '']); ?>
        <table class="table task-table">
            <tr>
                <!-- <th width="60"><label style="font-weight:lighter" ><input type="checkbox" name="select_all" class="box-select-all" style="position:relative;top:2px;" /> 全选</label></th> -->
                <th width="30%">收款银行</th>
                <th width="45%">备注</th>
                <th width="150" align="center">操作</th>
            </tr>
            <?php if (empty($models)) : ?>
            <tr><td colspan="6" class="tac red">还没有任何数据...</td></tr>
            <?php else : ?>
                <?php foreach ($models as $model) : ?>
                <tr>
                    <!-- <td><input type="checkbox" name="delete[]" class="box-delete" value="<?= $model->bank_id ?>" /></td> -->
                    <td class="theleft-min" title="<?= $model->name ?>"><?= $model->name ?></td>
                    <td class='theleft-min' title="<?= $model->remark ?>"><?= empty($model->remark) ? '' : StringHelper::truncate($model->remark, 32) ?></td>
                    <td align="center" >
                        <a href="javascript:;" class="open-dialog"  data-url="<?= Url::to([$this->context->id . '/view', 'id' => $model->bank_id]) ?>" data-width='400' data-height='220' data-title='编辑收款银行' >编辑</a>  
                        <a href="<?= Url::to([$this->context->id . '/delete', 'id' => $model->bank_id]) ?>" class="link-delete" >删除</a>
                    </td>
                </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </table>
        <!-- <div class="tab-column tab-manage">
            <button type="button" class="btn btn-default btn-task batch-delete" data-url="<?= Url::to([$this->context->id.'/delete']) ?>" >
                <a href="javascript:;">删除</a>
            </button>
        </div> -->
        <?php ActiveForm::end(); ?>
        <div class="pages">
            <span class="pagetotal">共<em><?= $pages->totalCount ?></em>条记录<em><?= $pages->page + 1 ?>/<?= $pages->pageCount ?></em>页 </span>
            <?= \yii\widgets\LinkPager::widget(['pagination' => $pages, 'prevPageLabel' => '上一页','nextPageLabel' => '下一页', 'firstPageLabel' => '首页', 'lastPageLabel' => '末页']); ?>
        </div>
    </div>
    <!--manage-right--> 
</div>
<!--container-->