<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{


?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

   <!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        
        <!-- Header-->

        

        <div class="content mt-3">
            <div class="animated fadeIn">
                <div class="row">

                    <div class="col-md-14">
                        <div class="card">
						<div class="page-title">
						 <strong class="card-title"> <center> <img src="logo1.jpg" align="middle" /></center></strong>
                        <h2><center><? echo "" . $_SESSION["userid"]; ?></center></h2>
                    </div>
                            <div class="card-header">
							
                                <strong class="card-title"><center> Student Fee Breakup Summary Report</center> </strong>
                            </div>
                            <div class="card-body">
							<?php

include 'dbc.php';


$userid=$_SESSION["userid"];
$cname=$_POST["cname"];

?>
                                <table id="bootstrap-data-table-export" class="table table-striped table-bordered">
                                    <thead>
									<?php
                                       
echo "<tr>";
 echo "<th width=30% colspan=6 bgcolor=#0099FF>" ."Total Students". "</th>";
 echo "<th width=30% colspan=6 bgcolor=#0099FF>" ."Fee Breakup". "</th>";
  echo "<th width=30% colspan=6 bgcolor=#0099FF>" ."Tuition fee". "</th>";
  
 echo "</tr>";
$sql = "SELECT * FROM feebreak";
$result=$conn->query($sql);
  while($row = $result->fetch_assoc())
   {
   $cname=$row["cname"];
  $trecord1=0;
$tmfee1=0;
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                     
 
  $sql1 = "SELECT * FROM admission where mfee = '$cname' and status='Active' and user_id='$userid'";
$result1=$conn->query($sql1);
while($row1 = $result1->fetch_assoc())
   {
$trecord1=$trecord1 + 1;
$tmfee1=$tmfee1 + $row1['mfee'];

  }
   echo "<tr>";
    echo "<th width=30% colspan=6>" .$trecord1. "</th>";
 echo "<th width=30% colspan=6>" .$cname. "</th>";
  echo "<th width=30% colspan=6>" .number_format($tmfee1). "</th>";
  
 echo "</tr>";
 $tamounts=$tamounts + $tmfee1;
 $tstd=$tstd + $trecord1;
 
  }
  
   echo "<tr>";
  
 echo "<th width=30% colspan=6>" ."Total". "</th>";
  echo "<th width=30% colspan=6>" .number_format($tamounts). "</th>";
   echo "<th width=30% colspan=6>" .$tstd. "</th>";
 echo "</tr>";
  ?>
  
                                       
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>


                </div>
            </div><!-- .animated -->
        </div> <!-- .content -->
    </div><!-- /#right-panel -->

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}
?>