<?php $__env->startSection('content'); ?>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                <?php echo e(trans('general.reservations')); ?>

            </h1>
        </section>


        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <?php echo $__env->make('alert.success', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <?php echo $__env->make('alert.errorlist', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                    <div class="box box-success">
                        <div class="box-body">

				<?php if(count($inspections)>0): ?>

					<h2>Contestaciones</h2>
						<ul>
						    <?php foreach($questions as $q): ?>
						    <?php if(in_array($q->answerId, $inspections)): ?>
						        <li><?php echo e($q->question); ?> - <?php echo e($q->answer); ?></li>
						    <?php endif; ?>
						    <?php endforeach; ?>
				            </ul>

				<?php else: ?>

		                    <?php echo Form::open(['url' => '/reservations/'.$reservation.'/savecheckout', 'method' => 'post']); ?>


		                    <?php 
		                    $questionId = 0;
		                     ?>
		                    <div class="form-group">
		                        <?php foreach($questions as $item): ?>

		                            <?php if($item->questionId != $questionId): ?>
		                    </div>
		                    <div class="form-group">
		                        <p><?php echo e($item->question); ?></p>
		                        <?php endif; ?>
		                        <?php echo e(Form::radio( $item->questionId, $item->answerId)); ?>

		                        <?php echo e(Form::label( $item->questionId, $item->answer)); ?>&nbsp;&nbsp;

		                        <?php 
		                        $questionId = $item->questionId;
		                         ?>

		                        <?php endforeach; ?>
		                    </div>
		                    <?php echo e(Form::hidden('reservation', $reservation)); ?>


		                    <?php echo e(Form::submit('Guardar')); ?>


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


				<?php endif; ?>

                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make(Auth::check() && Auth::user()->role->layout == 1 ? 'layouts.admin' : 'layouts.employee', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>