
<div class="training-request-view">
    <?php if(Yii::$app->user->identity->role->item_name != 'User'): ?>
        <table class="table table-bordered table-striped">
            <tr>
                <th class="width20"><?= Yii::t('app', 'Date') ?></th>
                <th class="width40"><?= Yii::t('app', 'Causes') ?></th>
                <th class="width20"><?= Yii::t('app', 'Request Status When Rejected') ?></th>
                <th class="width20"><?= Yii::t('app', 'Rejected By') ?></th>
            </tr>

            <?php foreach($rejections as $rejection): ?>
                <tr>
                    <td><?= $rejection->rejection_date ?></td>
                    <td><?= $rejection->rejection_causes ?></td>
                    <td><?= Yii::t('app', $rejection->request_status_when_rejected) ?></td>
                    <td><?= $rejection->rejectorUser->username ?></td>
                </tr>
            <?php endforeach; ?>

        </table>
    <?php elseif(Yii::$app->user->identity->role->item_name == 'User'): ?>
        <ul>
            <?php foreach($rejections as $rejection): ?>
                <li><?= $rejection->rejection_date ?></li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>
</div>
