GOOGLE
<?php include('header.php');
date_default_timezone_set('Asia/Calcutta'); ?>
<?php include('session.php'); ?>
<?php include('navbar_borrow.php'); ?>
<div class="container">
<div class="margin-top">
<?php $name = mysql_query("SELECT * FROM `registration` WHERE `id`='".$_SESSION['user_id']."'");
$selName = mysql_fetch_array($name);?>
<div class="row">
<div class="alert alert-info"><strong>Borrowed Books List <span style="color: white; float: right;"> WELCOME : <?php echo $selName['name'];?> <?php echo $selName['lname'];?></span></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">Returned Book List</a></li>
<li><a href="penalty.php">All Due / Paid Penalty</a></li>
</ul>
<form method="post">
<div class="span2"><label class="control-label" for="inputEmail"><b>Search Borrower Name</b></label>
</div>
<?php if(isset($_POST['search'])){
extract($_POST);
$search = $_POST['searchmember'];
}
?>
<div class="span3">
<form name="myform" method="POST">
<div class="control-group">
<div class="controls">
<select name="searchmember" class="chzn-select" required/>
<option value="">Select Name Here</option>
<?php $result = mysql_query("SELECT * FROM `registration` ORDER BY `name` ASC")or die(mysql_error());
while ($row=mysql_fetch_array($result)){ ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['name']." ".$row['lname']; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="span1">
<div class="control-group">
<label class="control-label" for="inputEmail"></label>
<div class="controls">
<!-- <input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="due_date" id="sd" maxlength="10" style="border: 3px double #CCCCCC;" required/> -->
<input type="submit" name="search" value="Search" class="btn btn-success">
</div>
</div>
</div>
</form>
<?php if(isset($_POST['accsearch'])){
$accNo = $_POST['accno'];
}?>
<form name="" method="POST">
<div class="span3">
<div class="control-group">
<div class="controls">
<select name="accno" class="chzn-select" required/>
<option>Select Acc Number Here</option>
<?php $result = mysql_query("SELECT * FROM `book` ORDER BY `book_id` ASC")or die(mysql_error());
while ($row=mysql_fetch_array($result)){ ?>
<option value="<?php echo $row['acc_no']; ?>"><?php echo $row['acc_no']; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="span1">
<div class="control-group">
<label class="control-label" for="inputEmail"></label>
<div class="controls">
<input type="submit" name="accsearch" value="Search" class="btn btn-warning">
</div>
</div>
</div>
</form>
<div class="span2">
<div class="control-group">
<label class="control-label" for="inputEmail"></label>
<div class="controls">
<!-- <input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="due_date" id="sd" maxlength="10" style="border: 3px double #CCCCCC;" required/> -->
<a href="request_book.php" class="btn btn-info">Back to Request</a>
</div>
</div>
</div>
</form>
<div class="span12">
<table cellpadding="0" cellspacing="0" border="1" class="table" 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;">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;">Acc. 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;">Borrowed On</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Due Date on</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Over Due</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Book Status</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Image</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Action</th>
<th style="background-color: #4267B2; color: white; font-size: 11px;">Exchange Book</th>
</tr>
</thead>
<tbody>
<?php
if($search!=""){
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' OR `borrow_status`='willing'")or die(mysql_error());
}elseif($accNo!=''){
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' OR `borrow_status`='willing' AND `acc_no`='".$accNo."'")or die(mysql_error());
}else{
if($_GET['id']==""){
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' OR `borrow_status`='willing' AND `date_return`=''")or die(mysql_error());
}else{
$user_query=mysql_query("SELECT * FROM `borrowdetails` WHERE `borrow_status`='borrow' OR `borrow_status`='willing' AND `date_return`='' AND `member_id`='".$_GET['id']."'")or die(mysql_error());
}
}
$i=1;
while($row=mysql_fetch_array($user_query)){
$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);?>
<tr>
<td><?php echo $i; ?></td>
<td><b style="color: red;"><?php echo $selreg['name']." ".$selreg['lname']; ?></b></td>
<td><b style="color: red;"><?php echo $selreg['class']; ?></b></td>
<td><?php echo $book_id['acc_no']; ?></td>
<td><?php echo $book_id['book_title']; ?></td>
<td><?php echo date("d-m-Y",strtotime($row['date_borrow'])); ?></td>
<td><?php echo date("d-m-Y",strtotime($row['due_date'])); ?> </td>
<td> <?php $startTimeStamp = strtotime($row['due_date']);
$dates = date("Y-m-d");
$endTimeStamp = strtotime($dates);
$timeDiff = abs($endTimeStamp - $startTimeStamp);
$numberDays = $timeDiff/86400;
$numberDaysss = intval($numberDays); // 86400 seconds in one day
if($row['due_date']<$dates){
// and you might want to convert to integer
echo $numberDays = intval($numberDays)*10; echo "Rs.";
}else{
echo '0';
}?></td>
<td><b style="color: green;"><?php if($row['borrow_status']=="borrow"){ echo "Borrowed";}elseif($row['borrow_status']=="willing"){ echo "Willing to Return";}?></b></td>
<td><img src="../<?php echo $selreg['image'];?>" width="120" height="120"></td>
<td>
<?php if($row['due_date']<$dates){?>
<a rel="tooltip" title="Return" onclick="return confirm('Are you sure you want Pay and Return Book?')" href="due_date_list.php?id=<?php echo $row['book_id'];?>&&member_id=<?php echo $selreg['id'];?>" class="btn btn-success btn-xs">Pay Penalty</a>
<?php }else{ ?>
<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 } ?>
</td>
<td>
<a href="#exchange" data-toggle="modal" rel="tooltip" title="Return" onclick="return confirm('Are you sure you want to Exchange Book?')" class="btn btn-success btn-xs">Exchange</a>
<?php include('modal_exchange.php'); ?>
</td>
</tr>
<?php $i++;} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include('footer.php') ?>
Copyright © 1945 -