Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.volley92.asso.fr
/
htdocs
/
modules
/
/srv/data/web/vhosts/www.volley92.asso.fr/htdocs/modules/navbar.php
<?php $stmt = $db_client->prepare("SELECT * FROM category WHERE id_company=? ORDER BY created_at ASC"); // on prépare notre requête $stmt->execute(array($conf_id_company)); $cats = $stmt->fetchAll(); $stmt = $db_client->prepare("SELECT * FROM sous_category ORDER BY title ASC"); // on prépare notre requête $stmt->execute(); $s_cats = $stmt->fetchAll(); function hasPage($id) { global $db_client; $stmt = $db_client->prepare("SELECT * FROM page_list WHERE category_id= ?"); // on prépare notre requête $stmt->execute(array($id)); $row = $stmt->fetch(); if (!empty($row)) { return true; } return false; } function getIdCat($title) { global $cats; if (!empty($cats)) { foreach ($cats as $cat) { if ($cat->is_dropdown) { if ($cat->title == $title) { return $cat->id; } } } } return null; } function getSousCat($id) { global $s_cats; $titles = []; if (!empty($s_cats)) { foreach ($s_cats as $s_cat) { if ($s_cat->id_category == $id) { $titles[$s_cat->id] = $s_cat->title; } } return $titles; } return null; } ?> <nav class="navbar navbar-expand-lg"> <a href="<?= $routes['accueil'] ?>"><img src="img/logo-menu.png" alt="logo" class="img-fluid"></a> <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"> <i class="fa fa-bars" aria-hidden="true"></i> </span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav ml-auto"> <li class="nav-item <?php if ($slug == 'accueil') echo 'active'; ?>"> <a class="nav-link" href="<?= $routes['accueil'] ?>">Accueil</a> </li> <li class="nav-item <?php if ($slug == 'actualites') echo 'active'; else ''; ?>"> <a class="nav-link" href="<?= $routes['news'] ?>">Actualités</a> </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"> Volley-ball </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="<?= $routes['formulaire'] ?>">Formulaires</a> <?php $id = getIdCat('Volley-Ball') ?> <?php $titles = getSousCat($id); ?> <?php if (!empty($titles)) : ?> <?php foreach ($titles as $id_s_cat => $title) : ?> <a class="dropdown-item" href="<?= $routes['page-single'] . '-' . myUrlEncode($title) . '-' . $id_s_cat ?>"><?= $title ?></a> <?php endforeach; ?> <?php endif; ?> <a class="dropdown"> <a class="dropdown-item dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Compétitions </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="https://www.ffvbbeach.org/ffvbapp/resu/vbspo_home.php?codent=PTIDF92" target="_blank">Gestion 92</a> <a class="dropdown-item" href="https://www.ffvbbeach.org/ffvbapp/resu/vbspo_home.php?codent=PTIDF75" target="_blank">Gestion 75</a> <a class="dropdown-item" href="https://www.ffvbbeach.org/ffvbapp/resu/vbspo_home.php?codent=PTIDF78" target="_blank">Gestion 78</a> <a class="dropdown-item" href="https://www.ffvbbeach.org/ffvbapp/resu/vbspo_home.php?codent=PTIDF91" target="_blank">Gestion 91</a> <a class="dropdown-item" href="https://www.ffvbbeach.org/ffvbapp/resu/vbspo_home.php?codent=PTIDF95" target="_blank">Gestion 95</a> </div> </a> </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"> Beach-volley </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <?php $id = getIdCat('Beach-volley') ?> <?php $titles = getSousCat($id); ?> <?php if (!empty($titles)) : ?> <?php foreach ($titles as $id_s_cat => $title) : ?> <?php if (hasPage($id_s_cat)) : ?> <a class="dropdown-item" href="<?= $routes['page-single'] . '-' . myUrlEncode($title) . '-' . $id_s_cat ?>"><?= $title ?></a> <?php endif; ?> <?php endforeach; ?> <?php endif; ?> </div> </li> <li class="nav-item <?php if ($slug == 'formations') echo 'active'; else ''; ?>"> <a class="nav-link" href="<?= $routes['formations'] ?>">Nos formations</a> </li> <li class="nav-item <?php if ($slug == 'clubs') echo 'active'; else ''; ?>"> <a class="nav-link" href="<?= $routes['clubs'] ?>">Nos clubs</a> </li> <li class="nav-item <?php if ($slug == 'contact') echo 'active'; else ''; ?>"> <a class="nav-link" href="<?= $routes['contact'] ?>">Contact</a> </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"> Divers </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> <?php $id = getIdCat('Divers') ?> <?php $titles = getSousCat($id); ?> <?php if (!empty($titles)) : ?> <?php foreach ($titles as $id_s_cat => $title) : ?> <a class="dropdown-item" href="<?= $routes['page-single'] . '-' . myUrlEncode($title) . '-' . $id_s_cat ?>"><?= $title ?></a> <?php endforeach; ?> <?php endif; ?> </div> </li> </ul> </div> </nav>