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

 <?php include 'head.php';?>
<style>
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

h1, h2 {
    text-align: center;
}

.branch-list {
    list-style-type: none;
    padding: 0;
    text-align: center;
}

.branch-list li {
    margin: 10px 0;
}

.branch-list a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.branch-list a:hover {
    color: #4CAF50;
}

/* Add more styling as needed */

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>
<style>
        table {
            border-collapse: collapse;
            width: 100%;
        }

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

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

        tr:hover {
            background-color: #f5f5f5; /* Change the background color on hover */
        }
    </style>
<body>

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

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


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



<?php
 $var = @$_GET['ID'];

$link = mysqli_connect("localhost", "tslibrary_user", "rb!tsl838", "tslibrary_data");
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}
// Attempt select query execution
$sql = "SELECT * FROM student_registration where student_id='$var'";
if($result = mysqli_query($link, $sql)){
    if(mysqli_num_rows($result) > 0){
		echo "<table>";
echo "<tr>";
           
			echo "<td>ID</td>";
            echo "<td>Name</td>";
            echo "<td>Father</td>";
            echo "<td>Mother</td>";
            echo "<td>DOB</td>";
            echo "<td>ADDRESS</td>";
            echo "<td>Mobile</td>";
            echo "<td>Mobile2</td>";
            
            echo "<td>Join Date</td>";
 
            echo "<td>Fees</td>";
            echo "<td>Deposit Date</td>";
            echo "<td>Fees Mode</td>";
      
            echo "</tr>";

        while($row = mysqli_fetch_array($result)){
  
           echo "<tr>";
           
			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['reg_month']}/{$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>";
			$serial=$serial+1;
        }
       echo "</table>";
        // Free result set
        mysqli_free_result($result);
    } else{
        echo "Not Available any student ID";
	exit;	
    }
} else{
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
 
// Close connection
mysqli_close($link);
?>
<h2>Fees Details</h2>
<?php

$link = mysqli_connect("localhost", "tslibrary_user", "rb!tsl838", "tslibrary_data");
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}


// Attempt select query execution
$sql = "SELECT * FROM monthly_fees where student_id='$var'";
if($result = mysqli_query($link, $sql)){
    if(mysqli_num_rows($result) > 0){
   echo "<table>";
            echo "<tr>";
                echo "<th>Serial</th>";
				echo "<th>Student ID</th>";
                echo "<th>Month</th>";
                echo "<th>Year</th>";
				 echo "<th>Amount</th>";
				 echo "<th>Date</th>";
            echo "</tr>";
        while($row = mysqli_fetch_array($result))
		{
			
				echo "<tr>";
                echo "<td>" . $row['ID'] . "</td>";
				echo "<td>" . $row['student_id'] . "</td>";
                echo "<td>" . $row['fees_month'] . "</td>";
                echo "<td>" . $row['fees_year'] . "</td>";
                echo "<td>" . $row['paid_fees'] . "</td>";
				echo "<td>" . $row['payment_date'] . "</td>";
				echo "</tr>";
		  $fees_month=date('m');
		  $fees_year=date('Y');
		  $fees_date=date('d/m/Y');
        }
        echo "</table>";
        // Free result set
        mysqli_free_result($result);
    } else{
		
         
		  $fees_month=date('m');
		  $fees_year=date('Y');
		  $fees_date=date('d/m/Y');
    }
} else{
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
 
// Close connection
mysqli_close($link);
?>

    
   



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

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

</body>

</html>