<?php include ('header.php'); ?>

        <div class="page-title">
            <div class="title_left">
                <h3>
					<small>Home /</small> Borrowed Books
                </h3>
            </div>
        </div>
        <div class="clearfix"></div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
						<form method="post"> 
						<div class="col-xs-4">
							<input type="text" name="barcode" class="form-control" placeholder="Barcode....." value="<?php echo (isset($_POST['barcode'])) ? $_POST['barcode']: ""; ?>">
						</div>
						</form>
		<br />
                        <ul class="nav navbar-right panel_toolbox">
                            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                        <!-- If needed 
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                    <i class="fa fa-wrench"></i>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">Settings 1</a></li>
                                    <li><a href="#">Settings 2</a></li>
                                </ul>
                            </li>
						-->
                            <li><a class="close-link"><i class="fa fa-close"></i></a></li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">
                        <!-- content starts here -->

						<div class="table-responsive">
							<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
								
							<thead>
								<tr>
									<th>Book Barcode</th>
									<th>Title</th>
									<th>Author</th>
									<th>ISBN</th>
									<th>Category</th>
								</tr>
							</thead>
							<tbody>
							
							<?php
							if(isset($_POST['barcode']))
							{
							$result= mysqli_query($con,"select * from book left join category on category.category_id = book.category_id WHERE book.book_barcode = '{$_POST['barcode']}' order by book.book_id DESC ") or die (mysqli_error());
							while ($row= mysqli_fetch_array ($result) ){
							?>
							<tr>
								<td><?php echo $row['book_barcode']; ?></td>
								<td><?php echo $row['book_title']; ?></td>
								<td><?php echo $row['author']; ?></td>
								<td><?php echo $row['isbn']; ?></td>
								<td><?php echo $row['classname']; ?></td> 
							</tr>
							<?php 
							} 
							}
							?>
							</tbody>
							</table>
						</div>
						
                        <!-- content ends here -->
                    </div>
                </div>
            </div>
        </div>

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