<?php
require_once('../config.php');

if (!$_settings->is_logged_in()) {
    header("Location: ".base_url);
    exit;
}
?>
<!DOCTYPE html>
<html lang="es">
<?php require_once(base_app.'inc/header.php'); ?>
<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed">

<div class="wrapper">

  <?php require_once(base_app.'inc/topBarNav.php'); ?>
  <?php require_once(base_app.'inc/navigation.php'); ?>

  <!-- Content Wrapper -->
  <div class="content-wrapper p-3">
    <section class="content">
      <div class="container-fluid">
        <?php
          $page = $_GET['page'] ?? 'home';

          if (is_dir($page)) {
              include $page.'/index.php';
          } elseif (file_exists($page.'.php')) {
              include $page.'.php';
          } else {
              include 'home.php';
          }
        ?>
      </div>
    </section>
  </div>

  <?php require_once(base_app.'inc/footer.php'); ?>

</div>
</body>
</html>
