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

 <?php include 'head.php';?>

<body>

  <!-- ======= Header ======= -->
  
 <?php include 'menubar.php';?>

 <?php include 'sidebar.php';?>


  <main id="main" class="main">


    
	<style>
	body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

h1 {
    text-align: center;
}

form {
    max-width: 500px;
    margin: 0 auto;
}

label {
    display: block;
    margin-top: 10px;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

input[type="submit"]:hover {
    background-color: #45a049;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin: 0 auto;
  border:2;
}

th, td {
  padding: 10px;
  text-align: left;
}

th {
  background-color: #04AA6D;
  color: white;
}
label, input {
  width: 200px;
}
</style>


<?php
// Connect to the database (you need to replace these values with your actual database details)
$servername = "localhost";
$username = "tslibrary_user";
$password = "rb!tsl838";
$dbname = "tslibrary_data";
$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Fetch fees status data
$sql = "SELECT * FROM monthly_fees";
$result = $conn->query($sql);

?>

<!DOCTYPE html>
<html>
<head>
    <title>Fees Status</title>
</head>
<body>
    <h1>Fees Status</h1>
    <table border="1">
        <tr>
            <th>Student ID</th>
            <th>Month</th>
            <th>Year</th>
            <th>Fees Amount</th>
            <th>Payment Date</th>
            <th>Action</th>
        </tr>
        <?php
        if ($result->num_rows > 0) {
            while ($row = $result->fetch_assoc()) {
                echo "<tr>";
                echo "<td>" . $row["student_id"] . "</td>";
                echo "<td>" . $row["fees_month"] . "</td>";
                echo "<td>" . $row["fees_year"] . "</td>";
                echo "<td>" . $row["fees_amount"] . "</td>";
                echo "<td>" . $row["payment_date"] . "</td>";
                echo "<td><a href='update_fees.php?id=" . $row["ID"] . "'>Update</a></td>";
                echo "</tr>";
            }
        } else {
            echo "<tr><td colspan='6'>No fees data available</td></tr>";
        }
        ?>
    </table>






</body>
</html>

  </main><!-- End #main -->

   <?php include 'footer.php';?>

</body>

</html>