<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

include("include/dbcommon.php");
include("classes/button.php");
	
$params = (array)my_json_decode(postvalue('params'));
$buttId = $params['buttId'];

// proccess table events
if($buttId=='FREQU_NCIA_DE_COORDENADORES')
{
	include("include/senuc_coordenador_variables.php");
	buttonHandler_FREQU_NCIA_DE_COORDENADORES($params);
}
if($buttId=='FREQU_NCIA_DE_PROFESSORES')
{
	include("include/senuc_professores_variables.php");
	buttonHandler_FREQU_NCIA_DE_PROFESSORES($params);
}
if($buttId=='FREQU_NCIA_DE_ALUNOS')
{
	include("include/senuc_aluno_variables.php");
	buttonHandler_FREQU_NCIA_DE_ALUNOS($params);
}
if($buttId=='FREQU_NCIA_DE_ALUNOS1')
{
	include("include/senuc_aluno_regional_variables.php");
	buttonHandler_FREQU_NCIA_DE_ALUNOS1($params);
}
if($buttId=='FREQU_NCIA_DE_PROFESSORES1')
{
	include("include/senuc_professores_regional_variables.php");
	buttonHandler_FREQU_NCIA_DE_PROFESSORES1($params);
}
if($buttId=='LAN_AR_NOTAS')
{
	include("include/senuc_atividades_variables.php");
	buttonHandler_LAN_AR_NOTAS($params);
}
if($buttId=='LAN_AR_PRESEN_AS')
{
	include("include/senuc_plantoes_variables.php");
	buttonHandler_LAN_AR_PRESEN_AS($params);
}
if($buttId=='New_Button')
{
	include("include/senuc_certificados_voluntario_variables.php");
	buttonHandler_New_Button($params);
}

// proccess non table events


// create table and non table handlers
function buttonHandler_FREQU_NCIA_DE_COORDENADORES($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	;
	echo my_json_encode($result);
}
function buttonHandler_FREQU_NCIA_DE_PROFESSORES($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	;
	echo my_json_encode($result);
}
function buttonHandler_FREQU_NCIA_DE_ALUNOS($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	;
	echo my_json_encode($result);
}
function buttonHandler_FREQU_NCIA_DE_ALUNOS1($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	;
	echo my_json_encode($result);
}
function buttonHandler_FREQU_NCIA_DE_PROFESSORES1($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	;
	echo my_json_encode($result);
}
function buttonHandler_LAN_AR_NOTAS($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	$result["record"] = $button->getCurrentRecord();;
	echo my_json_encode($result);
}
function buttonHandler_LAN_AR_PRESEN_AS($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	$result["record"] = $button->getCurrentRecord();;
	echo my_json_encode($result);
}
function buttonHandler_New_Button($params) 
{
	global $strTableName;
	$result = array();
		
	// create new button object for get record data
	$params["keys"] = (array)my_json_decode(postvalue('keys'));
	$params["isManyKeys"] = postvalue('isManyKeys');
	$params["location"] = postvalue('location');
	
	$button = new Button($params);
	$keys = $button->getKeys();
	
	$result["record"] = $button->getCurrentRecord();;
	echo my_json_encode($result);
}
?>
