<?php
include_once("../class/class.MySQL.php");
require '../class/resizeImage.php';
$db	=new MySQL();


if($_GET['action']=='insert')
{
// add data to  employee
$data=array();

$data['emply_stat']		=$_POST['stat'];


$db->Insert($data,'emp_status');
$vars['	reptime_id'] =$db->LastInsertID();
	
echo '{"timing":'.json_encode($data).'}';
}

if($_GET['action']=='update')
{
/*echo "<pre>";
print_r($_POST);
exit;*/
// add data to  employee
$data=array();

$data['emply_stat']		=$_POST['reportime'];


$where['id']	= $_POST['reportid'];
$db->Update('emp_status',$data,$where);

echo '{"timing":'.json_encode($data).'}';

}
elseif($_GET['action'] == "removeded"){

	$where['id']	= $_GET['did'];
	$deductions = $db->Delete('emp_status',$where);

}
		
if($_GET['action']=='viewtiming')
{

	$query = "SELECT * FROM emp_status";
	

/* 
include "pagingserch.php";
*/
$cond.=" LIMIT $start, $limit";

if(isset($_REQUEST['page'])){
$page=$_REQUEST['page'];
}else{
$page=15;
}


$pagecnt=$start;




	$timing = $db->fetchQuery("SELECT * FROM emp_status ");
	


	
	$count = count($timing);
	$timing[$count-1]['totalrows'] = $total_pages;
	$timing[$count-1]['lastPage'] = $lastpage;
	
	
	echo '{"timing":'.json_encode($timing).'}';
	}
	
			
if($_GET['act']=='removeded')
{
$where['id']	= $_GET['did'];
	
$deductions = $db->Delete('emp_status',$where);

}
?>