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

<head>
  <meta charset="UTF-8">
  <title>02 Mai zarzis</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.css" rel="stylesheet" />
  <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
  <script src="https://cdn.tailwindcss.com"></script>
  <script src="https://cdn.jsdelivr.net/npm/flowbite@2.5.2/dist/flowbite.min.js"></script>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
  <style>
    body {
      font-family: 'Inter', sans-serif;
    }
  </style>
</head>

<body class="bg-gray-100 p-8">
  

<nav class=" bg-white border-gray-200 dark:bg-gray-900">
  <div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
  <a class="flex items-center space-x-3 rtl:space-x-reverse">
      
      <span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">02 Mai zarzis</span>
  </a>
  <div class="flex items-center md:order-2 space-x-3 md:space-x-0 rtl:space-x-reverse">
  <button
  type="button"
  class="flex items-center justify-center text-xl rounded-full p-4 md:me-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600 bg-gray-100 dark:bg-gray-800"
  id="user-menu-button"
  aria-expanded="false"
  data-dropdown-toggle="user-dropdown"
  data-dropdown-placement="bottom"
>
  <i class="fa-solid fa-user text-l"></i>
</button>

      <!-- Dropdown menu -->
      <div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded-lg shadow dark:bg-gray-700 dark:divide-gray-600" id="user-dropdown">
        <div class="px-4 py-3">
          <span class="block text-sm text-gray-900 dark:text-white"><?php echo e(Auth::user()->name); ?></span>
          <span class="block text-sm  text-gray-500 truncate dark:text-gray-400"><?php echo e(Auth::user()->email); ?></span>
        </div>
        <ul class="py-2" aria-labelledby="user-menu-button">
          <li>
            <a href="profile" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white">Profil</a>
          </li>
          <li>
          <form method="POST" action="<?php echo e(route('logout')); ?>" class="inline-block">
    <?php echo csrf_field(); ?>
    <a href="<?php echo e(route('logout')); ?>" 
       class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
       onclick="event.preventDefault(); this.closest('form').submit();">
        <?php echo e(__('Se déconnecter')); ?>

    </a>
</form>

          </li>
        </ul>
      </div>
      <button data-collapse-toggle="navbar-user" type="button" class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="navbar-user" aria-expanded="false">
        <span class="sr-only">Open main menu</span>
        <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
            <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/>
        </svg>
    </button>
  </div>
  <div class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1" id="navbar-user">
    <ul class="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700">
      <!-- <li>
        <a href="#" class="block py-2 px-3 text-white text-gray-900 rounded md:bg-transparent md:text-gray-900 md:p-0 md:dark:text-gray-900" aria-current="page">Parents</a>
      </li> -->
      <li>
        <a href="/annees" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Année Scolaire</a>
      </li>
      
      <li>
        <a href="/profs" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Enseignants</a>
      </li>
      <li>
        <a href="/eleves" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Eleve</a>
      </li>
      <li>
        <a href="/classes" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Classe</a>
      </li>
      <li>
        <a href="/matieres" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Matière</a>
      </li>
      <!-- <li>
        <a href="#" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Bulletin</a>
      </li> -->
    </ul>
  </div>
  </div>
</nav>

<div class="py-4"></div>

<form class="max-w-lg mx-auto">
    <div class="flex">
        <label for="search-dropdown" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Your Email</label>
        <button id="dropdown-button" data-dropdown-toggle="dropdown" class="flex-shrink-0 z-10 inline-flex items-center py-2.5 px-4 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700 dark:text-white dark:border-gray-600" type="button">Recherche</button>

        <div class="relative w-full">
            <input type="search" id="search-dropdown" class="block p-2.5 w-full z-20 text-sm text-gray-900 bg-gray-50 rounded-e-lg border-s-gray-50 border-s-2 border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-s-gray-700  dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:border-blue-500" placeholder="" required />
            <button type="submit" class="absolute top-0 end-0 p-2.5 text-sm font-medium h-full text-white bg-blue-700 rounded-e-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
                <svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
                </svg>
                <span class="sr-only">Search</span>
            </button>
        </div>
    </div>
    <div class="py-4"></div>

<div class="max-w-[600px] h-[40px] flex items-center justify-center bg-[#113C6B] rounded-full px-4">
    <span class="text-white text-sm"> les classes de enseignant <?php echo e($prof->first_name); ?> <?php echo e($prof->last_name); ?></span>
</div>
</form>


