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




include 'dbc.php';


$userid=$_SESSION["userid"];
$month_name=$_POST["month"];
$sess1=$_POST["sess1"];
$btype=$_POST["btype"];
$marital=$_POST["marital"];
$sql = "SELECT * FROM paidsalary where month_name='$month_name' and status='$marital' and bname='$btype' and user_id='$userid' ORDER BY class_name";
$result=$conn->query($sql);
?>
 <strong class="card-title"> <center> <img src="logo1.jpg" align="middle" /></center></strong>
 <strong class="card-title"><center><h1><? echo $userid; ?></h1></center> </strong>
									 <strong class="card-title"><center><? echo $month_name; ?></center> </strong>
									 	 <strong class="card-title"><center>Bank Salary Slip</center> </strong>
                                   <table id="bootstrap-data-table-export" border="1" class="table table-striped table-bordered" width="100%">
                                    <thead>
									<?php
                                   
echo "<tr>";
echo "<th bgcolor=#0099FF> S.No</th>";
echo "<th bgcolor=#0099FF> Staff Name </th>";
echo "<th bgcolor=#0099FF> Father Name </th>";
echo "<th bgcolor=#0099FF> Department </th>";
echo "<th bgcolor=#0099FF> Desg </th>";
echo "<th bgcolor=#0099FF> Nic No </th>";
echo "<th bgcolor=#0099FF>Branch Code </th>";

echo "<th bgcolor=#0099FF> Account No </th>";
echo "<th bgcolor=#0099FF> Bank </th>";
echo "<th bgcolor=#0099FF> Net Salary</th>";

echo "</tr>";
$sno=1;
?>
                                    </thead>
									
                                    <tbody>
									<?php
                                       while($row = $result->fetch_assoc())
 
  {
  $id = $row['id'];	
   echo "<tr>";
   echo "<td align=center>" .$sno . "</td>";
echo "<td align=center>" .$row['tech_name'] . "</td>";
echo "<td align=center>" .$row['father_name'] . "</td>";
  echo "<td align=center>" .$row['status'] .  "</td>";
 echo "<td align=center>" .$row['class_name'] .  "</td>";
 echo "<td align=center>" .$row['nicno'] .  "</td>";
 echo "<td align=center>" .$row['bcode'] .  "</td>";
 echo "<td align=center>" .$row['accno'] .  "</td>";
  echo "<td align=center>" .$row['bname'] .  "</td>";
  echo "<td align=center>" .round($row['netsalary'],0) .  "</td>";
		  
		  
$trecord=$trecord + 1;
$tnetsalary=$tnetsalary + round($row['netsalary'],0);
$sno=$sno + 1;
  }
   echo "<tr>";
	echo "<td colspan=9 align=right><b>" ."Total Records::". $trecord ."</b></td>";
					echo "<td align=center><b>" .number_format($tnetsalary) . "</b></td>";
	  echo "</tr>";
	  echo "<tr height=100>";
	echo "<td colspan=10 align=center valign=top><b> Stamp and Signature:</b></td>";
		
	  echo "</tr>";
  ?>
                                       
                                    </tbody>
                                </table>
                         
<?php
}
?>

<br />
<h3><br />
  <br />
  <br />
  <br />
Prepared By:______________
<br />

<br />

<br />

<br />

<br />
