<?php $__env->startSection('content'); ?>

<div class="content-wrapper">

	<section class="content-header">

		<h1>

		<?php echo e(trans('general.credit')); ?>


		</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 Form::open(['url' => 'users/'.$user->id.'/credits']); ?>

				<?php echo e(method_field('POST')); ?>

					<div class="form-group">
					<?php echo e(Form::label('m', 'Modalidad')); ?>

					<?php echo e(Form::select('m', [
					   '3' => '3 salidas',
					   '7' => '7 salidas',]
					), array('id' => 'modalidad', 'class' => 'form-control')); ?>

					</div>
					<div class="form-group">
					<?php echo e(Form::label('startDate', 'Fecha inicio')); ?>

						<?php echo e(Form::date('startDate', \Carbon\Carbon::now(), null, array('id' => 'startDate', 'class' => 'form-control'))); ?>

					</div>
					<div class="form-group">
					<?php echo e(Form::label('endDate', 'Fecha final')); ?>

						<?php echo e(Form::date('endDate', \Carbon\Carbon::now(), null, array('id' => 'endDate', 'class' => 'form-control'))); ?>

					</div>

					<div class="form-group">
					    <?php echo e(Form::label('boat_id', 'Barco')); ?>

					    <?php echo e(Form::select('boat_id', $boats, array('id' => 'b', 'class' => 'form-control'))); ?>

					</div>

					<?php echo e(Form::hidden('customer_id', $user->id)); ?>


					<?php echo Form::submit(trans('Cargar Salidas'), ['class' => 'btn btn-success btn-flat']); ?>

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


			</div>
			

		</div>
	</section>

	<div id="contenedor"></div>

</div>

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


<?php $__env->startSection('foot'); ?>

<script type="text/javascript">
	const url_to_request_get = "http://localhost:8000";
	function cargarSalidas() {
		console.log('hola');
		$.ajax({
		  url: url_to_request_get+"/generarcreditos.php",
		  method: "GET",
			data: $('#generateCredits').serialize(),
		  dataType: "html"
		}).done(function(data) {
		  $('#contenedor').html(data);
			console.log('Data: '.data);
		});
		return false;
	}

</script>

<?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(); ?>