<?php $__env->startSection('main-body'); ?>
<div class="container-fluid">
    <div class="page-header">
        <div class="row">
            <div class="col-sm-8">
                <h3>Create Profession</h3>
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="/">Dashboard</a></li>
                    <li class="breadcrumb-item"><a href="/professions">Professions</a></li>
                    <li class="breadcrumb-item active">Create</li>
                </ol>
                <span class="pull-right">
                    <button class="btn btn-secondary" onclick="confirmBack('profession')">Cancel</button>
                    <?php if($loggedUser->can('create-professions')): ?>
                    <button class="btn btn-primary action-btn" onclick="confirmation('profession')" id="action-btn" disabled value="profession">Save</button>
                    <?php endif; ?>
                </span>
            </div>
        </div>
    </div>
</div>
<div class="container-fluid" id="referenceId" value="">
    <?php echo Form::open(['route' => 'professions.store', 'method' => 'POST', 'id' => 'profession-form']); ?>

    <div class="row">
        <div class="col-lg-8">
            <div class="card">
                <div class="card-header">
                    <h5>Form</h5>
                </div>
                <div class="card-body">
                    <div class="col-lg-12">
                        <div class="form-group">
                                <?php echo Form::label('name', 'Profession'); ?>

                                <?php echo Form::text('name', '', ['class' => 'form-control', 'required' => 'required', 'maxlength' => '255', 'id' => 'nameId', 'onfocusout' => 'checkValidation(this)', 'onkeyup' => 'checkValidation(this)']); ?>

                                <p class="help-block" style="color:red;" id="nameValidation" class="field-validation"></p>
                            </div>
                            <div class="form-group">
                                <?php echo Form::label('color_hex', 'Color'); ?>

                                <?php echo Form::text('color_hex', '', ['class' => 'form-control', 'required' => 'required', 'id' => 'colorId', 'onfocusout' => 'checkValidation(this)', 'onkeyup' => 'checkValidation(this)']); ?>

                                <p class="help-block" style="color:red;" id="colorhexValidation" class="field-validation"></p>
                            </div>

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

                                <?php echo Form::text('salutation', '', ['class' => 'form-control', 'required' => 'required', 'maxlength' => '100', 'id' => 'salutationId', 'onfocusout' => 'checkValidation(this)', 'onkeyup' => 'checkValidation(this)']); ?>

                                <p class="help-block" style="color:red;" id="salutationValidation" class="field-validation"></p>
                            </div>
                            <div class="form-group">
                                <?php echo Form::label('parent_id', 'Parent Profession'); ?>

                                <?php echo Form::select('parent_id', $parentProfessions, '', ['class' => 'form-control', 'placeholder' => 'Select Profession', 'id' => 'parentId']); ?>

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

</div>
<?php echo $__env->make('modals.confirmation', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('import-scripts'); ?>
<script src="/assets/js/field-validations.js"></script>

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


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

function confirmation(module) {
    $('#confirmation-body').html("Are you sure you want to create this " + module + "?" );
    $('#submit-btn').val(module);
    $('#confirmationModal').modal('show');
}

function submitForm(elem) {
    $('#'+elem.value+'-form').submit();
}

function confirmBack(module) {
    $('#cancel-body').html("Are you sure you want to cancel the creation of this " + module + "?" );
    $('#cancel-btn').val(module);
    $('#cancelModal').modal('show');
}

function cancelForm(elem) {
    window.location.replace('/professions')
}

$(function () {
    $('#colorId').colorpicker();
});


<?php echo $__env->make('notifications.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

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

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/qa/desxpert-admin/resources/views/professions/create.blade.php ENDPATH**/ ?>