GOOGLE
<?php include('header.php');
date_default_timezone_set('Asia/Calcutta');?>
<?php include('session.php'); ?>
<?php include('navbar_books.php'); ?>
<div class="container">
<div class="margin-top">
<div class="row">
<div class="span12">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><i class="icon-user icon-large"></i> Books Table</strong>
</div>
<ul class="nav nav-pills">
<li><a href="books.php">All Books List</a></li>
<li><a href="view_borrow.php">View Borrowed Books List</a></li>
<li class="active"><a href="due_date_list.php">Over Due List</a></li>
<li><a href="return_book_list.php">Returned Book List</a></li>
<li><a href="penalty.php">All Due / Paid Penalty</a></li>
</ul>
<center class="title">
</center>
<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered" id="example">
<thead>
<tr>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Sr.No</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Book title</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Borrower Name</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Class</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Borrowed On</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Due Date</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Over Due day/s</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Penalty</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Direct Return</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Pay And Return</th>
</tr>
</thead>
<tbody>
<?php
if($_GET['id']!=''){
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' AND `member_id`='".$_GET['member_id']."' AND `book_id`='".$_GET['id']."' OR `borrow_status`='willing' AND `member_id`='".$_GET['member_id']."' AND `book_id`='".$_GET['id']."'");
}else{
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' OR `borrow_status`='willing'"); }
$i=1;
while($row=mysql_fetch_array($user_query)){
$id=$row['borrow_id'];
$book_id=$row['book_id'];
$borrowdetails = mysql_query("SELECT * FROM `book` WHERE `book_id`='".$row['book_id']."'");
$book_id = mysql_fetch_array($borrowdetails);
$reg = mysql_query("SELECT * FROM `registration` WHERE `id`='".$book_id['member_id']."'");
$selreg = mysql_fetch_array($reg); ?>
<?php $startTimeStamp = strtotime($row['due_date']);
$dates = date("Y-m-d");
$endTimeStamp = strtotime($dates);
$timeDiff = abs($endTimeStamp - $startTimeStamp);
$numberDays = $timeDiff/86400; // 86400 seconds in one day
if($row['due_date']<=$dates){
// and you might want to convert to integer
$numberDays = intval($numberDays);
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $book_id['book_title']; ?></td>
<td><?php echo $selreg['name']." ".$selreg['lname']; ?></td>
<td><?php echo $selreg['class']; ?></td>
<td><?php echo $row['date_borrow']; ?></td>
<td><?php echo date("d-m-Y",strtotime($row['due_date'])); ?> </td>
<td><?php echo $numberDays;?></td>
<td><?php echo $pen = $numberDays*10;?></td>
<td>
<a rel="tooltip" title="Return" onclick="return confirm('Are you sure you want to Return Book?')" href="return_save.php?id=<?php echo $row['book_id'];?>" class="btn btn-info btn-xs">Direct Return</a>
</td>
<td>
<a href="transaction.php?id=<?php echo $row['book_id'];?>&&member_id=<?php echo $selreg['id'];?>&&penalty=<?php echo $pen;?>&&overdue=<?php echo $numberDays;?>" class="btn btn-success btn-xs">Pay & Return</a>
</td>
<?php include('modal_return.php'); ?>
</td>
</tr>
<?php } $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include('footer.php') ?>
Copyright © 1945 -