<?php

use yii\helpers\Html;


/* @var $this yii\web\View */
/* @var $model frontend\models\Activities */

?>
<div class="activities-create">
    <div class="pdfs-page1 page portrait" data-orientation="portrait">
        <table width="100%">
            <tr>
                <td align="left" style="border: none">
                    <img src="https://my.inlinetrack.co.uk/images/InlineLogo.png" />
                </td>
                <td align="right" style="border: none">
                    <img src="https://my.inlinetrack.co.uk/images/homesafe.jpg" width="12.5%" height="auto">
                </td>
            </tr>
        </table>
        <div style="font-family: Gill Sans MT; font-size: 24px ">
            <p align="center" style="font-family: Gill Sans MT"><b>Inline Track Welding</b></p><br>
            <p align="center" class="">ALUMINO SYSTEM</p>
        </div>
        <br>
        <br>
        <table width="100%" style="font-family: Gill Sans MT; font-size: 18px; border: none">
            <tr>
                <td align="center" style="border: none">Client</td>
                <td align="center" style="border: none"><?= $model->account ? $model->account->account_name : null ?> </td>
            </tr>
            <tr>
                <td align="center" style="border: none">Date</td>
                <td align="center" style="border: none"><?= date('d/m/Y', (strtotime(str_replace('/', '-', $model->sdate))))?></td>
            </tr>
            <tr>
                <td align="center" style="border: none">Day</td>
                <td align="center" style="border: none"><?= $model->day ?> </td>
            </tr>
            <tr>
                <td align="center" style="border: none">Location</td>
                <td align="center" style="border: none"><?= $model->location ?> </td>
            </tr>
            <tr>
                <td align="center" style="border: none">Job Number</td>
                <td align="center" style="border: none"><?= $model->jobno ?> </td>
            </tr>
            <tr>
                <td align="center" style="border: none">Number of Job Sheets</td>
                <td align="center" style="border: none"><?= $sheetcount ?> </td>
            </tr>
            <tr>
                <td height="200px" style="border: none" colspan="2"> </td>
            </tr>
        </table>
        <table class="Table" style="font-size: 11pt">
            <tr>
                <td class="DarkerBlue" style="font-size: 11pt">Welders</td>
                <td class="DarkerBlue" style="font-size: 11pt">Sentinel No</td>
            </tr>
            <?php $welders = explode(',', $model->welder); ?>
            <?php if ($welders) { ?>
                <?php foreach ($welders as $key => $welder) { ?>
                    <?php $data = \frontend\models\User::find()->where(['=', 'username', $welder])->one(); ?>
                    <?php if($data){ ?>
                    
                    <tr>
                        <td><?= $data->username ?></td>
                        <td><?= $data->sentinelno ?></td>
                    </tr>
                    <?php } ?>    
                <?php } ?>
            <?php } else {  ?>
                <?php $data = \frontend\models\User::find()->where(['=', 'username', $model->welder])->one(); ?>
                <?php if($data){ ?>
                    <tr>
                        <td><?= $data->username ?></td>
                        <td><?= $data->sentinelno ?></td>
                    </tr>
                <?php } ?>    
            <?php } ?>
        </table>
        <br />
        <br />
        <table width="100%" style="border: none">
            <tr>
                <td align="center" style="border: none">
                    <img height="auto" width="150px" src="https://my.inlinetrack.co.uk/images/ciras.png" width="12.5%" height="auto">
                </td>
                <td align="center" style="border: none">
                    <img height="auto" width="150px" src="https://my.inlinetrack.co.uk/images/iso3834.png" />
                </td>
                <td align="center" style="border: none">
                    <img height="auto" width="150px" src="https://my.inlinetrack.co.uk/images/risqs-audited.png" />
                </td>
                <td align="center" style="border: none">
                    <img height="auto" width="150px" src="https://my.inlinetrack.co.uk/images/risqs-qualified.png" />
                </td>

            </tr>
        </table>
    </div>
    <?php foreach ($dtpdf as $pdf) { ?>
        <?php if($pdf->form !== "sop023") { ?>
            <div class="<?= $pdf->form ?>-page <?= strtolower($pdf->data->printlayout)?>" data-orientation="<?= strtolower($pdf->data->printlayout)?>">
        <?php } ?>

            <?php $layout = property_exists($pdf->data, 'viewLayout') && $pdf->data->viewLayout ? $pdf->data->viewLayout : '//forms/_'.$pdf->form.'v'  ?>
            <?= $this->render($layout, ["model" => $pdf->data]); ?>

        <?php if($pdf->form !== "sop023") { ?>
		    </div>
        <?php }?>
    <?php }; ?>
</div>