<?php
include_once("../class/class.MySQL.php");
$db	=new MySQL();
//----------------------------------------retrieving get values--------------------//
$limit=$page_emp;
$page=1; $employees='';
$month=date("m");
$year=date("Y");
if(isset($_GET['page']))
$page=$_GET['page'];
else
$page=1;
if($page) 
		$start = ($page - 1) * $limit;  //first item to display on this page
	else
		$start = 0;			
if(isset($_GET['month']) && ($_GET['month']!='undefined' || $_GET['month']!=''))
{
$month=$_GET['month'];
}
else
{
$month=date("m");
}
if(isset($_GET['year'])  && ($_GET['year']!='undefined'  || $_GET['year']!='' ))
{
$year=$_GET['year'];
}
else
{
$year=date("Y");
}
if(isset($_GET['employees']))
$employees=$_GET['employees'];
//---------------------------------------------------------------------------------------------//
$start=0;
$view="";

if($month=='null')$month=date("m");if($year=='null')$year=date("Y");
$check=$year.'-'.$month;
 $sql=" select distinct(a.e_id) as e_id, b.e_fname,b.e_mname,b.e_lname from time as a,employee as b where a.e_id=b.e_id and    DATE_FORMAT(a.e_date,'%m-%Y') = '".$month."-".$year."'";
$employees=mysql_query($sql);
$rows=mysql_num_rows($employees);
	$total_pages = $rows;
	$limit=$page_emp;				//how many items to show per page
						//if no page var is given, set start to 0
	
	/* Get data. */
	$page=1;
	if(isset($_GET['page']))
	$page=$_GET['page'];
	/* Setup page vars for display. */
	
	$paging= $db->pagination($page,$limit,$total_pages);
	echo $paging;
	?>

	