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

<?php $__env->startSection('content'); ?>
    <h1 class="page-title"> Experiencia Laboral
        <small></small>
    </h1>
    <div class="portlet light">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject bold uppercase"> Registrar nueva experiencia laboral </span>
            </div>
        </div>
        <div class="portlet-body form">
            <?php echo $__env->make('alerts.index', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <?php echo e(Form::open(array('id' => 'form-validation','route' => 'experiencia.registrar', 'class'=>'form-horizontal'))); ?>

            <div class="form-body">

                <div class="form-group">
                    <label class="control-label col-md-2" for="empresa"> Empresa </label>
                    <div class="col-md-10">
                        <?php echo Form::text('empresa', null, array('placeholder' => '','class' => 'form-control', 'required' => 'required')); ?>

                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-md-2" for="cargo"> Cargo </label>
                    <div class="col-md-10">
                        <?php echo Form::text('cargo', null, array('placeholder' => '','class' => 'form-control', 'required' => 'required')); ?>

                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4" for="fecha_inicio">Fecha inicio</label>
                            <div class="col-md-8">
                                <div id="fecha_inicio" class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                    <?php echo Form::text('fecha_inicio', null, array('class' => 'form-control' , 'required' => 'required')); ?>

                                    <span class="input-group-btn">
                                <button class="btn default" type="button">
                                  <i class="fa fa-calendar"></i>
                                </button>
                            </span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-offset-4 col-md-8">
                                <input type="hidden" name="actual" value="0">
                                <div class="mt-checkbox-inline">
                                    <label class="mt-checkbox mt-checkbox-outline" style="margin-bottom: 0">
                                        <?php echo Form::checkbox('actual'); ?> ¿Trabaja actualmente aqu&iacute;?
                                        <span></span>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4" for="fecha_fin">Fecha fin</label>
                            <div class="col-md-8">
                                <div id="fecha_fin" class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                    <?php echo Form::text('fecha_fin', null, array('class' => 'form-control' , 'required' => 'required')); ?>

                                    <span class="input-group-btn">
                                        <button id="btnFin" class="btn default" type="button">
                                          <i class="fa fa-calendar"></i>
                                        </button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="form-group">
                    <label class="control-label col-md-2" for="funciones"> Funciones </label>
                    <div class="col-md-10">
                        <?php echo Form::textarea('funciones', null, array('placeholder' => '','class' => 'form-control','style' => 'resize:none;', 'required' => 'required')); ?>

                    </div>
                </div>

                <div class="form-actions">
                    <div class="row">
                        <div class="col-md-offset-2 col-md-10">
                            <a href="<?php echo e(url('/perfil#tab_3')); ?>" class="btn default">Cancelar</a>
                            <button id="submitBtn" type="submit" class="btn btn-primary ladda-button" data-style="slide-down">
                                <span class="ladda-label">Guardar</span>
                                <span class="ladda-spinner"></span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <?php echo Form::close(); ?>


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

<?php $__env->startSection('scripts'); ?>
    <script>
        $('input[name=actual]').change(function () {
            $('input[name=fecha_fin]').attr('disabled', this.checked);
            $('#btnFin').attr('disabled', this.checked);
        });

        $('#fecha_inicio').datepicker({
            language: 'es',
            autoclose: true,
            endDate: new Date(),
        })
            .on('changeDate', function(e) {
                $('#fecha_fin').datepicker('setStartDate', e.date);
            });

        $('#fecha_fin').datepicker({
            language: 'es',
            autoclose: true,
            endDate: new Date(),
        })
            .on('changeDate', function(e) {
                $('#fecha_inicio').datepicker('setEndDate', e.date);
            });

        $("#form-validation").validate({
            submitHandler: function (form) {
                var l = Ladda.create(document.querySelector('#submitBtn'));
                l.start();
                form.submit();
            }
        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('template.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>