
<?php
//if($_REQUEST['Search'])
//{
$GetEMPId=$s->GetFieldValue('empmaster',"mst_www_userid='".$_SESSION['UserID']."'",'id');

	$GetRecord = "Select * from empmaster where id='".$GetEMPId."'";
	$i=0;	   
	$ResultData = DB_query($GetRecord,$db);
	while($RowData = DB_fetch_array($ResultData)){?>
<?php 

$SQLEmpDet=DB_query("select emp_name,emp_code,emp_site,designation from empmaster where id='".$RowData['id']."'",$db);
$EmpADetail=DB_fetch_array($SQLEmpDet);
$desgiName=$s->GetFieldValue('desigmaster',"id='".$EmpADetail['designation']."'",'designame')?>
<form action="" method="post">
<table border="0" cellpadding="0" cellspacing="0"  width="100%" style="border-collapse:collapse; border:#999999 solid 1px;">

<tr class="row1">
	<td colspan="4"  valign="top">
	<fieldset><legend> <strong>Leave summary</strong></legend>
	<table width="100%" cellpadding="3" cellspacing="0" border="1" style="border-collapse:collapse; border:#999999 solid 1px;">
	<tr style="height:30px;">
		<td class="tabledata"><strong>Leave Type</strong></td>
		<td class="tabledata"><strong>Allowed Leave</strong></td>
		<td class="tabledata"><strong>Applied Leave</strong></td>
		<td class="tabledata"><strong>Leave Taken</strong></td>
		<td class="tabledata"><strong>Remaining Leave</strong></td>
		<td class="tabledata"><strong>Detailed View</strong></td>
		
	</tr>
	<?php 
	$GetEmpLeave = "Select * from emp_leave where  emp_id='".$RowData['id']."' ";	   
	$ResultEmpLeave = DB_query($GetEmpLeave,$db);
	while($RowEmpLeave=DB_fetch_array($ResultEmpLeave)){
	$AppliedLeave=leave_calculationForApplied($RowData['id'],$RowEmpLeave['leave_type']);
	$TakenLeaved= leave_calculation($RowData['id'],$RowEmpLeave['leave_type'])
	?>
	<tr bgcolor="#c1c1c1">
		<td><?php
		echo $s->getField('leavemaster','id',$RowEmpLeave['leave_type'],'leavename');
		echo "( ".$RowEmpLeave['leave_type']." )";?> </td>
		<td><?php  echo $RowEmpLeave['leave_days']?></td>
		<td> <?php if($AppliedLeave==''){echo '0';}else{echo $AppliedLeave;}?></td>
		<td> <?php if($TakenLeaved==''){echo '0';}else{echo $TakenLeaved;}?></td>
		<td><?php  if($TakenLeaved!=''){echo $RowEmpLeave['leave_days']-$TakenLeaved;}
		else{echo $RowEmpLeave['leave_days'];};?> </td>
		<td>
		<input type="hidden" id="empId_<?php echo $i; ?>" value="<?php echo $RowData['id']; ?>" />
		<input type="hidden" id="LeaveType_<?php echo $i; ?>" value="<?php echo $RowEmpLeave['leave_type']; ?>" />
		<input type="button" name="viewleaveA" id="viewleaveA_<?php echo $i; ?>" class="ViewLeaveIcon" />
		</td>
		
	</tr>
	<?php $i++;} ?>				
	</table>
	</fieldset>
	</td>
	</tr>
</table>
</form>
<?php }//}  ?>






