<?
$this->showPrint = true;
?>

<link rel="stylesheet" href="/resources/css/seguro/propostaprint.css" type="text/css" media="print" />

<?=$this->headerSinistro($this-> params["id_proposta"], $this->params["id_processo"]); ?>

<div class="view" style="width:98%">

	<fieldset>
		<legend>Vistoria</legend>
		<table>
			<tr>
				<td><b>Início</b><br><?echo $this-> params["dt_inicio"]?></td>
				<td><b>Fim</b><br><?echo $this-> params["dt_fim"]?></td>
			</tr>
			<tr><td colspan="2"><b>Vistoriadores</b><br> <?echo implode(", ", $this->params["vistoriadores"])?></td></tr>
		</table>
	</fieldset>
	
	<br style="clear: both;">
	
	<? echo $this->dadosDigitacaoLaudo($this->params["id_laudo_final"]);?>
	
	<br style="clear: both;">
	
	<?echo $this->getAvisosVistoria($this->params["id_vistoria"])?>
	
	<br style="clear: both;">
	
	<fieldset>
		<legend>Identificação do evento</legend>
		<table>
			<?if ($this->params["fl_evento_nao_constatado"]):?>
				<tr>
					<td><b>Evento não constatado</b></td>
				</tr>
			<?else:?>
				<tr>
					<td>
						<b>Área Atingida</b><br>
						<?if ($this->params["fl_area_atingida"] == "P"):?>
							Parcial 
						<?else:?>
							Total
						<?endif;?>
					</td>
				</tr>	
			<?endif;?>
		</table>
	</fieldset>
	
	<br style="clear: both;">
	
	<fieldset>
		<legend>Informações de cada Quadra/Talhão Inspecionado</legend>
		
		<?foreach ($this->params["itens"] as $item):?>
			<fieldset>
				<table width="100%">
					<tr>
						<td><b>Quadra/Talhão</b><br><?echo $item["ds_item_segurado"];?></td>
						<td><b>Variedade</b><br><?echo $item["ds_nome_variedade"];?></td>
						<td><b>Coordenadas</b><br><?echo $item["ds_coordenadas_s"];?></td>
						<td><b>Estádio fenológico</b><br><?echo $item["ds_estadio_fenologico"];?></td>
					</tr>
					<tr>
						<td>
							<b>Tipo de condução</b><br>
							<?if ($item["tp_conducao"] == "E"):?>
								Espaldeira 
							<?else:?>
								Latada
							<?endif;?>
						</td>
						<td><b>Evento comunicado</b><br><?echo implode(", ", $this->params["eventosAvisos"]);?></td>
						<td><b>Intensidade do evento</b><br><?echo $this->params["intencidades"][$item["id_intensidade"]]?></td>
					</tr>
					<tr>
						<?if ($item["tp_conducao"] == "L"):?>
							<td><b>% de estrutura afetada (latada)</b><br><?echo $item["vl_percent_estrutura_afetada"];?></td>
						<?endif;?>
						
						<?if ($item["tp_conducao"] == "E"):?>
							<td><b>Metros lineares caídos (espaldeira)</b><br><?echo $item["vl_metros_lineares_caidos"];?></td>
						<?endif;?>
	
						<td>
							<b>Rompimento (cabos, âncoras, postas)</b><br>
							<?if ($item["fl_rompimento"]):?>
								Sim 
							<?else:?>
								Não
							<?endif;?>
						</td>
						<?if ($item["tp_conducao"] == "L"):?>
							<td><b>Deslocamento vertical (abaixamento): (cm)</b><br><?echo $item["vl_deslocamento_vertical"];?></td>
						<?endif;?>
					</tr>
				</table>
			</fieldset>
			<br style="clear: both;">
		<?endforeach;?>
		
	</fieldset>
	
	<br style="clear: both;">
	
	<fieldset>
		<legend>Condições gerais da cultura</legend>
		
		<table>
			<tr>
				<td>
					<b>A lavoura condiz com a proposta de seguro?</b><br>
					<?if ($this->params["fl_lavoura_condiz_proposta"]):?>
						Sim 
					<?else:?>
						Não
					<?endif;?>
				</td>
			</tr>
			<?if (!$this->params["fl_lavoura_condiz_proposta"]):?>
				<tr>
					<td>
						<b>Motivo</b><br>
						<?echo $this->params["ds_n_condiz_motivo"];?>
					</td>
				</tr>
			<?endif;?>
			<tr>
				<td>
					<b>Manutenção da estrutura</b><br>
					<?php
						switch ($this->params["fl_manutencao_estrutura"]){
							case "I":
								echo "Irregural";
								break;
							
							case "R":
								echo "Regular";
								break;
	
							case "B":
								echo "Bom";
								break;
							
							case "O":
								echo "Ótimo";
								break;
						}
					?>
				</td>
			</tr>
			<tr>
				<td>
					<b>Quais os problemas identificados</b><br>
					<?echo $this->params["ds_problemas_identificados"]?>
				</td>
			</tr>
		</table>
	</fieldset>
	
	<br style="clear: both;">
	
	<fieldset>
		<legend>Dados Adicionais</legend>
		<table width="100%">
			<tr>
				<td colspan="2">
					<b>Observacao</b><br>
					<?echo $this->params["ds_observacao"]?>
				</td>
			</tr>
			<tr>
				<td>
					<b>Assinatura do regulador coletada</b><br>
					<?if ($this->params["fl_assinatura_regulador"]):?>
						Sim 
					<?else:?>
						Não
					<?endif;?>
				</td>
				<td>
					<b>Assinatura do segurado coletada</b><br>
					<?if ($this->params["fl_assinatura_segurado"]):?>
						Sim 
					<?else:?>
						Não
					<?endif;?>
				</td>
			</tr>
		</table>
		
	</fieldset>
</div>

