<!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>
<body>

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

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


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

<?php
	 $bookname = $_POST['bookname'];
    $allotment = $_POST['allotment'];
    $receivedate = $_POST['receivedate'];
	$student_id=$_POST['student_id'];
	$bookfordays=$_POST['bookfordays'];
	$amount=$_POST['amount'];
$link = mysqli_connect("localhost", 'tslibrary_user', 'rb!tsl838', 'tslibrary_data');
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}
	$ids= $_POST['ids'];
    $receivedate=$_POST['receivedate'];
// Attempt update query execution
$sql = "UPDATE book_allot_receive SET 
book_receive_date='$receivedate',
book_for_days='$bookfordays',
book_rent_amount='$amount'
WHERE id='$ids'";
if(mysqli_query($link, $sql)){
    echo "Records were updated successfully.";
} else {
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
 
// Close connection
mysqli_close($link);
?>
 <a href="book_allotstudent.php"><h1>Go Back</h2></a>
   



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

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

</body>

</html>