<?php include_once __DIR__ . '/../layouts/head.php'; ?> <div class="container py-4" style="max-width: 1350px; width: 100%;">
  <div class="row">
    <div class="col-lg-12">
      <div class="shadow-sm bg-white rounded overflow-hidden border">
        <div class="p-0">
          <div class="row px-0 m-0"> <?php include_once __DIR__ . '/../layouts/menu_body.php'; ?> <div class="col-12 col-md-9 px-0">
              <div class="tab-content" id="v-pills-tabContent">
                <!-- awal isi konten -->
                <div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
                  <div class="p-4">
                    <div class="mb-4">
                      <h5 class="mb-0 fw-bold">Halaman KRS & KHS</h5>
                    </div>
                    <div class="row row-cols-1 row-cols-md-2 g-4">
                      <div class="col">
                        <div class="border rounded d-flex gap-3 p-4">
                          <i class="bi bi-printer m-0 rounded-pill rounded-icon"></i>
                          <div class="text-start">
                            <h6 class="mb-1 fw-bold">KRS</h6>
                            <div class="text-muted small text-opacity-50 mb-3">Cetak KRS</div>
                            <div id="v-pills-tab" role="tablist" aria-orientation="vertical">
                              <a href="/dashboard/mahasiswa-krs" class="fw-bold text-danger text-decoration-none text-uppercase">Open</a>
                            </div>
                          </div>
                          <i class="bi bi-check-circle-fill ms-auto"></i>
                        </div>
                      </div>
                      <div class="col">
                        <div class="border rounded d-flex gap-3 p-4">
                          <i class="bi bi-printer-fill m-0 rounded-pill rounded-icon"></i>
                          <div class="text-start">
                            <h6 class="mb-1 fw-bold">KHS</h6>
                            <div class="text-muted small text-opacity-50 mb-3">Cetak KHS</div>
                            <a href="/dashboard/mahasiswa-khs" class="fw-bold text-danger text-decoration-none text-uppercase">Open</a>
                          </div>
                          <i class="bi bi-check-circle-fill ms-auto"></i>
                        </div>
                      </div>
                    </div>
                    <div class="col">
                      </br>
                    </div>
                    <div class="row row-cols-1 row-cols-md-1 g-4">
                      <div class="col">
                        <center>
                          <h6>Daftar Mata Kuliah Yang Bisa Anda Kontrak</h6>
                        </center>
                        <div class="border rounded d-flex gap-3 p-4">
                          <div class="table-responsive">
                            <form method="post" action="/dashboard/mahasiswa-krs" class="d-flex">
                              <div class="input-group">
                                <input type="text" id="token" name="token" class="form-control rounded-start-pill" placeholder="Masukan Token" required>
                                <button type="submit" name="submit_token" class="btn btn-outline-danger rounded-end">Kirim Token</button>
                              </div>
                            </form>
                          </div>
                        </div>
                      </div>
					  
						<?php if (isset($_SESSION['success'])): ?>
							<div class="alert alert-success" id="alert-success">
								<?= $_SESSION['success']; ?>
							</div>
							<?php unset($_SESSION['success']); ?>
						<?php endif; ?>

						<?php if (isset($_SESSION['error'])): ?>
							<div class="alert alert-danger" id="alert-error">
								<?= $_SESSION['error']; ?>
							</div>
							<?php unset($_SESSION['error']); ?>
						<?php endif; ?>

						<!-- Script to auto-dismiss alert -->
						<script>
							setTimeout(function() {
								const successAlert = document.getElementById('alert-success');
								const errorAlert = document.getElementById('alert-error');
								if (successAlert) {
									successAlert.style.transition = 'opacity 0.5s ease';
									successAlert.style.opacity = '0';
									setTimeout(() => successAlert.remove(), 500); // remove after fade out
								}
								if (errorAlert) {
									errorAlert.style.transition = 'opacity 0.5s ease';
									errorAlert.style.opacity = '0';
									setTimeout(() => errorAlert.remove(), 500);
								}
							}, 3000); // 3 seconds
						</script>

                    </div>
                  </div>
                </div>
                <!-- batas isi konten -->
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div> <?php include_once __DIR__ . '/../layouts/footer.php'; ?>