<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Quiz Site</title>

    <!-- STYLES -->
    <link rel="stylesheet" href="<?= base_url("assets/css/main.css") ?>" />

    <?php if (isset($page)): ?>
        <?= view($page . "/head") ?>
    <?php endif; ?>


</head>
<body>
<ul class = "navbar">
  <li><a
   href="<?= base_url("browse") ?>"
   <?php if ($active == "browse"): ?>
        class="active"
    <?php endif; ?>
   ><b>BROWSE</b></a></li>
  <li><a 
  href="<?= base_url("create") ?>"
  <?php if ($active == "create"): ?>
        class="active"
    <?php endif; ?>
    ><b>CREATE</b></a></li>
  
    <?php if(session()->get('user_id')):?>
        <li class="right"><a 
        href="<?= base_url("logout") ?>"
        ><b>LOG OUT
        </b></a></li>
    <?php else: ?>
        <li class="right"><a 
        href="<?= base_url("login") ?>"
        <?php if ($active == "login"): ?>
        class="active"
        <?php endif; ?>
        ><b>LOG IN</b></a></li>
    <?php endif ?>
</ul>

<div class="main-content">
    <?php if (isset($page)): ?>
        <?= view($page . "/content") ?>
    <?php endif; ?>
</div>
</body>


<?php if (isset($page)): ?>
    <?= view($page . "/scripts") ?>
<?php endif; ?>
</html>
