<?php session_start(); 
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='signin.php'>Sign in </a> First ";
}
elseif($_SESSION["usertype"]=="Parents")
{
 	echo "You are not Authorized This Page <a href='parents.php'>Back </a> ";
}
else
{

?>
<HTML>
<HEAD>
<TITLE>MIND TECH SOLUTION</TITLE>
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-base.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-topbar.css" />
<link rel="stylesheet" type="text/css" href="ddlevelsfiles/ddlevelsmenu-sidebar.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<style type="text/css">
<!--
.style1 {font-weight: bold}
.style2 {color: #FFFFFF}
.style3 {font-size: 36px}
.style4 {
	font-family: Tahoma;
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
<script type="text/javascript" src="ddlevelsfiles/ddlevelsmenu.js">

/***********************************************
* All Levels Navigational Menu- (c) Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (home final.psd) -->
<TABLE WIDTH=1000 BORDER=0 CELLPADDING=0 CELLSPACING=0 align=center>
  <TR>
    <TD COLSPAN=3 bgcolor="#2365ED"><div align="center"><img src="logo copy.jpg" width="134" height="130"></div></TD>
    <TD COLSPAN=9 bgcolor="#2365ED"><table width="561" border="0" align="left">
	
      <tr>
        <td width="555" height="123" align="center" valign="middle"><p align="center" class="style28"><span class="style37 style3"><strong><h1><font face="Palatino Linotype" color="#FFFFFF"><? echo "" . $_SESSION["userid"]; ?></font></h1></strong></span></p></td>
      </tr>
    </table></TD>
    <TD COLSPAN=2><a href="http://www.facebook.com"></a></TD>
    <TD><a href="http://www.twitter.com"></a></TD>
    <TD bgcolor="#2365ED"><a href="signin.php">Signout</a><a href="http://www.youtube.com"></a></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 bgcolor="#2365ED"><div id="ddtopmenubar" class="mattblackmenu">
<?php include("includes/menu.php") ?></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 align=center></TD>
  </TR>
  <TR>
    <TD COLSPAN=16 bgcolor="#2365ED">&nbsp;</TD>
  </TR>
  <TR>
    <TD height="26" COLSPAN=16 bgcolor="#000045"><p align="center" class="style36 style2"><strong> Class Wise Total Receivable Fee </strong></p></TD>
  </TR>

<?php
include 'dbc.php';

$userid=$_SESSION["userid"];
$cname=$_POST["class_name"];
$sql = "select * from admission where bal > 0 and class_name='$cname' and user_id='$userid' ORDER BY std_rollno";
$std_ledger=mysql_query($sql) or die("Error : " . mysql_error());
  
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> Adm No </th>";
echo "<th bgcolor=yellow> Roll No </th>";
echo "<th bgcolor=yellow> Portal No </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Father Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Cell No 1 </th>";
echo "<th bgcolor=yellow> Monthly Fee </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Currnet fine </th>";
echo "<th bgcolor=yellow> Fine Bal </th>";


echo "</tr>";
while($ppp=mysql_fetch_array($std_ledger))
{
   
   echo "<tr>";
echo "<td width=10%>" .$ppp['std_rollno'] . "</td>";
   echo "<td width=10%>"  .$ppp["barcode"] . "</td>" ;
    echo "<td width=10%>"  .$ppp["allied_code"] . "</td>" ;
   echo "<td width=20%>"  .$ppp["std_name"] . "</td>" ;
    echo "<td width=10%>"  .$ppp["father_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp["class_name"] . "</td>" ;
echo "<td width=10%>"  .$ppp["cell_1"] . "</td>" ;
   echo "<td width=10%>"  .$ppp["monthly_fee"] . "</td>" ;
   echo "<td width=10%>"  .$ppp["bal"] . "</td>" ;
   echo "<td width=10%>"  .$ppp["fine"] . "</td>" ;
   echo "<td width=10%>"  .$ppp["finebal"] . "</td>" ;
   
   
   

   echo "</tr>";
  $amounts=$amounts + $ppp["bal"];
   $amounts1=$amounts1 + $ppp["monthly_fee"];
    $amounts2=$amounts2 + $ppp["fine"];
	 $amounts3=$amounts3 + $ppp["finebal"];
     $cnt=$cnt + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Receivable    :     " .$amounts . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Fee    :     " .$amounts1 . "</th>";
 echo "</tr>";
  echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Current Fine   :     " .$amounts2 . "</th>";
 echo "</tr>";
  echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Fine Bal    :     " .$amounts3 . "</th>";
 echo "</tr>";
  echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Student    :     " .$cnt . "</th>";
 echo "</tr>";
   echo "</table>";
?>
<table width="78%" align="center" bgcolor="#010044">
<tr>
  <td width="580" height="52" bgcolor="#010044">&nbsp;</td>
</tr>
    </table>
</body>
</html>
<?php
}
?>