
<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}

include("../opendb.php");
include("../test.php");

$psres=mysqli_query($db,"select brpass from br_master where brname='$br'");
$psrow=mysqli_fetch_array($psres);
 if($psrow[0]!=$pswd)
 {
   print "<center><blink><font color=red> Invalid Password</font>";
   return;
 }
?>
<style>
 td{color:#455342;font-family:helvetica;font-size:12}
 th{color:white;font-family:helvetica;font-size:12}
</style>
<?


$sql="select * from branch where brcode='$brcode'";
$brres=mysqli_query($db,$sql);
$brow=mysqli_fetch_array($brres);
?>
<center><span style={letter-spacing:5;color:455342}>
<U><b>Employee Details</b></U>
</SPAN>
<table width=100% BORDER=0>
<?
$brname=explode(',',$branch);
?>
<tr><td align=center COLSPAN=2><span style={letter-spacing:3}><b><?print STRTOUPPER($brname[0])
?></b> </span> <br>
<?
Print $brow[braddr].''.$brow[brcity]
?>
<br>

</td></tr>
</table>
<table border=0  bgcolor='455342' cellspacing=1 cellpadding=3>
<?

$ql="select * from empmaster where brcode='$brcode' and doret='0000-00-00' order by br,empname";
$es=mysqli_query($db,$ql) or die('Err:'.mysqli_error());
 print "<tr bgcolor='#6B852C'><th>Emp Name<th>Address<th>BirthDate<th>BloodGrp<th>Qualification<th>JoiningDate<th>Conf.Date <th>Marriage Dt<th>desig.<th>phone <th>mob<th>branch<th>Cur.Salary<th>Revised on<th>Experience";
 $i=1; 
while($ow=mysqli_fetch_array($es))
{
	$sqltt="select totsal,ondate from emp_pay  where brcode='$brcode' and empcode='$ow[empcode]' order by ondate desc limit 1";
	$restt=mysqli_query($db,$sqltt) or die('Err:'.mysqli_error());
	$weett=mysqli_fetch_array($restt);
	$sal=$weett[0];
	$ondt=datetohtml($weett[1]);
	print "<tr bgcolor='#E6E6E6' ><td><b>$ow[empname]</td>";
	print "<td><b>$ow[peraddr]</td>";
	print "<td><b>".datetohtml($ow[dob])."</td>";
	print "<td><b>$ow[bgrp]</td>";
	$mquali = '';
	if($ow[quali4]!='select')
	{
		$mquali=$ow[quali4];
	}
	elseif($ow[quali3]!='select')
	{
		$mquali=$ow[quali3];		
	}
	elseif($ow[quali2]!='select')
	{
		$mquali=$ow[quali2];		
	}
	else
	{
		$mquali=$ow[quali1];
	}
	print "<td><b>$mquali</td>";
	print "<td><b>".datetohtml($ow[doj])."</td>";
	print "<td><b>".datetohtml($ow[doconf])."</td>";
	print "<td><b>".datetohtml($ow[domarg])."</td>";
	print "<td><b>$ow[design]</td>";
	print "<td><b>$ow[resph]</td>";
	print "<td><b>$ow[mob]</td>";
	print "<td><b>$ow[br]</td>";
	print "<td align='right'><b>$sal</td>";
	print "<td><b>$ondt</td>";
	$dt=$ow[doj];
	$sq="select to_days(curdate())-to_days('$dt')";
	$dtre=mysqli_query($db,$sq)or die(mysqli_error());
	$dtrow=mysqli_fetch_row($dtre);
	$exp=$dtrow[0]/365;
	$exp=round($exp,2);
	print "<td align='right'><b>$exp</td>";
}


?>
</table>

