menu_responsive.ctp 4.64 KB
<!-- début menu -->


<nav class="navbar navbar-expand-xl navbar-light bg-light">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">


      <li class="nav-item">
        <?=$this->Html->link('<i class="nav-link" id="police">Retour</i>', 'javascript:window.history.go(-1)', ['escape' => false])?>
      </li>

      <li class="nav-item">
        <?=$this->Html->link('<i class="nav-link" id="police">Accueil</i>', ['controller' => 'pages','action' => 'home'], ['escape' => false]);?>
      </li>

      <?php if(isset($username) && $username != " "): ?>

          <li class="nav-item dropdown">

            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">
              Matériel
            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
              <?=$this->Html->link('<i class="dropdown-item">Nouveau</i>', ['controller' => 'Materiels','action' => 'add'], ['escape' => false]);?> 
              <?=$this->Html->link('<i class="dropdown-item">Ma liste</i>', ['controller' => 'Materiels', 'action' => 'index', 'MY' => $username ], ['escape' => false]);?>
              <?=$this->Html->link('<i class="dropdown-item">Tous</i>', ['controller' => 'Materiels','action' => 'index'], ['escape' => false])?>
              <?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'materiels','action' => 'find'], ['escape' => false]);?>
            </div>                              
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">
              Suivi
            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
              <?=$this->Html->link('<i class="dropdown-item">Liste</i>', ['controller' => 'Suivis','action' => 'index'], ['escape' => false])?>
              <?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'suivis','action' => 'find'], ['escape' => false]);?> 
            </div>                              
          </li>

          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">
              Emprunt
            </a>
            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
              <?=$this->Html->link('<i class="dropdown-item">Liste</i>', ['controller' => 'Emprunts','action' => 'index'], ['escape' => false]);?> 
              <?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'emprunts','action' => 'find'], ['escape' => false])?> 
            </div>                              
          </li>

          <li class="nav-item">
            <?=$this->Html->link('<i class="nav-link aligner" id="police">Autres listes</i>', ['controller' => 'pages','action' => 'tools_sm'], ['escape' => false])?>
          </li>

          <?php if(isset($role) && !(in_array($role, ['Utilisateur']))): ?>
          <li class="nav-item">
            <?=$this->Html->link('<i class="nav-link" id="police">Outils</i>', ['controller' => 'pages','action' => 'tools'], ['escape' => false])?>         
          </li>
          <?php endif; ?>
      <?php endif; ?>

      <li class="nav-item">
        <?=$this->Html->link('<i class="nav-link aligner" id="police">A propos</i>', ['controller' => 'pages','action' => 'about'], ['escape' => false])?>
      </li>

    </ul>

    <div id="barre">
    <?php if (isset($username) && $username != " ") {

        // Search function
        echo $this->Form->create('Materiel', ['url' => '/materiels/find']);

        echo '<input name="s_all_2" class="form-control mr-2 mr-sm-2 col-8 col-sm-6 col-md-6 col-lg-9" type="search" placeholder="Recherche (matériels)" aria-label="Search" id="MaterielSAll barre">';
        echo $this->Form->button('Chercher', [ 'class'=>'btn btn-outline-success', 'type'=>'submit', 'name' => 'MaterielSAll', 'id' => 'MaterielSAll', 'style' => 'margin: 0px;' ]); 
        
        echo $this->Form->end();
    }?>
    </div>
    
  </div>
</nav>


<!-- fin menu -->