<?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 bgcolor="#2365ED"><a href="signin.php">Signout</a><a href="http://www.twitter.com"></a></TD>
    <TD><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> DAILY FEE COLLECTION REPORT </strong></p></TD>
  </TR>

<?php
include 'dbc.php';


$userid=$_SESSION["userid"];
$from_date=$_POST["from_date"];
$to_date=$_POST["to_date"];

$today=date("d-m-Y");
$sql = "select * from rec_fee where date between '$from_date' and '$to_date' and rt='CASH' and user_id='$userid' order by date";
$rec_fee=mysql_query($sql) or die("Error : " . mysql_error());
  
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
 echo "<h4 align=center>CASH </h4>";
echo "<tr>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Student RollNo </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Month Name </th>";
echo "<th bgcolor=yellow> Total Payable </th>";
echo "<th bgcolor=yellow> Fee Received </th>";
echo "<th bgcolor=yellow> Received In </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Id </th>";

echo "</tr>";
while($ppp=mysql_fetch_array($rec_fee))
{
    $id = $ppp['id'];	
   echo "<tr>";
   echo "<td width=20%>"  .$ppp["date"] . "</td>" ;
   echo "<td width=20%>"  .$ppp["std_rollno"] . "</td>" ;
   echo "<td width=15%>"  .$ppp["std_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp["class_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp["month_name"] . "</td>" ;
   echo "<td width=10%>"  .$ppp["total_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp["paid_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp["rt"] . "</td>" ;
   echo "<td width=20%>"  .$ppp["bal_fee"] . "</td>" ;
     echo "<td>" .$ppp['id'] . "</td>";
	   echo"<td> <a href ='rec_report.php?id=$id'>Print</a>";
   echo "</tr>";
  $amounts=$amounts + $ppp["paid_fee"];
     $tstd=$tstd + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total Fee Collection    :     " .$amounts . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total  Student    :     " .$tstd . "</th>";
 echo "</tr>";
   echo "</table>";
   
   
   $sql1 = "select * from rec_fee where date between '$from_date' and '$to_date' and rt='BANK ALF' and user_id='$userid' order by date";
$rec_fee1=mysql_query($sql1) or die("Error : " . mysql_error());
   echo "<h4 align=center>BANK ALFALAH </h4>";
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Student RollNo </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Month Name </th>";
echo "<th bgcolor=yellow> Total Payable </th>";
echo "<th bgcolor=yellow> Fee Received </th>";
echo "<th bgcolor=yellow> Received In </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Id </th>";

echo "</tr>";
while($ppp1=mysql_fetch_array($rec_fee1))
{
    $id1 = $ppp1['id'];	
   echo "<tr>";
   echo "<td width=20%>"  .$ppp1["date"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["std_rollno"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["std_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["class_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["month_name"] . "</td>" ;
   echo "<td width=10%>"  .$ppp1["total_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["paid_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["rt"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["bal_fee"] . "</td>" ;
     echo "<td>" .$ppp1['id'] . "</td>";
	   echo"<td> <a href ='rec_report.php?id=$id'>Print</a>";
   echo "</tr>";
  $amounts1=$amounts1 + $ppp1["paid_fee"];
     $tstd1=$tstd1 + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total Fee Collection    :     " .$amounts1 . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total  Student    :     " .$tstd1 . "</th>";
 echo "</tr>";
   echo "</table>";
   
   $sql1 = "select * from rec_fee where date between '$from_date' and '$to_date' and rt='BANK ALL' and user_id='$userid' order by date";
$rec_fee1=mysql_query($sql1) or die("Error : " . mysql_error());
   echo "<h4 align=center>BANK ALLIED </h4>";
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Student RollNo </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Month Name </th>";
echo "<th bgcolor=yellow> Total Payable </th>";
echo "<th bgcolor=yellow> Fee Received </th>";
echo "<th bgcolor=yellow> Received In </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Id </th>";

echo "</tr>";
while($ppp1=mysql_fetch_array($rec_fee1))
{
    $id1 = $ppp1['id'];	
   echo "<tr>";
   echo "<td width=20%>"  .$ppp1["date"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["std_rollno"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["std_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["class_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp1["month_name"] . "</td>" ;
   echo "<td width=10%>"  .$ppp1["total_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["paid_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["rt"] . "</td>" ;
   echo "<td width=20%>"  .$ppp1["bal_fee"] . "</td>" ;
     echo "<td>" .$ppp1['id'] . "</td>";
	   echo"<td> <a href ='rec_report.php?id=$id'>Print</a>";
	   echo"<td> <a href ='std_ledger2.php?id=$id'>Ledger</a>";
   echo "</tr>";
  $amounts112=$amounts112 + $ppp1["paid_fee"];
     $tstd112=$tstd112 + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total Fee Collection    :     " .$amounts112 . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total  Student    :     " .$tstd112 . "</th>";
 echo "</tr>";
   echo "</table>";
   
   
   
    $sql11 = "select * from rec_fee where date between '$from_date' and '$to_date' and rt='NEW' and user_id='$userid' order by date";
$rec_fee11=mysql_query($sql11) or die("Error : " . mysql_error());
   echo "<h4 align=center>NEW </h4>";
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Student RollNo </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Month Name </th>";
echo "<th bgcolor=yellow> Total Payable </th>";
echo "<th bgcolor=yellow> Fee Received </th>";
echo "<th bgcolor=yellow> Received In </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Id </th>";

echo "</tr>";
while($ppp11=mysql_fetch_array($rec_fee11))
{
    $id11 = $ppp11['id'];	
   echo "<tr>";
   echo "<td width=20%>"  .$ppp11["date"] . "</td>" ;
   echo "<td width=20%>"  .$ppp11["std_rollno"] . "</td>" ;
   echo "<td width=15%>"  .$ppp11["std_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp11["class_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp11["month_name"] . "</td>" ;
   echo "<td width=10%>"  .$ppp11["total_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp11["paid_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp11["rt"] . "</td>" ;
   echo "<td width=20%>"  .$ppp11["bal_fee"] . "</td>" ;
     echo "<td>" .$ppp11['id'] . "</td>";
	   echo"<td> <a href ='rec_report.php?id=$id'>Print</a>";
   echo "</tr>";
  $amounts11=$amounts11 + $ppp11["paid_fee"];
     $tstd11=$tstd11 + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total Fee Collection    :     " .$amounts11 . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total  Student    :     " .$tstd11 . "</th>";
 echo "</tr>";
   echo "</table>";
   
   $sql111 = "select * from rec_fee where date between '$from_date' and '$to_date' and rt='OTHERS' and user_id='$userid' order by date";
$rec_fee111=mysql_query($sql111) or die("Error : " . mysql_error());
   echo "<h4 align=center>OTHERS </h4>";
echo "<table border=1 width=78% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow> Date </th>";
echo "<th bgcolor=yellow> Student RollNo </th>";
echo "<th bgcolor=yellow> Student Name </th>";
echo "<th bgcolor=yellow> Class Name </th>";
echo "<th bgcolor=yellow> Month Name </th>";
echo "<th bgcolor=yellow> Total Payable </th>";
echo "<th bgcolor=yellow> Fee Received </th>";
echo "<th bgcolor=yellow> Received In </th>";
echo "<th bgcolor=yellow> Balance </th>";
echo "<th bgcolor=yellow> Id </th>";

echo "</tr>";
while($ppp111=mysql_fetch_array($rec_fee111))
{
    $id111 = $ppp111['id'];	
   echo "<tr>";
   echo "<td width=20%>"  .$ppp111["date"] . "</td>" ;
   echo "<td width=20%>"  .$ppp111["std_rollno"] . "</td>" ;
   echo "<td width=15%>"  .$ppp111["std_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp111["class_name"] . "</td>" ;
   echo "<td width=15%>"  .$ppp111["month_name"] . "</td>" ;
   echo "<td width=10%>"  .$ppp111["total_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp111["paid_fee"] . "</td>" ;
   echo "<td width=20%>"  .$ppp111["rt"] . "</td>" ;
   echo "<td width=20%>"  .$ppp111["bal_fee"] . "</td>" ;
     echo "<td>" .$ppp111['id'] . "</td>";
	   echo"<td> <a href ='rec_report.php?id=$id'>Print</a>";
   echo "</tr>";
  $amounts111=$amounts111 + $ppp111["paid_fee"];
     $tstd111=$tstd111 + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total Fee Collection    :     " .$amounts111 . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=8>" ."Total  Student    :     " .$tstd111 . "</th>";
 echo "</tr>";
   echo "</table>";
?>
<table width="78%" align="center">
<tr>
  <td height="46" colspan="2" bgcolor="#010044">&nbsp;</td>
  <td width="580" rowspan="2" bgcolor="#010044">&nbsp;</td>
</tr>
      <tr>
        <td height="52" bgcolor="#010044">&nbsp;</td>
        <td bgcolor="#010044">&nbsp;</td>
      </tr>
</table>
</body>
</html>
<?php
}
?>