<?php 

include_once ("_dirinfo.php");
include_once (PATH_TO_ROOT."init.php");
include_once (PATH_TO_ROOT."_ajaxManipulators/_class/class.gridData.php");

class telStatManipulator extends GridDataManipulator
{
	public function selectAction()
	{
		//$this->whereKeyword = 'HAVING';
		
		if($_POST['timeFilter'])
		{
			$this->where[] = 'duration < '.$_POST['timeFilter'];
		}
		$this->fetchSelect();
		
		return parent::selectAction();
	}
}

	

$db->ChangeDatabase($_POST['database']);
$tableName = $_POST['RMtable'];

$manipulator = new telStatManipulator($db,$_POST['RMtable']);
$manipulator->telIndexTable = $tableName.'___telIndex';
$comm = $_REQUEST['action'].'Action';
if(method_exists($manipulator,$comm))
	echo $manipulator->$comm();
else 
{
	echo '{success:false,error:"Unknown action!"}';	
}

?>