</nav> <div class="black-bg"> <nav id="menu" class="flex-row-fluid flex-center wrapper"> <a href="/<?php echo $lang; ?> /" class="block pushState flex0 home"></a> <?php empty($_GET['cat']) ? $activation = " active" : ($activation = ""); ?> <?php $result = $file_db->prepare('SELECT cl.id_cat,name,lang,image,c.priority FROM category_lang cl JOIN category c ON c.id_cat = cl.id_cat WHERE lang LIKE :lang ORDER BY c.priority ASC'); $result->bindParam(":lang", $lang); $result->execute() or die('AHAH'); foreach ($result as $row) { cleanString($row['name']) == $_GET['cat'] ? $class = " active" : ($class = ""); echo ' <a href="/' . strtolower($row['lang']) . '/' . cleanString($row['name']) . '" class="cat' . $row['id_cat'] . ' block pushState flex0' . $class . '" data-priority="' . $row['priority'] . '">' . $row['name'] . '</a>' . "\n"; } if (isLogedNC()) { ?> <a class="block pushState flex0 admin" id="newCat"><?php echo $translation['admin_newCat']; ?> </a> <?php } ?> </nav> </div> </header>
function drawContact($db, $translation, $lang) { $contact = $db->prepare("SELECT * FROM contact c LEFT JOIN contact_type t ON c.type = t.id_type ORDER BY priority ASC"); $contact->execute() or die("Couldn't open event table"); $admin = ""; if (isLogedNC()) { $admin = '<a id="editContact" class="admin">' . $translation['admin_editContact'] . '</a> '; } ?> <section id="contact"> <h1><?php echo $translation['contact_title']; ?> </h1> <?php echo $admin; ?> <?php $rowCount = 0; foreach ($contact as $row) { $rowCount++; $html = str_replace("±VALUE±", $row['value'], $row['template']); ?> <article> <?php echo $html; ?> </article> <?php } if ($rowCount < 1) { ?> <h1><?php echo $translation['contact_nothing']; ?> </h1> <?php } ?> </section> <?php }