
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="GestJury - Gestion efficace des soutenances">
    <meta name="author" content="iitech-benin">
    <link rel="icon" type="image/png" sizes="16x16" href="https://progiciel.geststudent.net/plugins/images/favicon.png">
    <title>GestJury</title>
    <!-- Bootstrap Core CSS -->
    <link href="{{ asset('ample-admin-new/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
    <!-- animation CSS -->
    <link href="{{ asset('ample-admin-new/css/animate.css') }}" rel="stylesheet">
    <!-- Menu CSS -->
    <link href="{{ asset('ample-admin-new/plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.css') }}" rel="stylesheet">
    <!-- page CSS -->
    <link href="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/custom-select/custom-select.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/switchery/dist/switchery.min.css') }}" rel="stylesheet" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-select/bootstrap-select.min.css') }}" rel="stylesheet" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css') }}" rel="stylesheet" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css') }}" rel="stylesheet" />
    <link href="{{ asset('ample-admin-new/plugins/bower_components/multiselect/css/multi-select.css') }}" rel="stylesheet" type="text/css" />
    <!-- Custom CSS -->
    <link href="{{ asset('ample-admin-new/css/style.css') }}" rel="stylesheet">
    <!-- color CSS -->
    <link href="{{ asset('ample-admin-new/css/colors/blue-dark.css') }}" id="theme" rel="stylesheet">
    <script src="{{ asset('js/sweetalert.min.js') }}"></script>

    <style>
        .card{
            margin: 20px;
        }
        .content, .content-wrapper{
            background: #fcfcfc;
            height: 100%;
        }
        .swal-modal *{
            text-align: center;
        }
    </style>
<![endif]-->
</head>

