CasperSecurity
<?php include ('header.php'); ?>
<div class="page-title">
<div class="title_left">
<h3>
<small>Home /</small> Report By Title
</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_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>SI No.</th>
<th>Title</th>
<!--- <th>User Type</th> -->
<th>No of Books</th>
</tr>
</thead>
<tbody>
<?php
$counter=1;
$total = 0;
$result1= mysqli_query($conn,"select * from book order by book_id ASC") or die (mysqli_error());
/*$result= mysql_query("select count(*) as total_no,book_id,book_title,count(book_title) as no_of_books from book group by book_title order by book_id ASC") or die (mysql_error());*/
$result= mysqli_query($conn,"select book_id,book_title,book_copies from book group by book_title order by book_id ASC") or die (mysqli_error());
$total=mysqli_num_rows($result1);
while ($row= mysqli_fetch_array ($result) ){
?>
<tr>
<td>
<?php echo $counter; ?>
</td>
<td><?php echo $row['book_title']; ?></td>
<td>
<?php echo $row['book_copies']; ?>
</td>
</tr>
<?php $counter++; } ?>
</tbody>
<tfoot>
<th>Total Books</th>
<th colspan="2"><?php echo $total; ?></th>
</tfoot>
</table>
</div>
<!-- content ends here -->
</div>
</div>
</div>
</div>
<?php include ('footer.php'); ?>