<?php 
include ("kfunctions.php");
?>

<html>
<head>
<?php kheader(); ?>
<script src="js/sorttable.js"></script>
</head>
<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <?php ktopbar(); ?>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <?php kleftbar(); ?>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

      

                <!-- /.row -->

                

     <form method="post">               
<div class="col-lg-12">
  <div class="panel panel-green">
                <div class="panel-heading">
                                <h3 class="panel-title">Details </h3>
                            </div>
                            <div class="panel-body">

<table class="table table-bordered table-hover table-striped sortable">
<thead>
  <tr>
    <th></th>
    <th>Names</th>
    <th>Cash</th>
    <th>B_slip</th>
    <th>Mobile</th>
    <th>Cheque</th>
    <th>B_transfer</th>
    </tr>
</thead>
<tbody>
  <?php

  $date1=$_GET['date1'];
  $date2=$_GET['date2'];

  if ($role=="priaccount"){$dasection="(schoolclass>=1 and schoolclass<=10) and";}
  elseif ($role=="secaccount"){$dasection="(schoolclass>=21 and schoolclass<=26) and";}
    else {$dasection="";}
$dadate="datez>='$date1' and datez<='$date2'";


 $result = $dbh->query("select * from received where $dasection $dadate");
                              $count = $result->rowCount();

                              if ($count>0)
                                {
                                $row = $result->fetchObject();
 do{
$result2 = $dbh->query("select * from children where cid='$row->cid'");
$row2 = $result2->fetchObject();


                                echo "<tr><td>".$row2->cid."</td>
<td>".$row2->fname." ".$row2->sname."</td>
<td>".$row->am_cash."</td>
<td>".$row->am_bslip."</td>
<td>".$row->am_mobile."</td>
<td>".$row->am_cheque."</td>
<td>".$row->am_banktfer."</td>
                                </tr>";
 }while($row = $result->fetchObject());
                            }
                              else {echo "No results found.";}
                              
  ?>
                  <div class='col-lg-5'>
                  <div class='col-lg-2'>
                  
                  </div> 
                   </div>


                   
                             
                                </div>
                                
                            </div>
                   
                <!-- /.row -->





                 
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>

    <!-- Morris Charts JavaScript -->
    <?php useractivity("on page","4"); ?>

</body>

</html>