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

<head>
    <?php include("include/meta.php");?>
    <?php include("include/css.php");?>
</head>
<style>
.table {
    background-color: #fff;
    border-collapse: collapse;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.table td {
    color: #333;
}

.table-row-hover:hover {
    background-color: #f5f8ff;
    transition: 0.3s ease;
}

/* Fee card styling */
.fee-card {
    border-left: 5px solid #cc171e;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fee-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.fee-item {
    transition: background 0.3s ease;
}

.fee-item:hover {
    background-color: #eaf2ff;
}

@media (max-width: 576px) {
    .fee-card {
        padding: 1rem;
    }

    .fee-item small {
        font-size: 0.8rem;
    }

    .fee-item span {
        font-size: 0.95rem;
    }
}
</style>

<body>

    <!-- preloader -->
    <?php include("include/preloader.php");?>
    <!-- preloader end -->


    <!-- header area -->
    <?php include("include/header.php");?>
    <!-- header area end -->

    <main class="main">

        <!-- breadcrumb -->
        <?php
            $banner_sql = "SELECT * FROM data_table WHERE up_by = $x && page_type = 'slider' && recycle = '1' ORDER BY id DESC";
            $banner_run = mysqli_query($con, $banner_sql);
            if ($banner_row = mysqli_fetch_assoc($banner_run)) {
            ?>
        <div class="site-breadcrumb" style="background: url(./login/upload/<?php echo $banner_row['image_one']?>)">
            <div class="container">
                <h2 class="breadcrumb-title">Fees Structure</h2>
                <ul class="breadcrumb-menu">
                    <li><a href="index.php">Home</a></li>
                    <li class="active">Fees Structure</li>
                </ul>
            </div>
        </div>
        <?php }?>
        <!-- breadcrumb end -->

        <!-- fees-area -->
        <?php
        $fees_sql = "SELECT * FROM fees_structure WHERE up_by = $x AND recycle = '1' ORDER BY id ASC";
        $fees_run = mysqli_query($con, $fees_sql);
        if (mysqli_num_rows($fees_run) > 0) {
        ?>
        <section class="pt-120 pb-80 bg-light">
            <div class="container">

                <!-- Section Heading -->
                <div class="row">
                    <div class="col-lg-8 mx-auto text-center">
                        <div class="site-heading mb-5">
                            <span class="site-title-tagline fw-semibold">
                                <i class="far fa-book-open-reader me-1"></i> Macaw Public School
                            </span>
                            <h2 class="site-title mb-3"><span>Fees</span> Structure</h2>
                            <p class="text-muted">
                                Our transparent fee structure ensures that quality education remains accessible. Explore
                                the
                                class-wise details below.
                            </p>
                        </div>
                    </div>
                </div>

                <!-- Fee Table -->
                <div class="row justify-content-center">
                    <div class="col-lg-10">

                        <!-- Desktop Table View -->
                        <div class="table-responsive d-none d-md-block shadow-sm rounded-3 overflow-hidden">
                            <table class="table table-bordered table-hover text-center align-middle mb-0">
                                <thead class="">
                                    <tr>
                                        <th><i class="fas fa-graduation-cap me-1"></i>Class</th>
                                        <th><i class="fas fa-user-plus me-1"></i>Admission Fee</th>
                                        <th><i class="fas fa-undo me-1"></i>Re-Admission Fee</th>
                                        <th><i class="fas fa-calendar-alt me-1"></i>Monthly Fee</th>
                                        <th><i class="fas fa-home me-1"></i>Hostel Fee</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php while ($fees_row = mysqli_fetch_assoc($fees_run)) { ?>
                                    <tr class="table-row-hover">
                                        <td class="fw-bold text-dark">
                                            <?php echo htmlspecialchars($fees_row['class_name']); ?></td>
                                        <td><?php echo ($fees_row['admission_fee'] == 0) ? '-' : '₹' . number_format($fees_row['admission_fee']); ?>
                                        </td>
                                        <td><?php echo ($fees_row['readmission_fee'] == 0) ? '-' : '₹' . number_format($fees_row['readmission_fee']); ?>
                                        </td>
                                        <td><?php echo ($fees_row['monthly_fee'] == 0) ? '-' : '₹' . number_format($fees_row['monthly_fee']); ?>
                                        </td>
                                        <td><?php echo ($fees_row['hostel_fee'] == 0) ? '-' : '₹' . number_format($fees_row['hostel_fee']); ?>
                                        </td>
                                    </tr>
                                    <?php } ?>
                                </tbody>
                            </table>
                        </div>

                        <!-- Mobile Card View -->
                        <div class="d-block d-md-none">
                            <?php mysqli_data_seek($fees_run, 0); // reset pointer for re-loop ?>
                            <?php while ($fees_row = mysqli_fetch_assoc($fees_run)) { ?>
                            <div class="fee-card mb-4 shadow-sm p-3 rounded-3 bg-white">
                                <h5 class="fw-bold mb-3 text-center" style="color:var(--theme-color2);">
                                    <i class="fas fa-graduation-cap me-1"></i>
                                    <?php echo htmlspecialchars($fees_row['class_name']); ?>
                                </h5>
                                <div class="row text-center g-2">
                                    <div class="col-6">
                                        <div class="fee-item p-2 bg-light rounded">
                                            <small class="text-muted d-block">Admission Fee</small>
                                            <span class="fw-semibold text-dark">
                                                <?php echo ($fees_row['admission_fee'] == 0) ? '-' : '₹' . number_format($fees_row['admission_fee']); ?>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="col-6">
                                        <div class="fee-item p-2 bg-light rounded">
                                            <small class="text-muted d-block">Re-Admission</small>
                                            <span class="fw-semibold text-dark">
                                                <?php echo ($fees_row['readmission_fee'] == 0) ? '-' : '₹' . number_format($fees_row['readmission_fee']); ?>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="col-6">
                                        <div class="fee-item p-2 bg-light rounded">
                                            <small class="text-muted d-block">Monthly Fee</small>
                                            <span class="fw-semibold text-dark">
                                                <?php echo ($fees_row['monthly_fee'] == 0) ? '-' : '₹' . number_format($fees_row['monthly_fee']); ?>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="col-6">
                                        <div class="fee-item p-2 bg-light rounded">
                                            <small class="text-muted d-block">Hostel Fee</small>
                                            <span class="fw-semibold text-dark">
                                                <?php echo ($fees_row['hostel_fee'] == 0) ? '-' : '₹' . number_format($fees_row['hostel_fee']); ?>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php } ?>
                        </div>

                        <p class="text-danger mt-3"><strong>Note:</strong> These fees are only for the 2026–2027 school
                            year.</p>

                    </div>
                </div>
            </div>
        </section>
        <?php } ?>

        <!-- fees-area end -->

    </main>



    <!-- footer area -->
    <?php include("include/footer.php");?>
    <!-- footer area end -->


    <!-- js -->
    <?php include("include/js.php");?>

</body>

</html>