<?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> ";
}
elseif($_SESSION["usertype"]=="Sub User")
{
 	echo "You are not Authorized This Page <a href='admission_form_raheem.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> Teacher Ledger Report </strong></p></TD>
  </TR>


<?php
include 'dbc.php';

$userid=$_SESSION["userid"];
$month_name=$_POST["month_name"];
$camp=$_POST["camp"];
$sql = "select * from paidsalary where month_name='$month_name' and user_id='$userid' order by camp,tech_name";
   $std_ledger1=mysql_query($sql) or die("Error : " . mysql_error());
echo "<table border=1 width=100% align=center bgcolor=#FFFF66>";
echo "<tr>";
echo "<th bgcolor=yellow colspan=3> $month_name </th>";
echo "<th bgcolor=yellow colspan=9> Allownces </th>";
echo "<th bgcolor=yellow colspan=6> Deduction </th>";
echo "</tr>";
echo "<tr>";
echo "<th bgcolor=yellow> Campus </th>";
echo "<th bgcolor=yellow> Teacher Name </th>";
echo "<th bgcolor=yellow> Basic Salary </th>";
echo "<th bgcolor=yellow> CTA </th>";
echo "<th bgcolor=yellow> PA </th>";
echo "<th bgcolor=yellow> COOD/ST </th>";
echo "<th bgcolor=yellow> SSTA </th>";
echo "<th bgcolor=yellow> OTHER </th>";
echo "<th bgcolor=yellow> LEAVE </th>";
echo "<th bgcolor=yellow>" .$std_ledger1['allname1'] . "</th>";
echo "<th bgcolor=yellow>" .$std_ledger1['allname1'] . "</th>";
echo "<th bgcolor=yellow> Gross Salary </th>";
echo "<th bgcolor=yellow> Other Ded </th>";
echo "<th bgcolor=yellow> Adv Ded </th>";
echo "<th bgcolor=yellow> Sec Ded </th>";
echo "<th bgcolor=yellow>" .$std_ledger1['dedname1'] . "</th>";
echo "<th bgcolor=yellow>" .$std_ledger1['dedname2'] . "</th>";
echo "<th bgcolor=yellow> Net Salary </th>";
echo "</tr>";
while($row = mysql_fetch_array($std_ledger1))
  {
   echo "<tr>";
 
    echo "<td>" .$row['camp'] . "</td>";
	 echo "<td>" .$row['tech_name'] . "</td>";
	  echo "<td>" .$row['monthly_salary'] . "</td>";
	   echo "<td>" .$row['cta'] . "</td>";
	    echo "<td>" .$row['pa'] . "</td>";
		 echo "<td>" .$row['cood'] . "</td>";
		  echo "<td>" .$row['ssta'] . "</td>";
		   echo "<td>" .$row['other'] . "</td>";
			 echo "<td>" .$row['leave1'] . "</td>";
			  echo "<td>" .$row['allamount1'] . "</td>";
			    echo "<td>" .$row['allamount2'] . "</td>";
		   echo "<td>" .$row['gross_salary'] . "</td>";
		   
		    echo "<td>" .$row['any_deduction'] . "</td>";
			echo "<td>" .$row['adv_deduction'] . "</td>";
			echo "<td>" .$row['sec_deduction'] . "</td>";
			echo "<td>" .$row['dedamount1'] . "</td>";
			echo "<td>" .$row['dedamount2'] . "</td>";
			
			 echo "<td>" .$row['net_salary'] . "</td>";
			 
  echo "</tr>";

  $amounts=$amounts + $row["net_salary"];
     $cnt=$cnt + 1;

 }
 echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total salary    :     " .$amounts . "</th>";
 echo "</tr>";
 echo "<tr>";
 echo "<th width=20% colspan=5>" ."Total Teacher    :     " .$cnt . "</th>";
 echo "</tr>";
echo "</table>";

?> 
<table width="78%" align="center" bgcolor="#010044">
<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
}
?>