<?php $__env->startSection('title', 'Teacher'); ?>
<?php $__env->startSection('link'); ?>
<link rel="stylesheet" href="<?php echo e(asset('bower_components/select2/dist/css/select2.min.css')); ?>"/>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="pcoded-inner-content">
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-body">
                <?php echo $__env->make('includes._alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                <div class="card">
                    <div class="card-header mb-0 pb-0">
                        <div class="d-flex justify-content-between pb-1">                        
                            <h4><?php echo e($user ? 'Edit':'Add'); ?> Teacher</h4>
                            <span class="form-control-variant">Les champ avec asterisk (<code>*</code>) sont obligatoires.</span>
                            <span>
                                <?php if(!$user): ?>
                                <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-toggle="modal" data-target="#upload" title="Import File"> <i class="fas fa-ellipsis-h m-0"></i></button>
                                <?php endif; ?>
                                <a href="<?php echo e(route('user.index')); ?>" class="btn btn-inverse btn-outline-inverse  btn-sm py-1" title="Return Back"><i class="fas fa-reply mx-0"></i></a>
                            </span>
                        </div>
                    </div>
                    <hr class="my-0 mx-3">
                    <div class="card-block mt-3 mx-3">
                        <form action="<?php echo e(route($user ? 'user.update':'user.store', $user ? $user->id:'')); ?>" method="post" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field($user ?  'put':'post'); ?>
                            <div class="form-group row">
                                <input type="hidden" name="profilUser" value="<?php echo e($role['id']); ?>">
                                <div class="col-sm-10 offset-sm-2">
                                    <span class="mr-2">
                                        <label class="col-sm-2 col-form-label text-right">Type Enseignant :</label>
                                        <span class="mr-2">
                                            <input type="radio" class="enseignant" name="enseignant" id="maitre" value="maitre" <?php echo e($user ? ($user->typeEnseignant == 'maitre' ? 'checked':null):null); ?>>
                                            <label for="maitre" class="mx-1 form-control-variant">Instituteur</label>
                                        </span>
                                        <span class="ml-2">
                                            <input type="radio" class="enseignant" name="enseignant" id="professeur" value="professeur" <?php echo e($user ? ($user->typeEnseignant == 'professeur' ? 'checked':null):'checked'); ?>>
                                            <label for="professeur" class="mx-1 form-control-variant">Professeur</label>
                                        </span>
                                    </span>
                                    <span class="ml-2">
                                        <label class="col-sm-2 col-form-label text-right">Autorisation :</label>
                                        <span class="mr-2">
                                            <input type="radio" class="autorisation" name="auto" id="oui" value="1" <?php echo e($user ? ($user->autorisation == 1 ? 'checked':null):'checked'); ?>>
                                            <label for="oui" class="mx-1 form-control-variant">Oui</label>
                                        </span>
                                        <span class="mx-2">
                                            <input type="radio" class="autorisation" name="auto" id="non" value="0" <?php echo e($user ? ($user->autorisation == 0 ? 'checked':null):null); ?>>
                                            <label for="non" class="mx-1 form-control-variant">Non</label>
                                        </span>
                                    </span>
                                </div>
                            </div>

                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="firstNameUser">Nom Enseignant<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="firstNameUser" id="firstNameUser" class="form-control <?php $__errorArgs = ['firstNameUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('firstNameUser', $user ? $user->first_name:'')); ?>" placeholder="Nom Enseignant ...">
                                    <?php $__errorArgs = ['firstNameUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="latsNameUser">Prénoms Enseignant<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="latsNameUser" id="latsNameUser" class="form-control <?php $__errorArgs = ['latsNameUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('latsNameUser', $user ? $user->last_name:'')); ?>" placeholder="Prénoms Enseignant ...">
                                    <?php $__errorArgs = ['latsNameUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="sexeUser">Sexe Enseignant<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <span class="mr-3">
                                        <input type="radio" name="sexeUser" id="femme" value="F" <?php echo e($user ? ($user->sexe == 'F' ? 'checked':null):null); ?>>
                                        <label for="femme" class="mx-1 form-control-variant">Femme</label>
                                    </span>
                                    <span class="mx-3">
                                        <input type="radio" name="sexeUser" id="homme" value="H" <?php echo e($user ? ($user->sexe == 'H' ? 'checked':null):'checked'); ?>>
                                        <label for="homme" class="mx-1 form-control-variant">Homme</label>
                                    </span> <br>
                                    <?php $__errorArgs = ['sexeUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="mailUser">E-mail Enseignant<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="email" name="mailUser" id="mailUser" class="form-control <?php $__errorArgs = ['mailUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('mailUser', $user ? $user->email:'')); ?>" placeholder="E-mail Enseignant ...">
                                    <?php $__errorArgs = ['mailUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="numUser">Téléphone Enseignant<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="numUser" id="numUser" class="form-control <?php $__errorArgs = ['numUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('numUser', $user ? $user->telephon:'')); ?>"  maxlength="10" placeholder="Téléphone Enseignant ...">
                                    <?php $__errorArgs = ['numUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="residence">Lieu de résidence<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="residence" id="residence" class="form-control <?php $__errorArgs = ['residence'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('residence', $user ? $user->residence:'')); ?>" placeholder="Lieu de résidence ...">
                                    <?php $__errorArgs = ['residence'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="sexeUser">Situation matrimoniale<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10" title="Situation matrimoniale">
                                    <span class="mr-3">
                                        <input type="radio" name="matrimonialUser" id="celibataire" value="célibataire" <?php echo e($user ? ($user->matrimoniale == 'célibataire' ? 'checked':null):null); ?>>
                                        <label for="celibataire" class="mx-1 form-control-variant">Célibataire</label>
                                    </span>
                                    <span class="mx-3">
                                        <input type="radio" name="matrimonialUser" id="marie" value="marié" <?php echo e($user ? ($user->matrimoniale == 'marié' ? 'checked':null):'checked'); ?>>
                                        <label for="marie" class="mx-1 form-control-variant">Marié(e)</label>
                                    </span> <br>
                                    <?php $__errorArgs = ['matrimonialUser'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row" id="divDiplome" style="display: none">
                                <label class="col-sm-2 col-form-label text-right" for="diplome">Dernier diplôme<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="diplome" id="diplome" class="form-control <?php $__errorArgs = ['diplome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('diplome', $user ? $user->diplome:'')); ?>" placeholder="Dernier diplôme ...">
                                    <?php $__errorArgs = ['diplome'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row" id="divNumAuto" style="display: none">
                                <label class="col-sm-2 col-form-label text-right" for="numAuto">N° Autorisation<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="text" name="numAuto" id="numAuto" class="form-control <?php $__errorArgs = ['numAuto'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('numAuto', $user ? $user->num_autorisation:'')); ?>" placeholder="Numéro autorisation ...">
                                    <?php $__errorArgs = ['numAuto'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row" id="divDateAuto" style="display: none">
                                <label class="col-sm-2 col-form-label text-right" for="dateAuto">Date Autorisation<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <input type="date" name="dateAuto" id="dateAuto" class="form-control <?php $__errorArgs = ['dateAuto'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" value="<?php echo e(old('dateAuto', $user ? $user->date_autorisation:'')); ?>" placeholder="Date autorisation ...">
                                    <?php $__errorArgs = ['dateAuto'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right">Type d'embauche<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <span class="mr-3">
                                        <input type="radio" name="typeEmbauche" id="permanent" value="permanent" <?php echo e($user ? ($user->embauche == 'permanent' ? 'checked':null):null); ?>>
                                        <label for="permanent" class="mx-1 form-control-variant">Permanent</label>
                                    </span>
                                    <span class="mx-3">
                                        <input type="radio" name="typeEmbauche" id="vacataire" value="vacataire" <?php echo e($user ? ($user->embauche == 'vacataire' ? 'checked':null):'checked'); ?>>
                                        <label for="vacataire" class="mx-1 form-control-variant">Vacataire</label>
                                    </span> <br>
                                    <?php $__errorArgs = ['typeEmbauche'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row" id="divDisciplin">
                                <label class="col-sm-2 col-form-label text-right" for="discipline">Disciplines Enseignées<span class="text-danger">*</span> :</label>
                                <div class="col-sm-10">
                                    <select name="discips[]" id="discipline" class="form-control <?php $__errorArgs = ['discips'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" multiple="multiple">
                                        <option value="<?php echo e($user ? $user->role_id:''); ?>"><?php echo e($user ? ucwords($user->role->role):'Choise one option'); ?></option>
                                        <?php $__currentLoopData = $disciplies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($item->id); ?>"  <?php echo e(in_array($item->id, old('discips', [])) ? 'selected' : ''); ?> <?php echo e($user ? ((in_array($item->id, old('discips', $user->matter_users->pluck('matter_id')->toArray() ?? []))) ? 'selected' : ''):null); ?>>
                                                <?php echo e(ucwords($item->libelle)); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                    <?php $__errorArgs = ['discips'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label text-right" for="img">Photo Enseignant :</label>
                                <div class="col-sm-10">
                                    <input type="file" name="img" id="img" class="form-control">
                                    <?php $__errorArgs = ['img'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                        <span class="form-bar text-danger" role="alert">
                                            <?php echo e($message); ?>

                                        </span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <?php if($user): ?>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label" for="img"></label>
                                <div class="col-sm-10">
                                    <input type="checkbox" name="status" id="status" <?php echo e($user->status ? 'checked':''); ?>>
                                    <label for="status" class="mx-1 form-control-variant"><?php echo e($user->status ? 'Actif':'Inactif'); ?></label>
                                </div>
                            </div>
                            <?php endif; ?>
                            <hr class="text-center" style="margin-top: 30px">
                            <div class="text-center">
                                <button type="submit" class="btn btn-inverse btn-outline-inverse py-2"> <i class="fas fa-check-circle"></i> Valider les informations</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Modal Import User -->
<div class="modal fade" id="upload" tabindex="-1" role="dialog" aria-labelledby="uploadLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header bg-dark py-2">
          <h5 class="modal-title" id="uploadLabel">Import File Teacher</h5>
        </div>
        <form action="<?php echo e(route('user.import')); ?>" method="post" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <div class="modal-body px-3 py-4">
                <div class="form-group mt-2 mb-0">
                    <span class="d-flex justify-content-between mb-2">
                        <label for="firstNameUser">Charger la fiche<span class="text-danger">*</span> : </label>
                        <a href="<?php echo e(route('user.download')); ?>" class="btn btn-inverse btn-outline-inverse btn-sm py-1" title="DownLoad File Example"><i class="fas fa-download mx-0"></i> </a>
                    </span>
                    <input type="file" name="files" id="firstNameUser" class="form-control" placeholder="Charger le fichier de format Excel">
                </div>
                <span class="my-0" style="font-size: 11px; text-color:gray">Cette fiche concernant uniquement le profil Enseignant</span>
            </div>
            <div class="modal-footer">
                <a href="#" class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-dismiss="modal">Annuler</a>
                <button type="submit" class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2">Valider</button>
            </div>
        </form>
      </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('assets/js/pcoded.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/vartical-layout.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/js/jquery.mCustomScrollbar.concat.min.js')); ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
<script>
    $(document).ready(function(){

        $vals = $('input[name=enseignant]:checked').val();
        if($vals == 'professeur'){
            $('#divDisciplin').slideDown(); $('#discipline').attr('name', 'discips[]');
        }
        else{
            $('#divDisciplin').slideUp(); $('#discipline').attr('name', '');
        }
        
        $('#discipline').select2({
            placeholder: "Choisissez Des Options ...",
            allowClear: true
        });

        $('input[name="auto"]:checked').val() == 1 ? 
        $('#divDiplome, #divDateAuto, #divNumAuto').slideDown():
        $('#divDiplome, #divDateAuto, #divNumAuto').slideUp();

        $('.autorisation').on('click', function(){
            $(this).val() != 0 ? $('#divDiplome, #divDateAuto, #divNumAuto').slideDown():$('#divDiplome, #divDateAuto, #divNumAuto').slideUp();
        });


        $('.enseignant').on('change', function() {
            if($(this).val() == 'professeur'){
                $('#divDisciplin').slideDown(1000); $('#discipline').attr('name', 'discips[]');
            }
            else{
                $('#divDisciplin').slideUp(1000); $('#discipline').attr('name', '');
            }
        });

        $('#numUser').on('keypress', function(e) {
            var charCode = e.which ? e.which : e.keyCode;
            if (charCode < 48 || charCode > 57) {
                e.preventDefault(); // Empêche la saisie si ce n'est pas un chiffre
            }
        });
    })
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/educasnsa/public_html/neuroschool/resources/views/pages/users/create.blade.php ENDPATH**/ ?>