<div class="panel panel-default">
    <div class="panel-heading">
        <h4>Datos Personales</h4>
    </div>
    <div class="panel-body">

<div class="form-group<?php echo e($errors->has('user_id') ? ' has-error' : ''); ?>">
	<?php echo Form::label('user_id', trans('general.usuario')); ?>


	<?php echo Form::select('user_id', $users, null, ['class' => 'form-control']); ?>


	<?php if($errors->has('user_id')): ?>
		<span class="help-block">
			<strong><?php echo e($errors->first('user_id')); ?></strong>
		</span>
	<?php endif; ?>
</div>
 </div>
</div>


<div class="panel panel-default">
    <div class="panel-heading">
        <h4>Datos Reserva</h4>
    </div>
    <div class="panel-body">

		<div class="form-group<?php echo e($errors->has('reference_number') ? ' has-error' : ''); ?>">
			<?php echo Form::label('reference_number',trans('general.reservationsnumber') ); ?>

			<?php if(isset($reference_number)): ?>
				<?php /*$reference_number */ ?>
			<?php else: ?> <?php echo e($reference_number = null); ?>

			<?php endif; ?>

			<?php echo Form::text('reference_number',$reference_number, ['class' => 'form-control','readonly']); ?>

			<?php if($errors->has('reference_number')): ?>
				<span class="help-block">
			<strong><?php echo e($errors->first('reference_number')); ?></strong>
		</span>
			<?php endif; ?>
		</div>



<div class="form-group<?php echo e($errors->has('boat') || $errors->has('boat') ? ' has-error' : ''); ?>">
        	<?php echo Form::label('boat',  trans('general.boat')); ?><br />
        	<?php echo Form::select('boat_id', $boat, null, ['class' => 'form-control boat']); ?>


	<?php if($errors->has('boat')): ?>
		<span class="help-block">
			<strong><?php echo e($errors->first('boat')); ?></strong>
		</span>
	<?php endif; ?>
</div>

<div class="form-group<?php echo e($errors->has('schedule_id') || $errors->has('schedule_id') ? ' has-error' : ''); ?>">
        	<?php echo Form::label('schedule_id',  trans('general.schedule')); ?><br />
        	<?php echo Form::select('schedule_id', $schedule, null, ['class' => 'form-control schedule']); ?>


	<?php if($errors->has('schedule_id')): ?>
		<span class="help-block">
			<strong><?php echo e($errors->first('schedule_id')); ?></strong>
		</span>
	<?php endif; ?>
</div>

<div class="form-group<?php echo e($errors->has('date_start') ? ' has-error' : ''); ?>">
	<?php echo Form::label('date_start', trans('general.date_start')); ?>

	<div class="input-group">
		<div class="input-group-addon">
		<i class="fa fa-calendar" title="click sobre el campo de texto para que aparezca el calendario"></i>
		</div>
		<?php echo Form::text('date_start', null, ['class' => 'form-control date_start']); ?>


	</div>
	<?php if($errors->has('date_start')): ?>
		<span class="help-block">
			<strong><?php echo e($errors->first('date_start')); ?></strong>
		</span>
	<?php endif; ?>
</div>

 </div>
</div>


<?php if(Auth::user()->role->layout == 1): ?>
<div class="panel panel-default">
    <div class="panel-heading">
        <h4>Estado</h4>
    </div>
    <div class="panel-body">

 <div class="form-group">

 <?php if(isset($status)): ?>
				<?php foreach($status as $estado): ?>
				<?php if($estado->id == 1): ?>
				<span class="label label-success"> <?php echo e($estado->name); ?></span>
				<?php echo Form::radio('status_id', '1'); ?>


				<?php elseif($estado->id == 2): ?>
				<span class="label label-warning">  <?php echo e($estado->name); ?></span>
				<?php echo Form::radio('status_id', '2', true); ?>


				<?php elseif($estado->id == 4): ?>
				<span class="label label-info">  <?php echo e($estado->name); ?></span>
				<?php echo Form::radio('status_id', '4'); ?>


				<?php elseif($estado->id == 3): ?>
				<span class="label label-danger">  <?php echo e($estado->name); ?></span>
				<?php echo Form::radio('status_id', '3'); ?>


				<?php endif; ?>
				<?php endforeach; ?>
				<?php endif; ?>

</div>

 </div>
</div>
<?php else: ?>
<?php echo Form::hidden ('status_id',2); ?>

<?php endif; ?>

<div class="form-group<?php echo e($errors->has('comments') ? ' has-error' : ''); ?>">
	<?php echo Form::label('comments', trans('general.comment')); ?>

	<?php echo Form::textarea('comments', null, ['class' => 'form-control','rows' => '3']); ?>

	<?php if($errors->has('comments')): ?>
		<span class="help-block">
			<strong><?php echo e($errors->first('comments')); ?></strong>
		</span>
	<?php endif; ?>
</div>


<div class="pull-right">
	<?php echo Form::submit(trans('general.save'), ['class' => 'btn btn-success btn-flat']); ?>

	<a href="<?php echo e(asset('/reservations')); ?>" type="button" class="btn btn-default btn-flat"><?php echo e(trans('general.cancel')); ?></a>
</div>
