GOOGLE
<?php include('header.php'); ?>
<?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 class="active"><a href="view_borrow.php">View Borrowed Books List</a></li>
<li><a href="due_date_list.php">Over Due List</a></li>
<li><a href="return_book_list.php">Return Book List</a></li>
<li><a href="penalty_due_books.php">All Due / Paid Penalty</a></li>
</ul>
<!-- -->
<center class="title">
<h1>New Books</h1>
</center>
<table cellpadding="0" cellspacing="0" border="1" class="table" id="example">
<thead>
<tr>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Sr. No.</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Borrower Name</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Class</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Acc. No.</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Book title</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Publication Year</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;"> Borrowed On</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Due Date</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Over Due</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Book Status</th>
<th style="background-color: #0088CC; color: white; font-size: 11px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if($search!="")
{
$user_query=mysql_query("SELECT * FROM `book` WHERE `book_status`='borrow' OR `book_status`='willing'")or die(mysql_error());
}elseif($accNo!=''){
$user_query=mysql_query("SELECT * FROM `book` WHERE `book_status`='borrow' OR `book_status`='willing' AND `acc_no`='".$accNo."'")or die(mysql_error());
}else{
$user_query=mysql_query("SELECT * FROM `book` WHERE `book_status`='borrow' OR `book_status`='willing'")or die(mysql_error());
}
$i=1;
while($row=mysql_fetch_array($user_query)){
$borrowdetails = mysql_query("SELECT * FROM `borrowdetails` WHERE `book_id`='".$row['book_id']."' AND `date_return`=''");
$book_id = mysql_fetch_array($borrowdetails);
$date_borrow = mysql_query("SELECT * FROM `borrow` WHERE `borrow_id`='".$book_id['borrow_id']."'");
$borrow1 = mysql_fetch_array($date_borrow);
$reg = mysql_query("SELECT * FROM `registration` WHERE `id`='".$book_id['member_id']."'");
$selreg = mysql_fetch_array($reg);
?>
<tr>
<td><?php echo $i; ?></td>
<td><b><?php echo $selreg['name']." ".$selreg['lname']; ?></b></td>
<td><b><?php echo $selreg['class']; ?></b></td>
<td><?php echo $row['acc_no']; ?></td>
<td><?php echo $row['book_title']; ?></td>
<td><?php echo $row['publication_date']; ?></td>
<td><?php echo $book_id['date_borrow']; ?></td>
<td><?php echo $book_id['due_date']; ?> </td>
<td> <?php $startTimeStamp = strtotime($book_id['due_date']);
$dates = date("Y-m-d");
$endTimeStamp = strtotime($dates);
$timeDiff = abs($endTimeStamp - $startTimeStamp);
$numberDays = $timeDiff/86400; // 86400 seconds in one day
if($book_id['due_date']<=$dates){
// and you might want to convert to integer
echo $numberDays = intval($numberDays);
}?></td>
<td><?php echo $book_id['borrow_status'];?></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-primary btn-xs">Return</a>
<?php include('modal_return.php'); ?>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include('footer.php') ?>
Copyright © 1945 -