<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use home\modules\reimbursement\models\Application;

$this->title = '费用申请单';

/* @var $this \yii\web\View */

?>

<div class="mainbody">
    <div class="detail-content">
        <form class="detailform">
            <tbody>
                <table width="100%">
                    <tr>
                        <td width="50">状态</td>
                        <td colspan="3">
                            <?php 
                                if ($model['isverify'] == Application::ISVERIFY_WAIT) {
                                    echo '<font color="green">待审核</font>';
                                } elseif ($model['isverify'] == Application::ISVERIFY_ENABLE) {
                                    echo '<font color="green">通过</font>';
                                } elseif ($model['isverify'] == Application::ISVERIFY_DISABLE) {
                                    echo '<font color="red">否决</font>';
                                }
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td width="50">用途</td>
                        <td colspan="2"><?= $model['name'] ?></td>
                        <td>￥<?= $model['money'] ?></td>
                    </tr>
                    <tr>
                        <?php $data = common\models\Common::getLinkData($model['link_type'], $model['link_id']); ?>
                        <td>关联</td>
                        <td colspan="3"><?= (isset($data['name'])) ? $data['name'] : '' ?></td>
                    </tr>
                    <tr>
                        <td>申请人</td>
                        <td><?= isset(Yii::$app->cache->get('user_list')[$model['user_id']]['realname'])?Yii::$app->cache->get('user_list')[$model['user_id']]['realname']:'' ?></td>
                        <td width="50">审核人</td>
                        <td><?= implode(',', ArrayHelper::getColumn(\common\models\User::getUserByDot($model['verify_ids']), 'realname')) ?></td>
                    </tr>
                    <tr>
                        <td valign="top">备注</td>
                        <td colspan="3"><?= $model['remark'] ?></td>
                    </tr>
                </table>
            </tbody>
        </form>
    </div>
</div>

