<?php require "_header.php";
error_reporting(1);?>
<!-- start custom CSS/JS -->
<!-- end custom CSS/JS -->
<div id="main-content2" align="center">
<!--start main body  -->
<?php	
	$objEmployee = new EmployeeMgmt();	
	
	$section = Escape($_REQUEST['sectionid']);
	$month = Escape($_REQUEST['monthname']);
	$year = Escape($_REQUEST['year']);
	
	$days 		= daysInMonth($month,$year);
	$monthname1  = date("F", mktime(0, 0, 0, $month, 1, 1));
	
	$limit=0;
	$start=0;
//	$condition=" and employee_section = $section ";
	$order_field="employee_salaryno,employee_name";
	$order_type="ASC";
	
	$result = $objEmployee->getAllRecords($limit,$start,$condition,$order_field,$order_type);
	
	function makeRow($days)
	{
	?>
			<table cellpadding="0" height="100%" border="1" cellspacing="0"  width="100%">
				<tr height="100%" style="border:#FFF; border-bottom:none;">
				<?php
						for($j=0; $j<$days; $j++){
				?>
							<td height="100px;" style="border-bottom:none;border-top:none">&nbsp;</td>
							
				<?php
						}
				?>
				
				</tr>
				
			</table>			
	<?php
	}
?>
<br/><br/>
<table border="1" cellpadding="0" cellspacing="0" class="ladscap">
	<tr>
		<th colspan="3" class="fnt10"><strong><?php print "Month :: ".$monthname1."&nbsp;&nbsp; Year :: ".$year; ?></strong></th>
		<td rowspan="2" height="150%" width="50%" style="border-bottom:none;border-right:none;border-left:none">
			<table border="1" cellpadding="0" cellspacing="0" height="100%" width="100%">
				<tr>
					<?php
						for($i=1; $i<=$days; $i++){ ?> 
							<td height="80px;" align="center"  class="rightbottombo">
							<?php $day = date("D", mktime(0,0,0,$month,$i,$year)); 
								  for($l=0; $l<strlen($day); $l++){
								  	print ucwords($day[$l])."<br>";
								}	
							?>							</td> 
					<?php 	
						}
					?>
				</tr>
				<tr>
					<?php
						for($i=1; $i<=$days; $i++){ ?> 
							<td class="rightbo"><?php print str_pad($i, 2, "0", STR_PAD_LEFT);	?> </td> 
					<?php 	
						}
					?>
				</tr>
	  		</table>	  </td>
		<th rowspan="2" width="5%" style="border-left:none;"><strong>Used Casual Leave In this Month</strong></th>
		<th rowspan="2" width="5%" ><strong>Used Casual Leave In Before Month</strong></th>
		<th rowspan="2" width="4%"><strong>Total</strong></th>
	</tr>
	<tr>
		<th width="2%"><strong>Sr. No.</strong></th>
		<th width="22%"><strong>Employee Name &amp; Designation </strong></th>
		<th width="6%"><strong>School Join Date </strong></th>
		
	</tr>
	<?php
		$i=1;
		while($row=dbArray($result)){
    		extract($row);
	?>
		<tr >
			<td align="center"><?php print $i++; ?></td>
			<td><?php print $employee_name; ?><br/><?php print $employee_designation1; ?></td>
			<td><?php print date($SiteDateFormat,strtotime($employee_schooljoindate)); ?></td>
			<td width="100%" height="100%" style="border:none;"><?php makeRow($days); ?></td>
			<td style="border-left:none;">&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	<?php
		}
	?>
</table>
<!--end main bdy  -->
</div>
<?php require "_footer.php";?>