<?php
include "db.php"; // Make sure this connects your database
?>

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

<head>
    <title>Terms and Conditions | Penguin Institute of Management Studies</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="./assets/css/bootstrap.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" />
    <link rel="stylesheet" href="./assets/css/style.css">
    <link href="./assets/image/logo-pims.png" rel="icon">
</head>
<style>
body {
    background: transparent;
}

h2 {
    filter: none;
}

.heading {
    background: #40599b;
    padding: 10px;
}

.header-logo {
    height: 50px;
    background: #fff;
    padding: 2px;
    border-radius: 50%;
}

/* Tablet View (768px to 991px) */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .header-logo {
        height: 40px;
    }
}

/* Mobile View (less than 768px) */
@media screen and (max-width: 767px) {
    .header-logo {
        height: 30px;
    }
}
</style>

<body>
    <!-- Page header -->
    <div class="heading">
        <div class="container-fluid">
            <div class="d-flex justify-content-between align-items-center">
                <h1 class="m-0 text-center text-lg-start d-flex text-white">
                    <img src="./assets/image/logo-pims.png" class="img-fluid header-logo" alt=""> &nbsp;
                    PIMS
                </h1>
                <div>
                    <a href="index.php" class="btn btn-sm btn-primary">Login <i class="fa fa-sign-in"
                            aria-hidden="true"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <!-- Page Content -->
    <div class="container-fluid py-5">
        <?php
        $query = mysqli_query($con, "SELECT * FROM data WHERE data_catagory = 't&c'");
        
        if (mysqli_num_rows($query) > 0) {
            if ($row = mysqli_fetch_assoc($query)) {
                ?>
        <div class="mb-4 border p-4 bg-light rounded overflow-hidden">
            <?=$row['data_long_des']?></div>
        <?php
            }
        } else {
            echo "<p class='text-danger'>No Terms and Conditions found.</p>";
        }
        ?>
    </div>

    <!-- Footer -->
    <?php include("footer.php"); ?>

    <!-- Scripts -->
    <script src="./assets/js/bootstrap.js"></script>
</body>

</html>