
<?php 

$rigaCentrale = '';//<td style="background-color: black; width: 2;"></td>';
$types = paramdeep('plateAuthorizations','types');

?>
<style>
<!-- /* Font Definitions */
@font-face {
	font-family: "Cambria Math";
	panose-1: 2 4 5 3 5 4 6 3 2 4;
}

@font-face {
	font-family: Calibri;
	panose-1: 2 15 5 2 2 2 4 3 2 4;
}
/* Style Definitions */
p.MsoNormal,li.MsoNormal,div.MsoNormal {
	margin: 0cm;
	margin-bottom: .0001pt;
	text-autospace: none;
	font-size: 10.0pt;
	font-family: "Times New Roman", "serif";
}

p.MsoNormalMargin,li.MsoNormalMargin,div.MsoNormalMargin {
	margin: 0pt;
	margin-top: 2pt;
	margin-bottom: .0001pt;
	text-autospace: none;
	font-size: 10.0pt;
	font-family: "Times New Roman", "serif";
}

.MsoChpDefault {
	font-size: 11.0pt;
}

.MsoPapDefault {
	margin-bottom: 10.0pt;
	line-height: 115%;
}
/* Page Definitions */
@page WordSection1 {
	size: 21.0cm 421.0pt;
	margin: 14.2pt 14.2pt 14.2pt 14.2pt;
}

div.WordSection1 {
	page: WordSection1;
}
-->
</style>

<div style="border: thin; border-style: solid; width: 100.0%; border-collapse: collapse; margin-left: 4.8pt; margin-right: 4.8pt;">
	<table
		style="width: 100.0%; margin: 10pt;">
		<tr style="height: 276.2pt;">
			<td width=385 valign=top
				style="width: 288.85pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 276.2pt; border-right: thin; border-right-style: dashed;">
				<p class=MsoNormal align=right
					style='text-align: right; line-height: 12.0pt'>
					<b><span style='font-family: "Arial", "sans-serif"'> </span> </b>
				</p>
				<table class=MsoTableGrid border="0" cellspacing="0" cellpadding="0"
					style='border-collapse: collapse; border: none'>
					<tr>
						<td width=123 valign=top
							style='width: 92.15pt; padding: 0cm 5.4pt 0cm 5.4pt'>
							<p class=MsoNormal>
								<span style='font-family: "Arial", "sans-serif"'><span
									style='color: blue; text-decoration: none'> <img alt=""
										src="data:image/jpeg;base64, " />
								</span> </span>
							</p>
						</td>
						<td width=247 valign=top
							style='width: 185.15pt; padding: 0cm 5.4pt 0cm 5.4pt'>
							<p class=MsoNormal>
								<b><span
									style='font-size: 8.0pt; font-family: "Arial", "sans-serif"'>&nbsp;</span>
								</b>
							</p>
							<p class=MsoNormal>
								<b><span
									style='font-size: 20.0pt; font-family: "Arial", "sans-serif"'>A</span>
								</b><span
									style='font-size: 20.0pt; font-family: "Arial", "sans-serif"'>rea<b>
										P</b>edonale
								</span>
							</p>
							<p class=MsoNormalMargin>
								<span
									style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>Autoriz.
									di t</span><span
									style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>ipo</span><span
									style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>:
								</span><b><span title="<?php echo($types[$permit->type]); ?>"
									style='font-size: 30.0pt; font-family: "Arial", "sans-serif"'><?php echo($permit->type); ?>
								</span> </b>
							</p>
						</td>
					</tr>
				</table>
				<p class=MsoNormal>
					<span style='font-family: "Arial", "sans-serif"'>&nbsp;</span>
				</p>
				<p class=MsoNormal style='margin-top: 6.0pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>AUTORIZZAZIONE
					</span> </b>
				</p>
				<p class=MsoNormal style='margin-bottom: 6.0pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>AL
							TRANSITO N. </span> </b> <span
						style='font-size: 20.0pt; font-family: "Arial", "sans-serif";'> <?php echo($permit->ID); ?>
					</span>
				</p>
				<p class=MsoNormal>
					<b><span
						style='font-size: 16.0pt; font-family: "Arial", "sans-serif"'>TARGA:
					</span> </b>
				</p>
				<p class=MsoNormal style='margin-top: 6.0pt'>
					<span
						style='font-size: 20.0pt; font-family: "Arial", "sans-serif"; margin-left: 2em;'>
						<?php
						echo($permit->vehicle->Targa);
						if(strlen($permit->vehicle->Nationality) > 0)
						{
						  $imgUrl = ImageHelper::getImageUrl("country-flags/16x16/".strtolower($permit->vehicle->Nationality).".png");
						  $countryList = CountryList::localized();
						  $imgTitle = $countryList[$permit->vehicle->Nationality];
						  ?> <img src="<?php echo($imgUrl); ?>"
						alt="<?php echo($imgTitle); ?>" title="<?php echo($imgTitle); ?>" />
						<?php 
						}

						?>
					</span>
				</p>
				<p class=MsoNormal style='margin-top: 12.0pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>ACCESSO
							A: </span> </b>
				
				<p>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>
						<?php 
						echo(SystemInfoHelper::getPlateAuthGateCoolName($permit->GateID,$permit->GateID_type, false, false));
						?>
					</span>

				</p>
				<p class=MsoNormal style='margin-top: 12.0pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>VALIDITA':
					</span> </b> <br /> <span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>dal
						<?php echo(DateHelper::ensureObjectEx($permit->validityPeriod->DataInizio)->format(getFormat_Date().' '.getFormat_Time())); ?>
						<br />al <?php echo(DateHelper::ensureObjectEx($permit->validityPeriod->DataFine)->format(getFormat_Date().' '.getFormat_Time())); ?>
					</span>
				</p>
			</td>
			<?php echo($rigaCentrale); ?>
			<td width=385 valign=top
				style="width: 288.9pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 276.2pt;">
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>&nbsp;</span>
					</b>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>INTESTATO
							A:</span> </b>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'><?php echo($permit->user->Cognome." ".$permit->user->Nome); ?>
					</span>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>&nbsp;</span>
				</p> <?php

				$note = $permit->Note;
				if(empty($note))
				  $note = "Nessuna";

				?>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>ANNOTAZIONI:
					</span> </b>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'><?php echo($note) ?>
					</span>
				</p>

				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>&nbsp;</span>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<b><span
						style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'>PERCORSO:
					</span> </b>
				</p>
				<p class=MsoNormal
					style='margin-top: 0cm; margin-right: 0cm; margin-bottom: 6.0pt; margin-left: 8.85pt'>
					<span style='font-size: 14.0pt; font-family: "Arial", "sans-serif"'><?php echo(onNull($permit->action,'Nessuno')) ?>
					</span>
				</p>
			</td>
		</tr>
		<tr style='height: 100pt'>
			<td align="right" valign="bottom" style="border-right: thin; border-right-style: dashed;">
				<div
					style="border: thin; border-style: dashed; width: 150px; height: 100px; margin: 10px;">
				</div>
			</td>
			<?php echo($rigaCentrale); ?>
			<td></td>
		</tr>
	</table>
</div>
