<?php

use yii\helpers\Html;
use frontend\models\Dtpdf;
use modules\forms\models\{Dt131, Dt132, Dt133};
use modules\users\models\User;


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

?>
<div class="activities-create">

<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->account_name ?> </td></tr>
<tr><td align="center" style="border: none">Date</td><td align="center" style="border: none" ><?= date('d/m/Y', (strtotime($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);
		foreach ($welders as $key => $welder) {
			$data = User::find()->where(['=', 'username', $welder])->one();
			?>
			<tr>
				<td><?= $data->username ?></td>
				<td><?= $data->sentinelno ?></td>
			</tr>
			<?php  } ?>
	
</table>
<table>
	<tr><td height="150px" style="border: none" colspan="2"> </td></tr>		
</table>

<br />


<table width="100%" style="border: none">
<tr>
	<td align="left" style="border: none">
	<img src="https://my.inlinetrack.co.uk/images/RISQS.png"/>
	</td>
	<td align="right" style="border: none">
		<img src="https://my.inlinetrack.co.uk/images/ciras.png" width="12.5%" height="auto">
	</td>
</tr>
</table>

    <?php foreach ($dtpdf as $pdf): ?>
    <div class="row">
<?php
if ($pdf['url'] = "/dt133") {$model = dt133::find()->where(['id' => $pdf->formid])->all();
	foreach ($model as $Model) {
	
echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt133/pdf', ["model" => $Model]);"</div>";}
}
if ($pdf['url'] = "/dt131") {$model = dt131::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt131/pdf', ["model" => $Model]);"</div>";}
if ($pdf['url'] = "/dt132") {$model = dt132::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt132/pdf', ["model" => $Model]);"</div>";}
   ?>
  </div >
<?php endforeach; ?>
</div>
