<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
  <title>Rapor Digital</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="assets/img/favicon.png" rel="icon">
  <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Fonts -->
  <link href="https://fonts.googleapis.com" rel="preconnect">
  <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
  <link href="assets/vendor/aos/aos.css" rel="stylesheet">
  <link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
  <link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">

  <!-- Main CSS File -->
  <link href="assets/css/main.css" rel="stylesheet">

  <!-- =======================================================
  * Template Name: MyResume
  * Template URL: https://bootstrapmade.com/free-html-bootstrap-template-my-resume/
  * Updated: Jun 29 2024 with Bootstrap v5.3.3
  * Author: BootstrapMade.com
  * License: https://bootstrapmade.com/license/
  ======================================================== -->
</head>

<body class="index-page">

  <header id="header" class="header d-flex flex-column justify-content-center">

    <i class="header-toggle d-xl-none bi bi-list"></i>

    <nav id="navmenu" class="navmenu">
      <ul>
        <li><a href="#home" class="active"><i class="bi bi-house navicon"></i><span>Home</span></a></li>
      </ul>
    </nav>

  </header>

  <main class="main">

    <!-- Hero Section -->
    <section id="home" class="hero section light-background">

      <img src="assets/img/hero-bg.jpg" alt="">

      <div class="container" data-aos="zoom-out">
        <div class="row justify-content-center">
          <div class="col-lg-9">
            <h2>Rapor Digital</h2>
            <?php
            $database_file = '../db/rapor.db';
            $pdo = new PDO("sqlite:$database_file");

            $sekolah = "SELECT * FROM sekolah";
            $statement = $pdo->prepare($sekolah);
            $statement->execute();

            if ($sekolahlist = $statement->fetch(PDO::FETCH_ASSOC)) {
            ?>
              <p><span class="typed" data-typed-items="<?= $sekolahlist['nama_sekolah'] ?>"></span><span class="typed-cursor typed-cursor--blink" aria-hidden="true"></span></p>
            <?php } ?>
            <div class="card border-0 shadow mt-4" style="width:28rem;">
              <div class="card-body">
                <form action="">
                  <select class="form-control m-1" name="role" id="role" required>
                    <option value="">Pilih Akses</option>
                    <option value="sekolah">Sekolah</option>
                    <option value="walikelas">Wali Kelas</option>
                    <option value="guru">Guru</option>
                  </select>
                  <input type="submit" class="btn w-100 btn-primary m-1" value="Tampilkan">
                </form>
              </div>
            </div>
            <?php
            if (isset($_GET['role'])) {
              if ($_GET['role'] == 'sekolah') {
    //            header("Location: ../adm/login?auth");
                echo '<meta http-equiv="refresh" content="0;url=../adm/login?auth" />';
                exit(); // Important to stop further script execution
              }
              if ($_GET['role'] == 'walikelas') {
  //              header("Location: ../adm");
                echo '<meta http-equiv="refresh" content="0;url=../adm" />';
                exit(); // Important to stop further script execution
              }
              if ($_GET['role'] == 'guru') {
//                header("Location: ../gr");
                echo '<meta http-equiv="refresh" content="0;url=../gr" />';
                exit(); // Important to stop further script execution
              }
            }
            ?>

          </div>
        </div>
      </div>

    </section><!-- /Hero Section -->



  </main>


  <!-- Scroll Top -->
  <a href="#" id="scroll-top" class="scroll-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>

  <!-- Preloader 
  <div id="preloader"></div>-->

  <!-- Vendor JS Files -->
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>
  <script src="assets/vendor/aos/aos.js"></script>
  <script src="assets/vendor/typed.js/typed.umd.js"></script>
  <script src="assets/vendor/purecounter/purecounter_vanilla.js"></script>
  <script src="assets/vendor/waypoints/noframework.waypoints.js"></script>
  <script src="assets/vendor/glightbox/js/glightbox.min.js"></script>
  <script src="assets/vendor/imagesloaded/imagesloaded.pkgd.min.js"></script>
  <script src="assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
  <script src="assets/vendor/swiper/swiper-bundle.min.js"></script>

  <!-- Main JS File -->
  <script src="assets/js/main.js"></script>

</body>

</html>