<?php $__env->startSection('title', 'Add School'); ?>
<?php $__env->startSection('content'); ?>
<div class="pcoded-inner-content">
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-header mb-0 pb-0">
                                <div class="d-flex justify-content-between pb-2">
                                    <h4><?php echo e($school ? 'Edition d\'':'Nouvel '); ?>établissement</h4>
                                    <span class="form-control-variant">Les champ avec asterisk (<code>*</code>) sont obligatoires.</span>
                                    <span>
                                        <a href="<?php echo e(route('dashboard')); ?>" 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">
                            <?php if(session('msg')): ?>
                            <div class="alert alert-<?php echo e(session('str')); ?> background-<?php echo e(session('str')); ?> w-50" style="margin: auto">
                                <button class="close btn" data-dismiss="alert" aria-label="Close">
                                    <i class="fas fa-times text-white"></i>
                                </button>
                                <strong><i class="fas fa-check-double"></i> <?php echo e(session('msg')); ?></strong>	
                            </div>
                            <?php endif; ?>
                            <div class="card-block my-3">
                                <form action="<?php echo e(route($school ? 'school.update':'school.store', $school ? $school->id:'')); ?>" method="post">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field($school ? 'put':'post'); ?>
                                    <div class="mb-4">
                                        <strong style="font-size: 19px form-control-variant">Informations Etablissement</strong>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-2 col-form-label text-right" for="belonging">Appartenance<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                                <input type="radio" name="belonging" id="cdec" value="cdec" <?php echo e(old('belonging') == 'cdec' ? 'checked':null); ?> <?php echo e($user ? ($school->belonging == 'cdec' ? 'checked':null):null); ?>>
                                                <label for="cdec" class="mx-1 form-control-variant">SEDEC</label>
                                            </span>
                                            <span class="mx-3">
                                                <input type="radio" name="belonging" id="dren" value="dren" <?php echo e(old('belonging') == 'dren' ? 'checked':null); ?> <?php echo e($user ? ($school->belonging == 'dren' ? 'checked':null):'checked'); ?>>
                                                <label for="dren" class="mx-1 form-control-variant">DREN</label>
                                            </span> <br>
                                            <?php $__errorArgs = ['belonging'];
$__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="nameSchool">Nom de Etablissement<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="nameSchool" id="nameSchool" class="form-control form-control-normal <?php $__errorArgs = ['nameSchool'];
$__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('nameSchool', $school ? $school->name_school:'')); ?>" placeholder="Entrez le nom complet de l'établissement ...">
                                            <?php $__errorArgs = ['nameSchool'];
$__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="numAutorastion">Numéro Autorisation<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="numAutorastion" id="numAutorastion" class="form-control form-control-normal <?php $__errorArgs = ['numAutorastion'];
$__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('numAutorastion',$school ? $school->num_autorisation:'')); ?>" placeholder="Numéro decision autorisation ...">
                                            <?php $__errorArgs = ['numAutorastion'];
$__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="codeSchool">Code Etablissement<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="codeSchool" id="codeSchool" class="form-control form-control-normal <?php $__errorArgs = ['codeSchool'];
$__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('codeSchool', $school ? $school->code_school:'')); ?>" placeholder="Code de l'établissement ...">
                                            <?php $__errorArgs = ['codeSchool'];
$__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>

                                    <hr class="mt-2">

                                    <div class="my-4">
                                        <strong style="font-size: 19px form-control-variant">Informations Admin</strong>
                                    </div>
                                    
                                    <div class="form-group row">
                                        <label class="col-sm-2 col-form-label text-right" for="firstUser">Nom<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="firstUser" id="firstUser" class="form-control form-control-normal <?php $__errorArgs = ['firstUser'];
$__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('firstUser', $user ? $user->first_name:'')); ?>" placeholder="Nom ...">
                                            <?php $__errorArgs = ['firstUser'];
$__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="lastuser">Prénom<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="lastuser" id="lastuser" class="form-control form-control-normal <?php $__errorArgs = ['lastuser'];
$__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('lastuser', $user ? $user->last_name:'')); ?>" placeholder="Prénom ...">
                                            <?php $__errorArgs = ['lastuser'];
$__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<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(old('sexeUser') == 'F' ? 'checked':null); ?> <?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(old('sexeUser') == 'H' ? 'checked':null); ?> <?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="emailUser">Adresse mail<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="email" name="emailUser" id="emailUser" class="form-control form-control-normal <?php $__errorArgs = ['emailUser'];
$__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('emailUser', $user ? $user->email:'')); ?>" placeholder="Adresse mail ...">
                                            <?php $__errorArgs = ['emailUser'];
$__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="numPhon">Téléphone<span class="text-danger">*</span> :</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="numPhon" id="numPhon" class="form-control form-control-normal <?php $__errorArgs = ['numPhon'];
$__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('numPhon', $user ? $user->telephon:'')); ?>" maxlength="10" placeholder="Numéro de téléphone ...">
                                            <?php $__errorArgs = ['numPhon'];
$__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><br class="my-0 py-0">
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>
                                    </div>
                                    <?php if($school): ?>
                                    <div class="form-group row">
                                        <label class="col-sm-2 col-form-label" ></label>
                                        <div class="col-sm-10">
                                            <input type="checkbox" name="status" id="status" <?php echo e($school->status ? 'checked':''); ?>>
                                            <label for="status" class="mx-1 form-control-variant"><?php echo e($school->status ? 'Actif':'Inactif'); ?></label>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                                    <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>
    </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>
    $(document).ready(function(){
        $('#numPhon').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 C:\Users\EDUCAS\Desktop\AppS\V4_001\resources\views\pages\school\create.blade.php ENDPATH**/ ?>