<?php

use yii\helpers\Html;
use modules\forms\models\{Dt179, Dt122, Dt123, Dt125, Dt126, Dt128, Dt129, Dt130, Dt142, Dt213,Sop023, Wel233};
use frontend\models\Dtpdf;


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

?>
<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="400px" style="border: none" colspan="2"> </td></tr>		
</table>		
<br />
<br />
<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'] = "/dt122") {
					$model = dt122::find()->where(['id' => $pdf->formid])->all();
					foreach ($model as $Model){
						echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt122/pdf', ["model" => $Model]);"</div>";
					}
				}
				
				if ($pdf['url'] = "/dt123") {
					$model = dt123::find()->where(['id' => $pdf->formid])->all();
					foreach ($model as $Model){
						echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt123/pdf', ["model" => $Model]);"</div>";
					}
				}
				
				if ($pdf['url'] = "/dt125") {$model = dt125::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='landscape'/><div>".$this->render('//dt125/pdf', ["model" => $Model]);"</div>";}
				if ($pdf['url'] = "/dt126") {$model = dt126::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt126/pdf', ["model" => $Model]);"</div>";}
				if ($pdf['url'] = "/dt128") {$model = dt128::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt128/pdf', ["model" => $Model]);"</div>";}
				if ($pdf['url'] = "/dt129") {$model = dt129::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt129/pdf', ["model" => $Model]);"</div>";} 
				if ($pdf['url'] = "/dt130") {$model = dt130::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt130/pdf', ["model" => $Model]);"</div>";}	
				if ($pdf['url'] = "/dt142") {$model = dt142::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//dt142/pdf', ["model" => $Model]);"</div>";}
				if ($pdf['url'] = "/dt179") {$model = dt179::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='landscape'><div>".$this->render('//dt179/pdf', ["model" => $Model]);"</div>";}	
				if ($pdf['url'] = "/wel233") {$model = wel233::find()->where(['id' => $pdf->formid])->all();foreach ($model as $Model)
				echo "<pagebreak orientation='portrait'/><div>".$this->render('//wel233/pdf', ["model" => $Model]);"</div>";}
				if ($pdf->url == "dt213") {
					$model = Dt213::find()->where(['id' => $pdf->formid])->all();
					foreach ($model as $Model) {
						echo "<pagebreak orientation='landscape'><div>".$this->render('//dt213/_view', ["model" => $Model]);"</div>";
					}		
				}
				if ($pdf->url == "Sop023") {
					$model = Sop023::find()->where(['id' => $pdf->formid])->all();
					foreach ($model as $Model) {
						echo "<pagebreak orientation='landscape'><div>".$this->render('//dt213/_view', ["model" => $Model]);"</div>";
					}		
				}
			?>
  		</div >
	<?php endforeach; ?>
</div>
