<!DOCTYPE html>
<html lang="es">
<head>
	<meta name="robots" content="noindex, nofollow">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="author" content="Fernán Alexander Osorio Castellanos">
	<title>Reporte</title>
	<style type="text/css">
		tr.bg-danger {
			background-color: #ffebee;
		}
		td {
			padding-right: 8px;
		}
		th {
			text-align: left;
		}
		p, td {
			font-family: Verdana, Geneva, sans-serif;
			vertical-align:top;
		}
		table {
			margin-left: -2px
		}
		hr {
			border: none;
			border-top: dashed 1px #9e9e9e;
			padding: 0px;
			margin: 0px;
			margin-top: -20px;
		}
	</style>
</head>
<body style="font-size:0.7rem">

	<table style="margin-bottom: 5px">
		<tr>
			<?php /* 700px en total */ ?>
			<td style="width: 343px">
				<p style="text-transform: uppercase; margin-bottom: 3px;">
					<b><?php echo e($empresa->nombre); ?></b> <br> <b>NIT:</b> <?php echo e($empresa->nit); ?><br>
					<b>Teléfonos:</b> <?php echo e($empresa->telefono); ?> - <b>Fax:</b> <?php echo e($empresa->fax); ?><br>
					<b>Dirección:</b> <?php echo e($empresa->direccion); ?>

				</p>
				<h2 style="margin-bottom: 2px; margin-top: 10px; text-transform: uppercase;">REPORTE DE <?php echo e($request['tipo_nombre']); ?></h2>
			</td>
			
			<td style="text-align:right; width: 343px"">
				<img style="max-height: 100px" src='<?php echo e(URL::to("img/logotipos/$empresa->logotipo")); ?>'>
			</td>

		</tr>	
	</table>
	<hr>

	<p>
		<b>Programa:</b> <?php echo e($request['programa']); ?> <br>
		<b>Intervalo de fecha:</b> Desde el <?php echo e($request['desde']); ?> hasta el <?php echo e($request['hasta']); ?> <br>
		<b>Cantidad:</b> <?php echo e($request['cantidad']); ?> <br>
	</p>

	<table>
		<thead>
			<tr>
				<?php if($request['tipo'] == 0): ?>
					<th>Estado</th>
				<?php endif; ?>
				<th>Fecha / Hora (24h)</th>
				<?php if(isset($registros[0]->programa)): ?>
					<th>Programa</th>
				<?php endif; ?>
				<th>Documento</th>
				<th>Paciente</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach($registros as $registro): ?>
				<?php if($request['tipo'] == 0): ?>
					<?php if($registro->deleted_at): ?>
						<tr class="bg-danger">
							<td>Inactiva</td>
					<?php else: ?>
						<tr>
							<td>Activa</td>
					<?php endif; ?>
				<?php endif; ?>
					<?php if($request['tipo'] == 1): ?>
						<tr>
					<?php endif; ?>
					<td><?php echo e("$registro->fecha $registro->hora"); ?></td>
					<?php if(isset($registro->programa)): ?>
						<td><?php echo e($registro->programa); ?></td>
					<?php endif; ?>
					<td><?php echo e($registro->documento); ?></td>
					<td><?php echo e($registro->paciente_nombre); ?></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>



</body>
</html>
