<?php 

include ("../core/kfunctions.php");?>

<html>

<head>

<?php kheader(); ?>

<?php 

require_once("../core/connect.php");



?>

<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">



                <!-- Page Heading -->

                <div class="row">

                    <div class="col-lg-12">

                        <h1 class="page-header">

                            

                        </h1>

                        

                    </div>

                </div>

                <!-- /.row -->



                <div class="row">

                    <div class="col-lg-12">

                        <div class="panel panel-default">

                            <div class="panel-body">

                            

<div class="panel panel-green"><!--Initiative-->

<div class="panel-heading"><h3 class="panel-title">Showing all income on <?php echo date("Y-m-d"); ?></h3></div>

<div class="panel-body">

<table class="table table-bordered table-hover table-striped sortable">



 <thead>

<tr>

<th>ID</th>

<th>Date earned</th>

<th>Slip date</th>

<th>Student name</th>

<th>Slip ID</th>

<th>Term</th>

<th>Amount</th>

<th>Balance	</th>



</tr></thead>

<?php



require_once("../core/connect.php");



$mytoday=date("Y-m-d");

$result=$dbh->query("select * from received where autodate like '%$mytoday%'");

$row=$result->fetchObject();

$count=$result->rowCount();









// If result matched $myusername and $mypassword, table row must be 1 row





if($count>0){ 

do {

	$result2=$dbh->query("select * from children where cid='$row->cid'");

$row2=$result2->fetchObject();

echo "

<tr>

<td><a href='transupdate.php?tid=".$row->tid." & term=".$row->term."'>".$row->tid."</td>

<td>".$row->autodate."</td>

<td>".$row->datepaid."</td>

<td>".$row->cid."-".$row2->fname."&nbsp;".$row2->sname."</td>

<td>".$row->slipid."</td>

<td>".$row->term."</td>

<td>".$row->amount."</td>

<td>".$row->bcf."</td>

</tr>";}

while($row=$result->fetchObject());

}

else {echo "So far, no children have paid today. Click <a href='allfees.php'>here to view income including other days</a> ";}

?>

</table>







</div></div>



</div>

                            </div> </div>

                    </div>

                </div>

                <!-- /.row -->



               



            </div>

            <!-- /.container-fluid -->



        </div>

        <!-- /#page-wrapper -->



    </div>

    <!-- /#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>



</body>



</html>

