<?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">
            		<!-- wates -->
            		<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">Upload Nilai Mahasiswa</h5>
                            </div>
                                <div class="row row-cols-1 row-cols-md-1 g-4">
                                    <div class="col">
                                    </div>
                                </div>
                                <div class="row row-cols-1 row-cols-md-1 g-4">		
                                	<div class="col">
                                		<div class="border rounded d-flex gap-3 p-4">
                                			<i class="bi bi-credit-card "></i>
                                			<div class="text-start">
                                				<h6 class="mb-1 fw-bold">UPL Nilai</h6>
                                				<div class="text-muted small text-opacity-50 mb-3">Upload Nilai mahasiswa</div>
                                			
                                                <?php
                                                if (empty($_SESSION['csrf_token'])) {
                                                    $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
                                                }
                                                ?>

                                                <form method="post" action="/dashboard/pegawai-up_nilai" enctype="multipart/form-data" class="form-input">
                                                    <input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
                                                    <input type="file" name="excelFile" accept=".xls,.xlsx" class="form-control">
                                                    </br>
                                                    <input type="submit" value="Upload" name="upload_nilai_barudak" class="btn btn-warning"/>
                                                    <a href="/dashboard/pegawai-download_template" class="text-danger text-decoration-none">
                                                        <i class="bi bi-file-earmark-bar-graph"></i> Download Format
                                                    </a>
                                                </form>
                                				</br>
                                				</br>
                                                    <!-- ✅ Tampilkan Pesan -->
                                                    <?php if (!empty($_SESSION['pesan'])): ?>
                                                            <div class="alert alert-info mt-3" style="white-space: pre-line;">
                                                                <?= $_SESSION['pesan'] ?>
                                                            </div>
                                                        <?php unset($_SESSION['pesan']); ?>
                                                    <?php endif; ?>                                				
                                			</div>
                                			<i class="bi bi-check-circle-fill ms-auto"></i>
                                		</div>
                                	</div>
                                </div>
                        </div>
                    </div>
            	</div>
            </div>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php include_once __DIR__ . '/../layouts/footer.php'; ?>
