<!doctype html>
<html lang="en" class="has-navbar-fixed-top">
<head>
    <meta charset="UTF-8">
    <title>MUSIC APP</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <?= link_tag('assets/style.css'); ?>
    <script type="text/javascript" src="<?= base_url('assets/script.js'); ?>"></script>
</head>
<body>
    <main class="container">
        <nav>
            <ul>
                <li><strong class="appli">Music APP</strong></li>
            </ul>
            <?php 
            $page = preg_split('/[\/]/', $_SERVER['REQUEST_URI']);
            if ($page[count($page) - 1] != 'auth' && $page[count($page) - 1] != 'create') { ?>
                <form method="GET">
                    <input type="text" name="recherche" placeholder="Recherche... ">
                </form>
            <?php } ?>
            <ul>
                <li><?= anchor('albums', 'Albums'); ?></li>
                <li><?= anchor('artistes', 'Artistes'); ?></li>
                <li><?= anchor('chansons', 'Chansons'); ?></li>
                <?php if ($this->session->userdata('logged_in')) { ?>
                    <li><?= anchor('playlist', 'Playlist'); ?></li>
                    <li class="déconnexion"><?= anchor('user/logout', 'Déconnexion'); ?></li>
                <?php } else { ?>
                    <li class="connexion"><?= anchor('user/auth', 'Connexion'); ?></li>
                <?php } ?>
            </ul>
        </nav>
    </main>

