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

 <?php include 'head.php';?>
<style>
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

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

th {
    background-color: #f2f2f2;
    font-weight: bold;
}
</style>
<body>

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

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


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

<?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 student registration data
$sql = "SELECT * FROM student_registration";
$result = $conn->query($sql);

?>

<!DOCTYPE html>
<html>
<head>
    <title>View Student Registration</title>
</head>
<body>
    <h1>View Student Registration</h1>
    <table border="1">
        <tr>
            <th>ID</th>
			<th>Photo</th>
            <th>Drop out</th>
			 <th>Registration</th>
            <th>Name</th>
            <th>Father</th>
            <th>Mother</th>
            <th>Date of Birth</th>
            <th>Address</th>
            <th>Mobile</th>
            <th>Secondary Mobile</th>
            <th>Aadhar</th>
            <th>Registration Date</th>
            <th>Registration Month</th>
            <th>Registration Year</th>
            <th>Fees Amount</th>
            <th>Fees Deposit Date</th>
            <th>Fees Mode</th>
        </tr>
        <?php
        if ($result->num_rows > 0) {
            while ($row = $result->fetch_assoc()) {
				$photo="http://tslibrary.in/branch/uploads/".$row['photo'];
				
                echo "<tr>";
                echo "<td>" . $row["ID"] . "</td>";
				echo "<td>"."<img src='$photo'  height='100px' width='100px' class='rounded-circle'>"."</td>";
                echo "<td>"."<a href='dropout.php?ID=".$row["student_id"]. "'>Drop out</a>"."</td>";
				echo "<td>" . $row["student_id"] . "</td>";
                echo "<td>" . $row["name"] . "</td>";
                echo "<td>" . $row["father"] . "</td>";
                echo "<td>" . $row["mother"] . "</td>";
                echo "<td>" . $row["dob"] . "</td>";
                echo "<td>" . $row["address"] . "</td>";
                echo "<td>" . $row["mobile"] . "</td>";
                echo "<td>" . $row["mobile2"] . "</td>";
                echo "<td>" . $row["aadhar"] . "</td>";
                echo "<td>" . $row["reg_date"] . "</td>";
                echo "<td>" . $row["reg_month"] . "</td>";
                echo "<td>" . $row["reg_year"] . "</td>";
                echo "<td>" . $row["fees_amount"] . "</td>";
                echo "<td>" . $row["fees_deposit_date"] . "</td>";
                echo "<td>" . $row["fees_mode"] . "</td>";
                echo "</tr>";
            }
        } else {
            echo "<tr><td colspan='15'>No student data available</td></tr>";
        }
        ?>
    </table>
</body>
</html>


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

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

</body>

</html>


