<?php
use yii\helpers\Url;
use yii\helpers\StringHelper;
use home\modules\reimbursement\models\Reimbursement;

?>
<div class="p15">
    <table class="table task-table">
        <tbody>
            <tr>
                <th width="24%">标题</th>
                <th width="15%">报销金额</th>
                <th width="15%">报销人</th>
                <th width="15%">报销日期</th>
                <th width="15%">报销状态</th>
                <th width="16%">操作</th>
            </tr>
                    <?php if (!empty($reimbursements)) : ?>
                        <?php foreach ($reimbursements as $reim) : ?>
                    <tr>
                        <td style="text-align:left;padding-left:5px;" ><a href="<?= Url::to(['/reimbursement/reimbursement/detail', 'id' => $reim['reim_id']]) ?>"><?= StringHelper::truncate($reim['name'], 11) ?></a></td>
                        <td class="theright-min"><?= number_format($reim['reim_money'], 2, '.', ' ,') ?></td>
                        <td><?= $reim['reim_people'] ?></td>
                        <td><?= date('Y-m-d', $reim['reim_time']) ?></td>
                        <td>
                            <?php
                            if ($reim['isverify'] == Reimbursement::ISVERIFY_WAIT) {
                                echo '<font color="green">待审核</font>';
                            } elseif ($reim['isverify'] == Reimbursement::ISVERIFY_ENABLE) {
                                echo '<font color="green">通过</font>';
                            } else {
                                echo '<font color="red">否决</font>';
                            }
                            ?>
                        </td>
                        <td><a href="<?= Url::to(['/reimbursement/reimbursement/detail', 'id' => $reim['reim_id']]) ?>">查看</a></td>

                    </tr>
                    <?php endforeach; ?>
                    <tr><td colspan="6"><a href="<?= Url::to(['/reimbursement/reimbursement/index']) ?>" >更多我的报销...</a></td></tr>
                <?php else : ?>
                <tr><td colspan="6">暂无数据...</td></tr>
                <?php endif; ?>
        </tbody>
    </table>
</div>
