<?php $__env->startSection('script'); ?>
    <?php echo Html::script('js/script.js'); ?>

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


<script>
    <?php  echo "var competences = " . json_encode($competenceItems) . "\n";?>
</script>

<?php $__env->startSection('nav'); ?>
    <ul id="dropdown1" class="dropdown-content" style="top : 20px">
        <li><a href="/auth/logout" class="logout">Logout</a></li>
    </ul>
    <nav>
        <div class="nav-wrapper">
            <a href="/" class="brand-logo">Banque</a>
            <ul class="right hide-on-med-and-down">
                <li><a class="dropdown-button" href="#!"
                       data-activates="dropdown1"><?php echo e(\Illuminate\Support\Facades\Auth::user()->login); ?><i
                                class="material-icons right">more_vert</i></a></li>
            </ul>
        </div>
    </nav>

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

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

    <div class="container">
        <div class="filter-ghost close"></div>

        <div class="collection">
            <?php foreach($banqueItems as $banqueItem): ?>
                <a href="#!" class="collection-item banque-item"><?php echo e($banqueItem->label); ?></a>
                <input type="hidden" id="banque-id" value=<?php echo e($banqueItem->id_Banque); ?>>
            <?php endforeach; ?>
        </div>


        <div class="card large hide" id="addBanqueCard">

            <div class="passed card-panel green hide">
                <span class="white-text">Action passed</span>
            </div>

            <div class="failed card-panel red hide">
                <span class="white-text">Action failed</span>
            </div>

            <div class="header-title card-panel white show">
                <span class="black-text">Add to bank</span>
            </div>

            <div class="progress hide">
                <div class="indeterminate"></div>
            </div>

            <div class="card-content nano" style="height: 74% !important;">
                <div class="nano-content">

                    <div class="row">
                        <form class="col s12 banque-form" method="post" action="/banque/add">

                            <?php echo csrf_field(); ?>


                            <div class="row">
                                <div class="input-field col s6">
                                    <select name="id_Contexte" id="id_Contexte">
                                        <option value="" disabled selected>Choisir contexte</option>
                                        <?php foreach($contexteItems as $contexteItem): ?>
                                            <option value=<?php echo e($contexteItem->id_Contexte); ?>><?php echo e($contexteItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Contexte:</label>
                                </div>
                                <div class="input-field col s6">
                                    <select name="id_Systeme" id="id_Systeme">
                                        <option value="" disabled selected>Choisir systeme</option>
                                        <?php foreach($systemeItems as $systemeItem): ?>
                                            <option value=<?php echo e($systemeItem->id_Systeme); ?>><?php echo e($systemeItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Systeme:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s6">
                                    <select name="id_Domaine" id="id_Domaine">
                                        <option value="" disabled selected>Choisir domaine</option>
                                        <?php foreach($domaineItems as $domaineItem): ?>
                                            <option value=<?php echo e($domaineItem->id_Domaine); ?>><?php echo e($domaineItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Domaine:</label>
                                </div>
                                <div class="input-field col s6">
                                    <select name="id_Critere" id="id_Critere">
                                        <option value="" disabled selected>Choisir critere</option>
                                        <?php foreach($critereItems as $critereItem): ?>
                                            <option value=<?php echo e($critereItem->id_Critere); ?>><?php echo e($critereItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Critere:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s6">
                                    <input placeholder=" " id="label" type="text" name="label">
                                    <label for="label">Label:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                <textarea id="situation_Clinique" class="materialize-textarea"
                                          name="situation_Clinique"></textarea>
                                    <label for="situation_Clinique">Situation clinique:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                <textarea id="instruction_Etudiant" class="materialize-textarea"
                                          name="instruction_Etudiant"></textarea>
                                    <label for="instruction_Etudiant">Instruction etudiant:</label>
                                </div>
                            </div>

                        </form>

                        <div class="col s12">
                            <label>Items:</label>
                        </div>

                        <div class="row items">

                            <div class="titre">

                                <div id="titre1">

                                    <form class="col s12 titre-form" method="post" action="/titre/add">

                                        <?php echo csrf_field(); ?>


                                        <div class="input-field col s9">
                                            <input placeholder="Titre" id="nom" type="text" name="nom">
                                        </div>

                                        <div class="input-field col s2">
                                            <input placeholder="Ponderation" id="ponderation" type="number"
                                                   name="ponderation">
                                        </div>

                                    </form>

                                    <div class="titre-item">

                                        <div id="item1">

                                            <form class="col s12 item-form" method="post">

                                                <?php echo csrf_field(); ?>


                                                <div class="input-field col s8">
                                                    <input placeholder="Item" id="label" type="text" name="label">
                                                </div>

                                                <div class="input-field col s2">
                                                    <input placeholder="Ponderation" id="valeur" type="number"
                                                           name="valeur">
                                                </div>

                                                <div class="input-field col m1 item_comp">
                                                    <select id="id_Competence" name="id_Competence">
                                                        <?php foreach($competenceItems as $competenceItem): ?>
                                                            <option value=<?php echo e($competenceItem->id_Competence); ?>><?php echo e($competenceItem->prefix); ?></option>
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div>

                                                <input id="id_TitreGItem" type="hidden"
                                                       name="id_TitreGItem">

                                            </form>

                                        </div>

                                    </div>

                                    <div class="row">
                                        <a href="#" class="add-item" style="margin-left: 33px;" onclick="addItem(this)">Ajouter
                                            item</a>
                                    </div>

                                </div>

                            </div>

                            <div class="row">
                                <a href="#" class="add-titre" style="margin-left: 33px;" onclick="addTitre(this)">Ajouter
                                    titre</a>
                            </div>
                            <div class="files">
                                <div id="file1">

                                    <form class="col s12 file-form" method="post" action="/file/add" enctype="multipart/form-data">
                                        <?php echo csrf_field(); ?>

                                        <div class="file-field input-field">
                                            <div class="btn">
                                                <span>File</span>
                                                <input type="file" name="file" id="file">
                                            </div>
                                            <div class="file-path-wrapper">
                                                <input class="file-path validate" type="text" id="file-name">
                                            </div>
                                        </div>
                                    </form>
                                </div>

                            </div>
                            <div class="row">
                                <a href="#" class="add-file" style="margin-left: 33px;" onclick="addFile(this)">Ajouter
                                    fichier</a>
                            </div>

                        </div>
                    </div>

                    <br>
                    <br>
                </div>
            </div>
            <div class="card-action">
                <a href="#" class="banque-submit-add">Submit</a>
                <a href="#" class="banque-reset-add">Reset</a>
            </div>
        </div>

        <div class="card large hide" id="editBanqueCard">

            <div class="passed card-panel green hide">
                <span class="white-text">Action passed</span>
            </div>

            <div class="failed card-panel red hide">
                <span class="white-text">Action failed</span>
            </div>

            <div class="header-title card-panel white show">
                <span class="black-text">Edit bank</span>
            </div>

            <div class="progress hide">
                <div class="indeterminate"></div>
            </div>

            <div class="card-content nano" style="height: 74% !important;">
                <div class="nano-content">

                    <div class="row">
                        <form class="col s12 banque-form" method="post" action="/banque/update">

                            <?php echo csrf_field(); ?>


                            <div class="row">
                                <div class="input-field col s6">
                                    <select name="id_Contexte" id="id_Contexte">
                                        <option value="" disabled selected>Choisir contexte</option>
                                        <?php foreach($contexteItems as $contexteItem): ?>
                                            <option value=<?php echo e($contexteItem->id_Contexte); ?>><?php echo e($contexteItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Contexte:</label>
                                </div>
                                <div class="input-field col s6">
                                    <select name="id_Systeme" id="id_Systeme">
                                        <option value="" disabled selected>Choisir systeme</option>
                                        <?php foreach($systemeItems as $systemeItem): ?>
                                            <option value=<?php echo e($systemeItem->id_Systeme); ?>><?php echo e($systemeItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Systeme:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s6">
                                    <select name="id_Domaine" id="id_Domaine">
                                        <option value="" disabled selected>Choisir domaine</option>
                                        <?php foreach($domaineItems as $domaineItem): ?>
                                            <option value=<?php echo e($domaineItem->id_Domaine); ?>><?php echo e($domaineItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Domaine:</label>
                                </div>
                                <div class="input-field col s6">
                                    <select name="id_Critere" id="id_Critere">
                                        <option value="" disabled selected>Choisir critere</option>
                                        <?php foreach($critereItems as $critereItem): ?>
                                            <option value=<?php echo e($critereItem->id_Critere); ?>><?php echo e($critereItem->nom); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <label>Critere:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s6">
                                    <input placeholder=" " id="label" type="text" name="label">
                                    <label for="label">Label:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                <textarea id="situation_Clinique" class="materialize-textarea"
                                          name="situation_Clinique"></textarea>
                                    <label for="situation_Clinique">Situation clinique:</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                <textarea id="instruction_Etudiant" class="materialize-textarea"
                                          name="instruction_Etudiant"></textarea>
                                    <label for="instruction_Etudiant">Instruction etudiant:</label>
                                </div>
                            </div>

                        </form>

                        <div class="col s12">
                            <label>Items:</label>
                        </div>

                        <div class="row items">

                            <div class="titre">

                                <div id="titre1">

                                    <form class="col s12 titre-form" method="post" action="/titre/edit">

                                        <?php echo csrf_field(); ?>


                                        <div class="input-field col s9">
                                            <input placeholder="Titre" id="nom" type="text" name="nom">
                                        </div>

                                        <div class="input-field col s2">
                                            <input placeholder="Ponderation" id="ponderation" type="number"
                                                   name="ponderation">
                                        </div>

                                    </form>

                                    <div class="titre-item">

                                        <div id="item1">

                                            <form class="col s12 item-form" method="post">

                                                <?php echo csrf_field(); ?>


                                                <div class="input-field col s8">
                                                    <input placeholder="Item" id="label" type="text" name="label">
                                                </div>

                                                <div class="input-field col s2">
                                                    <input placeholder="Ponderation" id="valeur" type="number"
                                                           name="valeur">
                                                </div>

                                                <div class="input-field col m1 item_comp">
                                                    <select id="id_Competence" name="id_Competence">
                                                        <?php foreach($competenceItems as $competenceItem): ?>
                                                            <option value=<?php echo e($competenceItem->id_Competence); ?>><?php echo e($competenceItem->prefix); ?></option>
                                                        <?php endforeach; ?>
                                                    </select>
                                                </div>

                                            </form>

                                        </div>

                                    </div>

                                    <div class="row">
                                        <a href="#" class="add-item" style="margin-left: 33px;" onclick="addItem(this)">Ajouter
                                            item</a>
                                    </div>

                                </div>

                            </div>

                            <div class="row">
                                <a href="#" class="add-titre" style="margin-left: 33px;" onclick="addTitre(this)">Ajouter
                                    titre</a>
                            </div>
                            <div class="files">
                                <div id="file1">

                                    <form class="col s12 file-form" method="post" action="/file/add" enctype="multipart/form-data">
                                        <?php echo csrf_field(); ?>

                                        <div class="file-field input-field">
                                            <div class="btn">
                                                <span>File</span>
                                                <input type="file" id="file" name="file">
                                            </div>
                                            <div class="file-path-wrapper">
                                                <input class="file-path validate" type="text" id="file-name">
                                            </div>
                                        </div>
                                    </form>
                                </div>

                            </div>
                            <div class="row">
                                <a href="#" class="add-file" style="margin-left: 33px;" onclick="addFile(this)">Ajouter
                                    fichier</a>
                            </div>

                        </div>
                    </div>

                    <br>
                    <br>
                </div>
            </div>
            <div class="card-action">
                <a href="#" class="banque-submit-edit">Submit</a>
                <a href="#" class="banque-reset-edit">Reset</a>
            </div>
        </div>

    </div>
    <div class="fixed-action-btn" style="bottom: 45px; right: 24px;">
        <a class="btn-floating waves-effect waves-light btn-large red" id="addBanqueBtn"><i
                    class="material-icons">add</i></a>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>