<?php

session_name('super_admin_session');

if (!is_dir(dirname(__DIR__) . '/session_data/super')) { mkdir(dirname(__DIR__) . '/session_data/super', 0700, true); } session_save_path(dirname(__DIR__) . '/session_data/super');

session_set_cookie_params(['path' => '/', 'httponly' => true, 'samesite' => 'Strict']);

session_start();

error_reporting(0);

include('includes/dbconnection.php');
require_once 'includes/session_term_helper.php';
$stResult = resolveCurrentSessionTerm($con);
$currentSessionName = $stResult['session_name'];
$currentTermName    = $stResult['term_name'];


if (strlen($_SESSION['sid']==0)) {

header('location:logout.php'); 

} 

?>

<!DOCTYPE html>

<html>

<?php @include("includes/head.php"); ?>



<body class="hold-transition sidebar-mini layout-fixed">

    <div class="wrapper">

        <!-- Navbar -->

        <?php @include("includes/header.php"); ?>

        <!-- Main Sidebar Container -->

        <?php @include("includes/sidebar.php"); ?>

        <!-- Content Wrapper. Contains page content -->

        <div class="content-wrapper">

            <!-- Content Header (Page header) -->

<section class="content-header premium-header">

    <div class="container-fluid">

        <div class="header-glass-card">

            <div class="row align-items-center">

                <div class="col-md-8">

                    <div class="title-section">

                        <div class="icon-box bg-primary-gradient shadow-sm">

                            <i class="fas fa-credit-card"></i>

                        </div>

                        <div>

                            <h1 class="premium-title text-primary">

                                Payment Management

                                <span class="premium-subtitle text-secondary">Approve Payment</span>

                            </h1>
                            <div class="mt-1">
                              <?php if ($currentSessionName): ?>
                                <span class="badge badge-primary mr-1">
                                  <i class="fas fa-calendar-alt"></i>
                                  <?= htmlspecialchars($currentSessionName) ?>
                                </span>
                              <?php endif; ?>
                              <?php if ($currentTermName): ?>
                                <span class="badge badge-success">
                                  <i class="fas fa-bookmark"></i>
                                  <?= htmlspecialchars($currentTermName) ?>
                                </span>
                              <?php else: ?>
                                <span class="badge badge-warning">
                                  <i class="fas fa-exclamation-triangle"></i> No active term
                                </span>
                              <?php endif; ?>
                            </div>

                        </div>

                    </div>

                </div>

                <div class="col-md-4">

                    <nav aria-label="breadcrumb">

                        <ol class="breadcrumb premium-breadcrumb">

                            <li class="breadcrumb-item"><a href="dashboard.php" class="text-primary">Home</a></li>

                            <li class="breadcrumb-item active" aria-current="page">Approve Payment</li>

                        </ol>

                    </nav>

                </div>

            </div>

        </div>

    </div>

</section>             





            <section class="content px-6">

                <div class="container-fluid">







                    <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4 gap-4 mb-10">

                        <?php

    $dashboard_items = [

        ["label" => "SCHOOL FEES", "desc" => "Admitted Students", "icon" => "fas fa-money-bill-wave", "bg" => "bg-success", "link" => "pay_tuition.php",    "id" => "schoolFeesBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

        ["label" => "SCHOOL FEES", "desc" => "Non Admitted Students", "icon" => "fas fa-money-bill-wave", "bg" => "bg-primary", "link" => "pay.php", "id" => "otherFeesBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

        ["label" => "ENTRANCE FORM", "desc" => "Entrance Form", "icon" => "fa fa-address-card", "bg" => "bg-success", "link" => "entrancepay.php", "id" => "examResultBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

         ["label" => "LESSON FEES", "desc" => "Lesson Fees (Admitted Students)", "icon" => "fa fa-book", "bg" => "bg-info", "link" => "acec.php", "id" => "testResultBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

        ["label" => "OTHER SERVICE", "desc" => "Other Services", "icon" => "fa fa-briefcase", "bg" => "bg-secondary", "link" => "otherpay.php", "id" => "attendanceBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

        ["label" => "LESSON FEES", "desc" => "Lesson Fees (External Students)", "icon" => "fa fa-user", "bg" => "bg-danger", "link" => "entrancepay1.php", "id" => "downloadsBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

        ["label" => "GRADUATED STUDENT", "desc" => "Certificate / Testimonial Fees", "icon" => "fas fa-graduation-cap", "bg" => "bg-warning", "link" => "entrancepay2.php", "id" => "profileBtn", "class" => "text-[12px] font-black text-slate-400 group-hover:text-slate-900 transition-colors tracking-tighter"],

    ];

                            $styleMap = [

                            "bg-primary"   => ["bg" => "bg-blue-50", "text" => "text-blue-600"],

                            "bg-success"   => ["bg" => "bg-emerald-50", "text" => "text-emerald-600"],

                            "bg-warning"   => ["bg" => "bg-orange-50", "text" => "text-orange-600"],

                            "bg-info"      => ["bg" => "bg-cyan-50", "text" => "text-cyan-600"],

                            "bg-danger"    => ["bg" => "bg-rose-50", "text" => "text-rose-600"],

                            "bg-secondary" => ["bg" => "bg-slate-50", "text" => "text-slate-600"]

                        ];

foreach ($dashboard_items as $item) {

        $st = $styleMap[$item['bg']] ?? $styleMap["bg-secondary"];

        

    ?>

        <div class="bento-card group">

            <div class="flex justify-between items-start mb-3">

                <div class="w-10 h-10 <?php echo $st['bg']; ?> <?php echo $st['text']; ?> rounded-xl flex items-center justify-center text-base transition-transform group-hover:scale-110">

                    <i class="<?php echo $item['icon']; ?>"></i>

                </div>

                <a href="<?php echo $item['link']; ?>" class="<?php echo $item['class']; ?>" id="<?php echo $item['id']; ?>"><i class="fas fa-arrow-right"></i> CLICK HERE</a>

            </div>

            <h5 class="text-[15px] font-bold text-slate-500 tracking-tight"><?php echo $item['label']; ?></h5>

            <p class="text-[10px] font-bold text-slate-500 uppercase tracking-tight truncate"><?php echo $item['desc']; ?></p>

            

            <div class="mt-4 w-full h-1 bg-slate-200/50 rounded-full overflow-hidden">

                <div class="h-full <?php echo str_replace('text-', 'bg-', $st['text']); ?> opacity-40 w-full transform -translate-x-1/2 group-hover:translate-x-0 transition-transform duration-1000"></div>

            </div>

        </div>

    <?php } ?>

</div>



                </div>

                <!-- /.row (main row) -->

            </div>

            <!-- /.container-fluid -->

        </section>

    </div>

    <!-- /.content-wrapper -->

    <?php @include("includes/footer.php"); ?>



    <!-- Control Sidebar -->

    <aside class="control-sidebar control-sidebar-dark">

      <!-- Control sidebar content goes here -->

  </aside>

  <!-- /.control-sidebar -->

</div>

<!-- ./wrapper -->



<?php @include("includes/foot.php"); ?>

</body>

</html>

