<thead>
		<tr>
		<th class="asc" id="documento">
			<span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span>
			Documento
		</th>
		<th id="apellido_1">
			<span class="glyphicon" aria-hidden="true"></span>
			Apellido 1
		</th>
		<th id="apellido_2">
			<span class="glyphicon" aria-hidden="true"></span>
			Apellido 2
		</th>
		<th id="nombre_1">
			<span class="glyphicon" aria-hidden="true"></span>
			Nombre 1
		</th>
		<th id="nombre_2">
			<span class="glyphicon" aria-hidden="true"></span>
			Nombre 2
		</th>
		<th id="firma">
			<span class="glyphicon" aria-hidden="true"></span>
			Firma
		</th>
		
		<!-- <th>Estado Civil</th>
		<th>Dirección</th>
		<th>Teléfonos</th>
		<th>Ubicación</th>
		<th>Acudiente 1</th>
		<th>Acudiente 2</th> -->
		<?php if(Auth::user()->id == 1 || Auth::user()->permisos['responsables'] != 'r'): ?>
			<th>Operaciones</th>
		<?php endif; ?>
	</tr>
</thead>
<tbody>
	<?php foreach($responsables as $responsable): ?>
		<?php if($responsable->deleted): ?>
			<tr class="danger">
		<?php else: ?>
			<tr>
		<?php endif; ?>
			<td><?php echo e($responsable->documento); ?></td>
			<td><?php echo e($responsable->apellido_1); ?></td>
			<td><?php echo e($responsable->apellido_2); ?></td>
			<td><?php echo e($responsable->nombre_1); ?></td>
			<td><?php echo e($responsable->nombre_2); ?></td>
			<td>
				<img height="22" src='<?php echo e(URL::to("/img/firmas/$responsable->firma")); ?>'>
			</td>
			
				<?php if($responsable->deleted): ?>
					<?php if(Auth::user()->id == 1 || strstr(Auth::user()->permisos['responsables'], 'd')): ?>
						<td>
							<?php echo Form::open(['route'=>['responsable.destroy', 'r'.$responsable->id], 'method'=>'DELETE']); ?>

								<?php echo Form::submit('Habilitar', ['class' => 'btn btn-success btn-xs']); ?>

							<?php echo Form::close(); ?>

						</td>
					<?php endif; ?>
				<?php else: ?>
					<?php if(Auth::user()->id == 1 || (strstr(Auth::user()->permisos['responsables'], 'd') && strstr(Auth::user()->permisos['responsables'], 'u'))): ?>
						<td>
							<?php echo Form::open(['route'=>['responsable.destroy', $responsable->id], 'method'=>'DELETE']); ?>

								<?php echo link_to_route(
									'responsable.edit',
									$title = 'Editar',
									$parameters = $responsable->id,
									$attributes = ['class'=>'btn btn-primary btn-xs'] 
								); ?>

								<?php echo Form::submit('Inhabilitar', ['class' => 'btn btn-danger btn-xs']); ?>

							<?php echo Form::close(); ?>

						</td>
					<?php endif; ?>
					<?php if(!strstr(Auth::user()->permisos['responsables'], 'd') && strstr(Auth::user()->permisos['responsables'], 'u')): ?>
						<td>
							<?php echo link_to_route(
								'responsable.edit',
								$title = 'Editar',
								$parameters = $responsable->id,
								$attributes = ['class'=>'btn btn-primary btn-xs'] 
							); ?>

						</td>
					<?php endif; ?>
					<?php if(strstr(Auth::user()->permisos['responsables'], 'd') && !strstr(Auth::user()->permisos['responsables'], 'u')): ?>
						<td>
							<?php echo Form::open(['route'=>['responsable.destroy', $responsable->id], 'method'=>'DELETE']); ?>

								<?php echo Form::submit('Inhabilitar', ['class' => 'btn btn-danger btn-xs']); ?>

							<?php echo Form::close(); ?>

						</td>
					<?php endif; ?>
				<?php endif; ?>
			</td>
		</tr>
	<?php endforeach; ?>
</tbody>