<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="row">
            <?php echo $__env->make('admin.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

            <div class="col-md-9">
                <div class="card">
                    <!--div class="card-header">Edit Jury #<?php echo e($jury->id); ?></!--div-->
                    <div class="card-body">
                        <a href="<?php echo e(url('/admin/jury')); ?>" title="Back"><button class="btn btn-warning btn-sm"><i class="fa fa-arrow-left" aria-hidden="true"></i> Retour</button></a>
                        <br />
                        <br />
                        <?php if($errors->any()): ?>
                            <ul class="alert alert-danger">
                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li><?php echo e($error); ?></li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        <?php endif; ?>

                        <form method="POST" id = "editJuryForm" action="<?php echo e(url('/admin/jury/' . $jury->id)); ?>" accept-charset="UTF-8" class="form-horizontal" enctype="multipart/form-data">
                            <?php echo e(method_field('PATCH')); ?>

                            <?php echo e(csrf_field()); ?>


                            <?php echo $__env->make('admin.jury.form', [
                                'formMode' => 'edit',
                                'filieres' => $filieres,
                                'membres_jury' => $membres_jury,
                                'membres_ids' => $membres_ids,
                                'etudiants' => $etudiants,
                                'etudiants_matricules' => $etudiants_matricules,
                                'salles' => $salles
                            ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="<?php echo e(asset('ample-admin-new/plugins/bower_components/jquery/dist/jquery.min.js')); ?>"></script>
<script type="text/javascript">
    $('#editJuryForm').submit(function( event ) {
        event.preventDefault();
        var action = $(this).attr("action");
        var request_method = $(this).attr("method");
        var form_data = $(this).serialize(); //Encode form elements for submission

        $.ajax({
            url : action,
            type: request_method,
            data : form_data
        }).done(function(response) {
            swal({
                title: response.message,
                icon: response.status,
                confirmButtonText:
                'Continue<i class="fa fa-arrow-right"></i>',
            });
            if (response.status == "success") {
                setTimeout(function(){ 
                    window.location = "<?php echo e(url('/admin/jury')); ?>";
                }, 2000);
            }
            if (response.id_jury_conflituel) {
                setTimeout(function(){ 
                    var host = "<?php echo e(url('')); ?>";
                    var url = "/admin/jury/" + response.id_jury_conflituel
                    console.log('host :', host, ',  url:', url)
                    window.open(host  + url);
                    window.focus()
                }, 500);
            }
        });
    });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/africawebstudent/public_html/aws/gestjury/resources/views/admin/jury/edit.blade.php ENDPATH**/ ?>