<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model modules\forms\models\Dt127 */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Dt127s', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="dt127-view">
    <table class="table table-bordered border-dark">
        <thead>
            <tr>
                <td colspan="3" rowspan="2" class="table table-borderless">
                    <?= $this->render('//common/_viewheader', ['title' => 'Briefing Form DT127']) ?>

                </td>
                <td class="DarkerBlue">Pad no</td>
            </tr>
            <tr>
                <td><?= $model->padno ?></td>
            </tr>
        </thead>
        <tr>
            <th class="DarkerBlue">Briefing Date:</th>
            <td colspan="3"><?= date('d/m/Y', strtotime($model->date)) ?></td>

        </tr>
        <tr>
            <th class="DarkerBlue">Location of Briefing:</th>
            <td colspan="3"><?= $model->location ?></td>

        </tr>
        <tr>
            <th class="DarkerBlue">Briefing Held By:</th>
            <td colspan="3"><?= $model->user ? $model->user->fullname : $model->heldby ?></td>

        </tr>
        <tr>
            <th class="DarkerBlue">Title</th>
            <td colspan=""><?= $model->title ?></td>
        <?php if (is_object($model->upload) == true) {?>
        
            <th class="DarkerBlue">Document</th>
            <td colspan="">
                <?= Html::a('Download '.$model->upload->title, ['/upload/download', 'id' => $model->upload->id], ['class' => 'btn btn-primary', 'download' => $model->upload->title]) ?>
            </td>
            <?php } ?>

        </tr>
        <tr>
            <th class="DarkerBlue" colspan="4">Subjects Covered:</th>
        </tr>
        <tr>

            <td colspan="4"><?= $model->subjects ?></td>

        </tr>
        <tr>
            <th class="DarkerBlue w-25" width="25%">Name</th>
            <th class="DarkerBlue w-25" width="25%">Position</th>
            <th class="DarkerBlue w-25" width="25%">Notes</th>
            <th class="DarkerBlueC w-25" width="25%">Signature</th>
        </tr>
        <tbody>
            <?php $i = 0; ?>
            <?php foreach($model->signatures as $id => $signature){ ?>
                <?php if(empty($signature->name) == false){ ?>			
			
                    <tr>
                        <td><?= $signature->name  ?></td>
                        <td><?= $signature->position  ?></td>
                        <td><?= $signature->note  ?></td>
                        <td>
                            <img src="<?= $signature->signature ?>" height="75px;" />
                        </td>
                    </tr>
				<?php } ?>
            <?php } ?>
        </tbody>
    </table>
</div>