<?php
use yii\helpers\Html;
?>
<div class="dt179-form">

    <style>
    .table179 {
        border-width: 1;
        border-style: solid;
        border-color: #000000;
        border-collapse: collapse;
        width: 100%;

    }

    td {
        border-collapse: collapse;
        border-width: 1;
        border-style: solid;
        border-color: #000000;
    }

    th {
        border-collapse: collapse;
        border-width: 1;
        border-style: solid;
        border-color: #000000;
    }

    .nolb {
        border-left-width: 0;
    }

    .norb {
        border-right: none;
    }

    .nolrb {
        border-left-width: 0;
        border-right-width: 0;
    }
    </style>
    <script>
    <?php 
     $script5 = "
    $('.summary').hide();";
    $this->registerJs($script5);
?>
    </script>
    <table class="Table notbb nolrb">
        <tr>

            <td colspan="" width="90%">
                <?= $this->render('//common/_viewheader', ['title' => 'RECORD OF HOURS WORKED']) ?></td>

            <td class="text-left nolb pl-3" >
				TIMESHEET No: <br />
                <?= $model->padno ?>
			</td>
        </tr>
    </table>
    <table class="Table">
        <tr style="vertical-align:top">
            <td rowspan="4" colspan="2">CLIENT<br><?= $model->account ? $model->account->account_name :null ?></td>
            <td class="nobb" colspan="6">CLIENT CONTACT</td>
            <td rowspan="4" colspan="3">WEEKENDING<br>
                <?=  $model->date ?>
            </td>
            <td rowspan="4" colspan="2">WEEK NO<br>

                <?= $model->weekno ?>

            </td>
            <td rowspan="4" colspan="3">CLIENT PURCHASE ORDER No.<br>

                <?= $model->clientpo ?>
            </td>
        </tr>
        <tr>
            <td class="notb" colspan="6"><?= $model->siterepprint ?></td>
        </tr>
        <tr>
            <td class="nobb" colspan="6">WORK LOCATION</td>
        </tr>
        <tr>
            <td class="notb" colspan="6"><?= $model->worksite ?></td>
        </tr>

        <tr>
            <td class="nobb" colspan="2">

            </td>
            <td colspan="11" style="padding-left:2.5em">
                TO ENSURE PROMPT PAYMENT THE PURCHASE ORDER NUMBER MUST BE RECORDED<br> <br>
            </td>
            <td colspan="3">
                SUPPLIER JOB REF (if required) <br>

                <?= $model->supplierjobno ?>
            </td>
        </tr>
        <tr>
            <td class="notbb" colspan="2"></td>
            <td colspan="11" style="padding-left:5em">
                ACTUAL ON-SITE WORKING TIMES ONLY MUST BE RECORDED<br> <br>
            </td>
            <td colspan="3">
                CLIENT ISSUING DEPOT: <br>
                <?= $model->welddepot ?>
            </td>
        </tr>

        <tr align="center">
            <td class="notbb" colspan="2"></td>
            <td colspan="2">Sat</td>
            <td colspan="2">Sun</td>
            <td colspan="2">Mon</td>
            <td colspan="2">Tue</td>
            <td colspan="2">Wed</td>
            <td colspan="2">Thu</td>
            <td colspan="2">Fri</td>
        </tr>

        <tr align="center">
            <td class="notb" valign="bottom" align="right" colspan="2" style="font-style: italic">(Insert Date)</td>
            <td colspan="2"><?=  $model->date1 ?></td>
            <td colspan="2"><?=  $model->date2 ?></td>
            <td colspan="2"><?=  $model->date3 ?></td>
            <td colspan="2"><?=  $model->date4 ?></td>
            <td colspan="2"><?=  $model->date5 ?></td>
            <td colspan="2"><?=  $model->date6 ?></td>
            <td colspan="2"><?=  $model->date7 ?></td>
        </tr>
        <tr>

            <th width="20%">Name</th>
            <th width="10%" align="right">Trade</th>

            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
            <th width="5%">
                <div align="center">Start</div>
            </th>
            <th width="5%">
                <div align="center">Finish</div>
            </th>
        </tr>
        <?php $x = 0; ?>
        <?php while($x < count($model->rowname)){ ?>
        <?php if($model->rowstatus[$x] == 'Active') { ?>
        <tr>
            <td><?= $model->rowname[$x]; ?></td>
            <td><?= $model->rowtrade[$x]; ?></td>
            <td><?= $model->rowstart1[$x]; ?></td>
            <td><?= $model->rowfinish1[$x]; ?></td>
            <td><?= $model->rowstart2[$x]; ?></td>
            <td><?= $model->rowfinish2[$x]; ?></td>
            <td><?= $model->rowstart3[$x]; ?></td>
            <td><?= $model->rowfinish3[$x]; ?></td>
            <td><?= $model->rowstart4[$x]; ?></td>
            <td><?= $model->rowfinish4[$x]; ?></td>
            <td><?= $model->rowstart5[$x]; ?></td>
            <td><?= $model->rowfinish5[$x]; ?></td>
            <td><?= $model->rowstart6[$x]; ?></td>
            <td><?= $model->rowfinish6[$x]; ?></td>
            <td><?= $model->rowstart7[$x]; ?></td>
            <td><?= $model->rowfinish7[$x]; ?></td>
        </tr>
        <?php }; ?>
        <?php $x++; ?>
        <?php }; ?>


        <tr>
            <td colspan="2">30 MINUTES MEAL BREAK TAKEN <br>Mandatory Requirement(circle as appropriate)</td>
            <td align="center" colspan="2"><?= $model->break1 ?></td>
            <td align="center" colspan="2"><?= $model->break2 ?></td>
            <td align="center" colspan="2"><?= $model->break3 ?></td>
            <td align="center" colspan="2"><?= $model->break4 ?></td>
            <td align="center" colspan="2"><?= $model->break5 ?></td>
            <td align="center" colspan="2"><?= $model->break6 ?></td>
            <td align="center" colspan="2"><?= $model->break7 ?></td>
        </tr>

        <tr>
            <style>
            .nobb {
                border-bottom-width: 0;
            }

            .notb {
                border-top-width: 0;
            }

            .notbb {
                border-bottom-width: 0;
                border-top-width: 0;
            }
            </style>
            <td class="nobb" colspan="4">
            </td>
            <td align="left" colspan="5">
                RECORD OF HOURS ON SITE SUPPLIER&rsquo;S CONFIRMATION<br>
                SIGNED:<img height="100px" src="<?= $model->signsc ?>"><br>
                PRINT NAME: <?= $model->namesc ?><br>
                DATE:<?=  $model->datesc ?>
            </td>
            <td rowspan="2" valign="bottom" colspan="3"></td>
            <td rowspan="2" valign="top" colspan="4">
                COMMENTS: <?=  $model->comments ?>
            </td>


        </tr>
        <tr>
            <td valign="top" class="notb" colspan="4">
                CLIENTS CONFIRMATION <br>
                ON SITE BRIEFINGS UNDERTAKEN <br>
                Rule Book Requirements <br>
                I certify that the above persons have been briefed in accordance with the relevant sections of the
                Modular Rule Book <br>
                (A Safe System of Work Briefing and the relevant Health, Safety and Welfare arrangements have been
                briefed)
                <br>
                <br>
                SIGNED<br>
                <img height="100px" src="<?=$model->signbc ?>" /><br>
                PRINT NAME: <?= $model->namebc ?><br>
                DATE:<?=  $model->datebc ?>
            </td>
            <td valign="top" colspan="5">
                CLIENT CONFIRMATION<br>
                SIGNED:<img height="100px"  src="<?= $model->signcc ?>" /><br>

                PRINT NAME<br>
                <?= $model->namecc ?>
                DATE:<?= $model->datecc ?>
            </td>
        </tr>
    </table>
</div>