<div class="py-4"></div>

  <div class="max-w-7xl mx-auto grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
    <!-- Card -->
    <!-- <div class="bg-gray-100 rounded-lg shadow p-4 border-2 border-dashed border-gray-300 flex items-center justify-center h-40">
        <button data-modal-target="crud-modal" data-modal-toggle="crud-modal" class="text-gray-700 hover:text-gray-700">
            <span class="font-semibold text-lg">Créer Une Nouvelle Classe</span>
        </button>
    </div> -->

    <!-- Duplicate Cards -->

    <?php $__currentLoopData = $matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
   

        
    <div class="card-container bg-white rounded-lg shadow p-4">
    <div class="flex items-center justify-between">
        <div>
        <a >
                <h2 class="text-lg font-semibold text-gray-900" data-name="<?php echo e($matiere['class_name'] ?? 'N/A'); ?>"><?php echo e($matiere['class_name'] ?? 'N/A'); ?></h2>
            </a>
            <span class="text-sm text-gray-500 flex items-center gap-1">
                <span class="bg-green-100 text-green-800 text-xs font-medium px-2 py-1 rounded" data-year="<?php echo e($matiere['class_year'] ?? 'N/A'); ?>"><?php echo e($matiere['class_year'] ?? 'N/A'); ?></span>
            </span>
          


        </div>
        <i class="fa fa-graduation-cap text-gray-500 text-3xl"></i>
    </div>
    <div class="flex mt-4 border-t pt-4 space-x-4">
        <div class="flex gap-20">
   

       

            <div class="flex gap-2">
                <a href="<?php echo e(route('classes.data', ['ids' => 1, 'idp' => $prof->id, 'idc' => $matiere['class_id'], 'idm' => $matiere['matiere_id']])); ?>" class="bg-green-100 text-gray-800 text-sm font-medium py-1 px-3 rounded">1</a>
                <a href="<?php echo e(route('classes.data', ['ids' => 2, 'idp' => $prof->id, 'idc' => $matiere['class_id'], 'idm' => $matiere['matiere_id']])); ?>" class="bg-green-100 text-gray-800 text-sm font-medium py-1 px-3 rounded">2</a>
                <a href="<?php echo e(route('classes.data', ['ids' => 3, 'idp' => $prof->id, 'idc' => $matiere['class_id'], 'idm' => $matiere['matiere_id']])); ?>" class="bg-green-100 text-gray-800 text-sm font-medium py-1 px-3 rounded">3</a>
            </div>
        </div>
    </div>
</div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

      
  </div>

  <div id="crud-modal-update" tabindex="-1" aria-hidden="true" class="hidden fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full h-screen">
    <div class="relative p-4 w-full max-w-md max-h-full">
        <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
        <div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
                  <h3 class="text-lg font-semibold text-gray-900 dark:text-white">
                  Modifier Matière
                  </h3>
                  <button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" id="close-modal">
                      <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
                          <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
                      </svg>
                      <span class="sr-only">Close modal</span>
                  </button>
              </div>
            <form class="p-4 md:p-5" id="update-form" method="POST">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>
                <div class="grid gap-4 mb-4 grid-cols-2">
                    <div class="col-span-2">
                        <label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Matière</label>
                        <input type="text" name="name" id="modal-name" class="bg-gray-50 border text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500" required>
                    </div>
                    <div class="col-span-2">
                        <label for="year" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Année</label>
                        <select id="modal-year" name="year" class="bg-gray-50 border text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500">

                        </select>
                    </div>
                </div>
                <button type="submit" class="text-white bg-blue-700 hover:bg-blue-800 rounded-lg text-sm px-5 py-2.5">
                    Modifier
                </button>
            </form>
        </div>
    </div>
</div>

  
  <!-- Main modal -->
  <div id="crud-modal" tabindex="-1" aria-hidden="true" class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
      <div class="relative p-4 w-full max-w-md max-h-full">
          <!-- Modal content -->
          <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
              <!-- Modal header -->
              <div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
                  <h3 class="text-lg font-semibold text-gray-900 dark:text-white">
                    Créer Une Nouvelle Classe
                  </h3>
                  <button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" data-modal-toggle="crud-modal">
                      <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
                          <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
                      </svg>
                      <span class="sr-only">Close modal</span>
                  </button>
              </div>
              <!-- Modal body -->
              <form class="p-4 md:p-5" action="<?php echo e(route('classes.store')); ?>" method="POST">

                  <?php echo csrf_field(); ?>

                  <div class="grid gap-4 mb-4 grid-cols-2">
                      <div class="col-span-2">
                          <label for="name" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Nom Classe</label>
                          <input type="text" name="name" id="name" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"  required="">
                      </div>
                      <div class="col-span-2">
                          <label for="year" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Année Classe</label>
                          <select id="year" name="year" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500">
                              <option selected="">Sélectionner</option>

                          </select>
                      </div>
                  </div>
                  <button type="submit" class="text-white inline-flex items-center bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
                      <svg class="me-1 -ms-1 w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd"></path></svg>
                      Créer
                  </button>
              </form>
          </div>
      </div>
  </div> 
  
</body>
<script>
   
   document.addEventListener('DOMContentLoaded', () => {
    const editButtons = document.querySelectorAll('.edit-matiere');
    const modal = document.getElementById('crud-modal-update');
    const closeModal = document.getElementById('close-modal');
    const form = document.getElementById('update-form');
    const nameInput = document.getElementById('modal-name');
    const yearSelect = document.getElementById('modal-year');

    editButtons.forEach(button => {
        button.addEventListener('click', (e) => {
            e.preventDefault();
            const { id, name,year } = button.dataset;

            // Populate modal fields
            nameInput.value = name;
            yearSelect.value = year;

            // Update form action
            form.action = `/classes/${id}`;

            // Show modal
            modal.classList.remove('hidden');
        });
    });

    closeModal.addEventListener('click', () => {
        modal.classList.add('hidden');
    });
});

document.addEventListener("DOMContentLoaded", () => {
    const searchInput = document.getElementById("search-dropdown");
    const cards = document.querySelectorAll(".card-container");

    searchInput.addEventListener("input", () => {
        const query = searchInput.value.toLowerCase();

        cards.forEach((card) => {
            const name = card.querySelector("[data-name]").getAttribute("data-name").toLowerCase();
            const year = card.querySelector("[data-year]").getAttribute("data-year").toLowerCase();

            // Show card if it matches the search query
            if (name.includes(query) || year.includes(query)) {
                card.style.display = "block";
            } else {
                card.style.display = "none";
            }
        });
    });
});

</script>
</html>
<?php /**PATH C:\Users\Toby\Desktop\my-app\resources\views/profs/show.blade.php ENDPATH**/ ?>