<body class="fix-header">
    <!-- ============================================================== -->
    <!-- Preloader -->
    <!-- ============================================================== -->
    
    <!-- ============================================================== -->
    <!-- Wrapper -->
    <!-- ============================================================== -->
    <div id="wrapper">
        <!--div class="preloader">
            <svg class="circular" viewBox="25 25 50 50">
                <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
            </svg>
        </div-->
        <!-- End Top Navigation -->
        <!-- ============================================================== -->
        <!-- Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <nav class="navbar navbar-default navbar-static-top m-b-0">
            <div class="navbar-header">
                <div class="top-left-part">
                    <!-- Logo -->
                    <a class="logo" href="index.html">
                    GestJury </a>
                </div>
                <!-- /Logo -->
                <!-- Search input and Toggle icon -->
                <ul class="nav navbar-top-links navbar-right pull-right">
                    <li class="dropdown">
                        <a class="dropdown-toggle profile-pic" data-toggle="dropdown" href="#">
                            <img src="{{ asset('ample-admin-new/plugins/images/icones/user1.png')}}" alt="user-img" width="36" class="img-circle">
                            <b class="hidden-xs">{{ session('utilisateur')[0]->username }}</b><span class="caret"></span> </a>
                        <ul class="dropdown-menu dropdown-user animated flipInY">
                            <li>
                                <div class="dw-user-box">
                                    <div class="u-img"><img src="{{ asset('ample-admin-new/plugins/images/icones/user1.png')}}" alt="user" /></div>
                                    <div class="u-text">
                                        <h4>{{ session('utilisateur')[0]->username }}</h4>
                                        <p class="text-muted">{{  session('utilisateur')[0]->email }}</p>
                                    </div>
                                </div>
                            </li>
                            <li role="separator" class="divider"></li>
                            <li>
                                <a href="{!! route('user/logout',['mat'=> session('utilisateur')[0]->matricule]) !!}">
                                    <i class="fa fa-power-off"></i> Déconnexion
                                </a>
                            </li>
                        </ul>
                        <!-- /.dropdown-user -->
                    </li>
                    <!-- /.dropdown -->
                </ul>
            </div>
            <!-- /.navbar-header -->
            <!-- /.navbar-top-links -->
            <!-- /.navbar-static-side -->
        </nav>
        <div class="navbar-default sidebar" role="navigation">
            <div class="sidebar-nav">
                <div class="sidebar-head">
                    <h3><span class="fa-fw open-close"><i class="ti-menu hidden-xs"></i><i
                                class="ti-close visible-xs"></i></span> <span class="hide-menu">Dashboard</span></h3>
                </div>
                <ul class="nav" id="side-menu">
                    <li> <a id="managedepart" href="{{ url('/admin/jury') }}" class="waves-effect"><i
                                class="fa fa-list"></i> <span class="hide-menu">Jurys <span
                                    class="fa arrow"></span></span></a>

                    </li>
                    <li> <a href="{{ url('/admin/membre-jury') }}" class="waves-effect"><i
                                class="fa fa-user"></i> <span class="hide-menu">Membres de jury</span></a>
                    </li>
                    <li> <a href="{{ url('/admin/salle') }}" class="waves-effect"><i
                                class="fa fa-calendar"></i> <span class="hide-menu">Salles</span></a>
                    </li>
                    <li> <a href="{{ url('/admin/signataire') }}" class="waves-effect"><i
                                class="fa fa-check"></i> <span class="hide-menu">Signataires</span></a>
                    </li>
                    <li class="devider"></li>
                </ul>
            </div>
        </div>
        <!-- ============================================================== -->
        <!-- End Left Sidebar -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page Content -->
        <!-- ============================================================== -->
        <div id="page-wrapper" style="background: white">
            <div class="row">
                <div class="col-sm-12">
                    <div class="white-box">
                        @yield('content')
                    </div>
                </div>
            </div>
        </div>
        @if(session('success'))
            <div class="alert alert-success" style="height: 0px; width: 0px; visibility: invisible">
                {{  session('success')  }}
            </div>
        @endif
        @if(session('flash_message'))
            <div class="alert alert-success" style="height: 0px; width: 0px; visibility: invisible">
                {{  session('flash_message')  }}
            </div>
        @endif
        @if(session('error_message'))
            <div class="alert alert-danger" style="height: 0px; width: 0px; visibility: invisible">
                {{  session('error_message')  }}
            </div>
        @endif
        <!-- /#wrapper -->
        <!-- jQuery -->
        <script src="{{ asset('ample-admin-new/plugins/bower_components/jquery/dist/jquery.min.js') }}"></script>
        <!-- Bootstrap Core JavaScript -->
        <script src="{{ asset('ample-admin-new/bootstrap/dist/js/bootstrap.min.js') }}"></script>
        <!-- Menu Plugin JavaScript -->
        <script src="{{ asset('ample-admin-new/plugins/bower_components/sidebar-nav/dist/sidebar-nav.min.js') }}"></script>
        <!--slimscroll JavaScript -->
        <script src="{{ asset('ample-admin-new/js/jquery.slimscroll.js') }}"></script>
        <!--Wave Effects -->
        <script src="{{ asset('ample-admin-new/js/waves.js') }}"></script>
        <!-- Custom Theme JavaScript -->
        <script src="{{ asset('ample-admin-new/js/custom.min.js') }}"></script>
        <script src="{{ asset('ample-admin-new/plugins/bower_components/switchery/dist/switchery.min.js') }}"></script>
        <script src="{{ asset('ample-admin-new/plugins/bower_components/custom-select/custom-select.min.js') }}" type="text/javascript"></script>
        <script src="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-select/bootstrap-select.min.js') }}" type="text/javascript"></script>
        <script src="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js') }}"></script>
        <script src="{{ asset('ample-admin-new/plugins/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js') }}" type="text/javascript"></script>
        <script type="text/javascript" src="{{ asset('ample-admin-new/plugins/bower_components/multiselect/js/jquery.multi-select.js') }}"></script>
        <script>
        jQuery(document).ready(function() {
            // Switchery
            var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
            $('.js-switch').each(function() {
                new Switchery($(this)[0], $(this).data());
            });
            // For select 2
            $(".select2").select2();
            $('.selectpicker').selectpicker();
            //Bootstrap-TouchSpin
            $(".vertical-spin").TouchSpin({
                verticalbuttons: true,
                verticalupclass: 'ti-plus',
                verticaldownclass: 'ti-minus'
            });
            var vspinTrue = $(".vertical-spin").TouchSpin({
                verticalbuttons: true
            });
            if (vspinTrue) {
                $('.vertical-spin').prev('.bootstrap-touchspin-prefix').remove();
            }
            $("input[name='tch1']").TouchSpin({
                min: 0,
                max: 100,
                step: 0.1,
                decimals: 2,
                boostat: 5,
                maxboostedstep: 10,
                postfix: '%'
            });
            $("input[name='tch2']").TouchSpin({
                min: -1000000000,
                max: 1000000000,
                stepinterval: 50,
                maxboostedstep: 10000000,
                prefix: '$'
            });
            $("input[name='tch3']").TouchSpin();
            $("input[name='tch3_22']").TouchSpin({
                initval: 40
            });
            $("input[name='tch5']").TouchSpin({
                prefix: "pre",
                postfix: "post"
            });
            // For multiselect
            $('#pre-selected-options').multiSelect();
            $('#optgroup').multiSelect({
                selectableOptgroup: true
            });
            $('#public-methods').multiSelect();
            $('#select-all').click(function() {
                $('#public-methods').multiSelect('select_all');
                return false;
            });
            $('#deselect-all').click(function() {
                $('#public-methods').multiSelect('deselect_all');
                return false;
            });
            $('#refresh').on('click', function() {
                $('#public-methods').multiSelect('refresh');
                return false;
            });
            $('#add-option').on('click', function() {
                $('#public-methods').multiSelect('addOption', {
                    value: 42,
                    text: 'test 42',
                    index: 0
                });
                return false;
            });
        });
        </script>
        <!--Style Switcher -->
        <script src="{{ asset('ample-admin-new/plugins/bower_components/styleswitcher/jQuery.style.switcher.js') }}"></script>
        <script>
            $('input').each(function(){
                console.log($(this).attr('type'))
                if( $(this).attr('type')=='number' ) $(this).attr('required',true)
                else if ( $(this).attr('name')=="email" ){
                    $(this).attr('required',true)
                    $(this).attr('type', "email")
                } 
            })

            $('input').bind('input', function(){
                if( $(this).attr('name')=='search' ) {
                    $('tr').css('display','none')
                    var input_value = $(this).val().toLowerCase()
                    if( input_value=="" ) $('tr').removeAttr('style') 
                    else{
                            $('tr').each(function(){
                                var content =  $(this).text().replace(/\n/gi, "").toLowerCase()
                                if( content.includes(input_value) ){
                                    $(this).css('display','block')
                                } 
                            })
                    }
                }
            })

            $('form button').attr('onclick','').click(function(e) {
                var action_="DELETE"
                if($(this).attr('action')!= undefined) action_=$(this).attr('action')
                if( $(this).find('i').hasClass('fa-search') ) { 
                    e.preventDefault()
                }
                else if (!$(this).hasClass('no-delete')) {
                    e.preventDefault()
                    const wrapper = document.createElement('div');
                    var action = $(this).parent().attr('action')
                    var token=$(this).prev().val()
                    wrapper.innerHTML = '<form method="POST" action="'+action+'" accept-charset="UTF-8" style="display:inline">'+
                                            '<input type="hidden" name="_method" value="'+action_+'">'+
                                            '<input type="hidden" name="_token" value="'+token+'">'+
                                            '<input type="hidden" name="operation" value="'+$(this).attr('operation')+'">'+
                                            `<a href="javascript:swal.close()"  class="btn btn-primary" style="width:200px" >Non</a>
                                            &nbsp&nbsp&nbsp
                                            <button type="submit" class="btn btn-warning" style="color: white; width:200px"  title="Supprimer AjoutStock" > Oui </button>
                                        </form>`;
                    swal({
                        title: "Attention, voulez vous vraiment continuer la suppression ?",
                        content: wrapper, 
                        icon: "warning",
                        buttons: false,
                    });
                } else {
                    return true
                } 
            })
            $('form').submit(function(e){
                if( $(this).attr('role')=="search" ){
                    e.preventDefault()
                }
            })
            $('.alert').each(function(){
                    var message= $(this).text().split(' ').join('').split('\n').join('')
                    if( message != "" ){
                        if($(this).hasClass('alert-success')){
                            swal("Opération réussie !", $(this).text().split('\n').join('') , "success") 
                            //$(this).remove()
                        }
                        else if($(this).hasClass('alert-danger')){
                            swal("Oups !", $(this).text().split('\n').join('') , "error") 
                        // $(this).remove()
                        }
                    }
                })

            $('input').each(function(){
                if($(this).attr('type')== 'number') $(this).attr('min',0)
            })

    </script>
</body>

</html>
