<?php
include_once("_dirinfo.php");


class recodeSupport {
	
	
	public function __construct() {
		$this->parameters=$parameters= array(array('Id' => 0, 'Name' => 'Project'),
				array('Id' => 1, 'Name' => 'Time'),
				array('Id' => 2, 'Name' => 'Interviewers'),
				array('Id' => 3, 'Name' => 'Call status'));;
		return true;
	}


	public function fillRowAction()
	{
		
		echo '{success:true, rows:'.json_encode($this->parameters).'}';
	}
	
	
	public function fillColumnAction()
	{
		$selectedElement=$_GET['element'];
		$param=$this->parameters;
	
		foreach ($param as $value) {
				if ($selectedElement!=$value['Name'])
				{
					$rows[]=$value;
				}
			}
		
		echo '{success:true, rows:'.json_encode($rows).'}';
	
	}
	public function comboBoxAction()
	{
		$row=$_GET['row'];
		$column=$_GET['column'];
		$param=$this->parameters;
		
		foreach ($param as $value) {
			if ($row!=$value['Name'] && $column!=$value['Name'])
			{
				$rows[]=$value;
			}
		}
		
		echo '{success:true, rows:'.json_encode($rows).'}';
		
	}
	
	
}
$manipulator = new recodeSupport();
$comm = $_REQUEST['action'].'Action';
if(method_exists($manipulator,$comm)) {
	echo $manipulator->$comm();
} else {
	echo '{success:false,error:"Unknown action!'.$comm.'}';
}


?>