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

include("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 

include("include/admin_rights_variables.php");


$gsqlHead="select `username` ";
$gsqlFrom="from `senuc_login`";
$gsqlWhereExpr="";
$gsqlTail="";
// $gstrSQL = "SELECT TableName,   GroupID,   AccessMask  FROM senucnovo_ugrights ";
$gstrSQL = $gQuery->gSQLWhere("");


if(!isLogged())
{ 
	$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
	header("Location: login.php?message=expired"); 
	return;
}
if(!IsAdmin())
{
	echo "<p>"."Você não tem permissão para acessar esta tabela"." <a href=\"login.php\">"."Voltar à página de Login"."</a></p>";
	return;
}



$layout = new TLayout("ug_rights2","BreezeAqua1","MobileAqua1");
$layout->blocks["center"] = array();
$layout->containers["ugcontrols"] = array();

$layout->containers["ugcontrols"][] = array("name"=>"ugbuttons","block"=>"savebuttons_block","substyle"=>1);


$layout->skins["ugcontrols"] = "1";
$layout->blocks["center"][] = "ugcontrols";
$layout->containers["message"] = array();

$layout->containers["message"][] = array("name"=>"message","block"=>"message_block","substyle"=>1);


$layout->skins["message"] = "1";
$layout->blocks["center"][] = "message";
$layout->containers["grid"] = array();

$layout->containers["grid"][] = array("name"=>"ugrightsblock","block"=>"rights_block","substyle"=>1);


$layout->skins["grid"] = "grid";
$layout->blocks["center"][] = "grid";
$layout->containers["pagination"] = array();

$layout->containers["pagination"][] = array("name"=>"pagination","block"=>"pagination_block","substyle"=>1);


$layout->skins["pagination"] = "2";
$layout->blocks["center"][] = "pagination";$layout->blocks["left"] = array();
$layout->containers["left"] = array();


$layout->containers["left"][] = array("name"=>"loggedas","block"=>"security_block","substyle"=>1);


$layout->skins["left"] = "menu";
$layout->blocks["left"][] = "left";
$layout->containers["uggroup"] = array();

$layout->containers["uggroup"][] = array("name"=>"ugrightsgroup","block"=>"","substyle"=>1);


$layout->skins["uggroup"] = "1";
$layout->blocks["left"][] = "uggroup";$layout->blocks["top"] = array();
$layout->skins["master"] = "empty";
$layout->blocks["top"][] = "master";
$layout->skins["toplinks"] = "2";
$layout->blocks["top"][] = "toplinks";
$layout->containers["hmenu"] = array();

$layout->containers["hmenu"][] = array("name"=>"hmenu","block"=>"menu_block","substyle"=>1);


$layout->skins["hmenu"] = "hmenu";
$layout->blocks["top"][] = "hmenu";
$layout->containers["search"] = array();


$layout->containers["search"][] = array("name"=>"details_found","block"=>"details_block","substyle"=>1);


$layout->containers["search"][] = array("name"=>"page_of","block"=>"pages_block","substyle"=>1);


$layout->containers["search"][] = array("name"=>"recsperpage","block"=>"recordspp_block","substyle"=>1);


$layout->skins["search"] = "2";
$layout->blocks["top"][] = "search";$page_layouts["admin_rights_list"] = $layout;


include('include/xtempl.php');
include('classes/runnerpage.php');
include('classes/listpage.php');
include('classes/rightspage.php');

$xt = new Xtempl();

$options = array();
//array of params for classes
$options["pageType"] = PAGE_LIST;
$options["id"] = postvalue("id") ? postvalue("id") : 1;
$options["mode"] = RIGHTS_PAGE;
$options['xt'] = &$xt;
$nonAdminTablesRightsArr=array();
$nonAdminTablesArr=array();
$pageRights=array();
$nonAdminTablesArr[] = array("senuc_aluno","Senuc Aluno");
$nonAdminTablesRightsArr["senuc_aluno"]=array();
$pageRights["senuc_aluno"]["add"]=true;
$pageRights["senuc_aluno"]["edit"]=true;
$pageRights["senuc_aluno"]["delete"]=false;
$pageRights["senuc_aluno"]["list"]=true;
$pageRights["senuc_aluno"]["export"]=true;
$pageRights["senuc_aluno"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_coordenador","Senuc Coordenador");
$nonAdminTablesRightsArr["senuc_coordenador"]=array();
$pageRights["senuc_coordenador"]["add"]=true;
$pageRights["senuc_coordenador"]["edit"]=true;
$pageRights["senuc_coordenador"]["delete"]=false;
$pageRights["senuc_coordenador"]["list"]=true;
$pageRights["senuc_coordenador"]["export"]=false;
$pageRights["senuc_coordenador"]["import"]=false;

$nonAdminTablesArr[] = array("professor","Professor");
$nonAdminTablesRightsArr["professor"]=array();
$pageRights["professor"]["add"]=false;
$pageRights["professor"]["edit"]=false;
$pageRights["professor"]["delete"]=false;
$pageRights["professor"]["list"]=true;
$pageRights["professor"]["export"]=false;
$pageRights["professor"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_professores","Senuc Professores");
$nonAdminTablesRightsArr["senuc_professores"]=array();
$pageRights["senuc_professores"]["add"]=true;
$pageRights["senuc_professores"]["edit"]=true;
$pageRights["senuc_professores"]["delete"]=false;
$pageRights["senuc_professores"]["list"]=true;
$pageRights["senuc_professores"]["export"]=true;
$pageRights["senuc_professores"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_frequencias","Senuc Frequencias");
$nonAdminTablesRightsArr["senuc_frequencias"]=array();
$pageRights["senuc_frequencias"]["add"]=false;
$pageRights["senuc_frequencias"]["edit"]=true;
$pageRights["senuc_frequencias"]["delete"]=true;
$pageRights["senuc_frequencias"]["list"]=true;
$pageRights["senuc_frequencias"]["export"]=true;
$pageRights["senuc_frequencias"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_config","Senuc Config");
$nonAdminTablesRightsArr["senuc_config"]=array();
$pageRights["senuc_config"]["add"]=false;
$pageRights["senuc_config"]["edit"]=true;
$pageRights["senuc_config"]["delete"]=false;
$pageRights["senuc_config"]["list"]=true;
$pageRights["senuc_config"]["export"]=false;
$pageRights["senuc_config"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_nucleo","Senuc Nucleo");
$nonAdminTablesRightsArr["senuc_nucleo"]=array();
$pageRights["senuc_nucleo"]["add"]=false;
$pageRights["senuc_nucleo"]["edit"]=true;
$pageRights["senuc_nucleo"]["delete"]=false;
$pageRights["senuc_nucleo"]["list"]=true;
$pageRights["senuc_nucleo"]["export"]=true;
$pageRights["senuc_nucleo"]["import"]=false;

$nonAdminTablesArr[] = array("nucleos_presenciais","Nucleos Presenciais");
$nonAdminTablesRightsArr["nucleos_presenciais"]=array();
$pageRights["nucleos_presenciais"]["add"]=false;
$pageRights["nucleos_presenciais"]["edit"]=true;
$pageRights["nucleos_presenciais"]["delete"]=false;
$pageRights["nucleos_presenciais"]["list"]=true;
$pageRights["nucleos_presenciais"]["export"]=true;
$pageRights["nucleos_presenciais"]["import"]=false;

$nonAdminTablesArr[] = array("nucleos_virtuais","Nucleos Virtuais");
$nonAdminTablesRightsArr["nucleos_virtuais"]=array();
$pageRights["nucleos_virtuais"]["add"]=false;
$pageRights["nucleos_virtuais"]["edit"]=true;
$pageRights["nucleos_virtuais"]["delete"]=false;
$pageRights["nucleos_virtuais"]["list"]=true;
$pageRights["nucleos_virtuais"]["export"]=true;
$pageRights["nucleos_virtuais"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_login","Senuc Login");
$nonAdminTablesRightsArr["senuc_login"]=array();
$pageRights["senuc_login"]["add"]=true;
$pageRights["senuc_login"]["edit"]=true;
$pageRights["senuc_login"]["delete"]=true;
$pageRights["senuc_login"]["list"]=true;
$pageRights["senuc_login"]["export"]=true;
$pageRights["senuc_login"]["import"]=true;

$nonAdminTablesArr[] = array("senuc_aluno_regional","Senuc Aluno Regional");
$nonAdminTablesRightsArr["senuc_aluno_regional"]=array();
$pageRights["senuc_aluno_regional"]["add"]=false;
$pageRights["senuc_aluno_regional"]["edit"]=false;
$pageRights["senuc_aluno_regional"]["delete"]=false;
$pageRights["senuc_aluno_regional"]["list"]=true;
$pageRights["senuc_aluno_regional"]["export"]=true;
$pageRights["senuc_aluno_regional"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_coordenador_regional","Senuc Coordenador Regional");
$nonAdminTablesRightsArr["senuc_coordenador_regional"]=array();
$pageRights["senuc_coordenador_regional"]["add"]=false;
$pageRights["senuc_coordenador_regional"]["edit"]=false;
$pageRights["senuc_coordenador_regional"]["delete"]=false;
$pageRights["senuc_coordenador_regional"]["list"]=true;
$pageRights["senuc_coordenador_regional"]["export"]=false;
$pageRights["senuc_coordenador_regional"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_professores_regional","Senuc Professores Regional");
$nonAdminTablesRightsArr["senuc_professores_regional"]=array();
$pageRights["senuc_professores_regional"]["add"]=false;
$pageRights["senuc_professores_regional"]["edit"]=false;
$pageRights["senuc_professores_regional"]["delete"]=false;
$pageRights["senuc_professores_regional"]["list"]=true;
$pageRights["senuc_professores_regional"]["export"]=true;
$pageRights["senuc_professores_regional"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_score_regional","Senuc Score Regional");
$nonAdminTablesRightsArr["senuc_score_regional"]=array();
$pageRights["senuc_score_regional"]["add"]=false;
$pageRights["senuc_score_regional"]["edit"]=false;
$pageRights["senuc_score_regional"]["delete"]=false;
$pageRights["senuc_score_regional"]["list"]=true;
$pageRights["senuc_score_regional"]["export"]=true;
$pageRights["senuc_score_regional"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_score","Senuc Score");
$nonAdminTablesRightsArr["senuc_score"]=array();
$pageRights["senuc_score"]["add"]=true;
$pageRights["senuc_score"]["edit"]=true;
$pageRights["senuc_score"]["delete"]=true;
$pageRights["senuc_score"]["list"]=true;
$pageRights["senuc_score"]["export"]=true;
$pageRights["senuc_score"]["import"]=true;

$nonAdminTablesArr[] = array("senuc_frequencia_regional","Senuc Frequencia Regional");
$nonAdminTablesRightsArr["senuc_frequencia_regional"]=array();
$pageRights["senuc_frequencia_regional"]["add"]=false;
$pageRights["senuc_frequencia_regional"]["edit"]=false;
$pageRights["senuc_frequencia_regional"]["delete"]=true;
$pageRights["senuc_frequencia_regional"]["list"]=true;
$pageRights["senuc_frequencia_regional"]["export"]=true;
$pageRights["senuc_frequencia_regional"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_score_geral","Senuc Score Geral");
$nonAdminTablesRightsArr["senuc_score_geral"]=array();
$pageRights["senuc_score_geral"]["add"]=false;
$pageRights["senuc_score_geral"]["edit"]=false;
$pageRights["senuc_score_geral"]["delete"]=false;
$pageRights["senuc_score_geral"]["list"]=true;
$pageRights["senuc_score_geral"]["export"]=true;
$pageRights["senuc_score_geral"]["import"]=false;

$nonAdminTablesArr[] = array("Score_Mensal","Score Mensal");
$nonAdminTablesRightsArr["Score_Mensal"]=array();
$pageRights["Score_Mensal"]["add"]=false;
$pageRights["Score_Mensal"]["edit"]=false;
$pageRights["Score_Mensal"]["delete"]=false;
$pageRights["Score_Mensal"]["list"]=true;
$pageRights["Score_Mensal"]["export"]=false;
$pageRights["Score_Mensal"]["import"]=false;

$nonAdminTablesArr[] = array("Alunos_Mensal","Alunos Mensal");
$nonAdminTablesRightsArr["Alunos_Mensal"]=array();
$pageRights["Alunos_Mensal"]["add"]=false;
$pageRights["Alunos_Mensal"]["edit"]=false;
$pageRights["Alunos_Mensal"]["delete"]=false;
$pageRights["Alunos_Mensal"]["list"]=true;
$pageRights["Alunos_Mensal"]["export"]=false;
$pageRights["Alunos_Mensal"]["import"]=false;

$nonAdminTablesArr[] = array("Relatorio_Alunos_Mensal","Relatorio Alunos Mensal");
$nonAdminTablesRightsArr["Relatorio_Alunos_Mensal"]=array();
$pageRights["Relatorio_Alunos_Mensal"]["add"]=false;
$pageRights["Relatorio_Alunos_Mensal"]["edit"]=false;
$pageRights["Relatorio_Alunos_Mensal"]["delete"]=false;
$pageRights["Relatorio_Alunos_Mensal"]["list"]=true;
$pageRights["Relatorio_Alunos_Mensal"]["export"]=true;
$pageRights["Relatorio_Alunos_Mensal"]["import"]=false;

$nonAdminTablesArr[] = array("Relatorio_Score_Mensal","Relatorio Score Mensal");
$nonAdminTablesRightsArr["Relatorio_Score_Mensal"]=array();
$pageRights["Relatorio_Score_Mensal"]["add"]=false;
$pageRights["Relatorio_Score_Mensal"]["edit"]=false;
$pageRights["Relatorio_Score_Mensal"]["delete"]=false;
$pageRights["Relatorio_Score_Mensal"]["list"]=true;
$pageRights["Relatorio_Score_Mensal"]["export"]=true;
$pageRights["Relatorio_Score_Mensal"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_atividades","Senuc Atividades");
$nonAdminTablesRightsArr["senuc_atividades"]=array();
$pageRights["senuc_atividades"]["add"]=true;
$pageRights["senuc_atividades"]["edit"]=true;
$pageRights["senuc_atividades"]["delete"]=true;
$pageRights["senuc_atividades"]["list"]=true;
$pageRights["senuc_atividades"]["export"]=true;
$pageRights["senuc_atividades"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_atividades_aluno","Senuc Atividades Aluno");
$nonAdminTablesRightsArr["senuc_atividades_aluno"]=array();
$pageRights["senuc_atividades_aluno"]["add"]=true;
$pageRights["senuc_atividades_aluno"]["edit"]=true;
$pageRights["senuc_atividades_aluno"]["delete"]=true;
$pageRights["senuc_atividades_aluno"]["list"]=true;
$pageRights["senuc_atividades_aluno"]["export"]=true;
$pageRights["senuc_atividades_aluno"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_plantoes","Senuc Plantoes");
$nonAdminTablesRightsArr["senuc_plantoes"]=array();
$pageRights["senuc_plantoes"]["add"]=true;
$pageRights["senuc_plantoes"]["edit"]=true;
$pageRights["senuc_plantoes"]["delete"]=true;
$pageRights["senuc_plantoes"]["list"]=true;
$pageRights["senuc_plantoes"]["export"]=true;
$pageRights["senuc_plantoes"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_plantoes_aluno","Senuc Plantoes Aluno");
$nonAdminTablesRightsArr["senuc_plantoes_aluno"]=array();
$pageRights["senuc_plantoes_aluno"]["add"]=false;
$pageRights["senuc_plantoes_aluno"]["edit"]=false;
$pageRights["senuc_plantoes_aluno"]["delete"]=false;
$pageRights["senuc_plantoes_aluno"]["list"]=true;
$pageRights["senuc_plantoes_aluno"]["export"]=true;
$pageRights["senuc_plantoes_aluno"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_contribuicoes","Senuc Contribuicoes");
$nonAdminTablesRightsArr["senuc_contribuicoes"]=array();
$pageRights["senuc_contribuicoes"]["add"]=true;
$pageRights["senuc_contribuicoes"]["edit"]=true;
$pageRights["senuc_contribuicoes"]["delete"]=false;
$pageRights["senuc_contribuicoes"]["list"]=true;
$pageRights["senuc_contribuicoes"]["export"]=true;
$pageRights["senuc_contribuicoes"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_aprovacoes","Senuc Aprovacoes");
$nonAdminTablesRightsArr["senuc_aprovacoes"]=array();
$pageRights["senuc_aprovacoes"]["add"]=true;
$pageRights["senuc_aprovacoes"]["edit"]=true;
$pageRights["senuc_aprovacoes"]["delete"]=false;
$pageRights["senuc_aprovacoes"]["list"]=true;
$pageRights["senuc_aprovacoes"]["export"]=true;
$pageRights["senuc_aprovacoes"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_turmas","Senuc Turmas");
$nonAdminTablesRightsArr["senuc_turmas"]=array();
$pageRights["senuc_turmas"]["add"]=true;
$pageRights["senuc_turmas"]["edit"]=true;
$pageRights["senuc_turmas"]["delete"]=true;
$pageRights["senuc_turmas"]["list"]=true;
$pageRights["senuc_turmas"]["export"]=true;
$pageRights["senuc_turmas"]["import"]=true;

$nonAdminTablesArr[] = array("senuc_descomplica","Senuc Descomplica");
$nonAdminTablesRightsArr["senuc_descomplica"]=array();
$pageRights["senuc_descomplica"]["add"]=true;
$pageRights["senuc_descomplica"]["edit"]=true;
$pageRights["senuc_descomplica"]["delete"]=true;
$pageRights["senuc_descomplica"]["list"]=true;
$pageRights["senuc_descomplica"]["export"]=true;
$pageRights["senuc_descomplica"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_descomplica_avaliacao","Senuc Descomplica Avaliacao");
$nonAdminTablesRightsArr["senuc_descomplica_avaliacao"]=array();
$pageRights["senuc_descomplica_avaliacao"]["add"]=false;
$pageRights["senuc_descomplica_avaliacao"]["edit"]=false;
$pageRights["senuc_descomplica_avaliacao"]["delete"]=false;
$pageRights["senuc_descomplica_avaliacao"]["list"]=true;
$pageRights["senuc_descomplica_avaliacao"]["export"]=true;
$pageRights["senuc_descomplica_avaliacao"]["import"]=true;

$nonAdminTablesArr[] = array("senuc_descomplica_logins","Senuc Descomplica Logins");
$nonAdminTablesRightsArr["senuc_descomplica_logins"]=array();
$pageRights["senuc_descomplica_logins"]["add"]=true;
$pageRights["senuc_descomplica_logins"]["edit"]=true;
$pageRights["senuc_descomplica_logins"]["delete"]=true;
$pageRights["senuc_descomplica_logins"]["list"]=true;
$pageRights["senuc_descomplica_logins"]["export"]=true;
$pageRights["senuc_descomplica_logins"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_aluno_acessos_descomplica","Senuc Aluno Acessos Descomplica");
$nonAdminTablesRightsArr["senuc_aluno_acessos_descomplica"]=array();
$pageRights["senuc_aluno_acessos_descomplica"]["add"]=false;
$pageRights["senuc_aluno_acessos_descomplica"]["edit"]=false;
$pageRights["senuc_aluno_acessos_descomplica"]["delete"]=false;
$pageRights["senuc_aluno_acessos_descomplica"]["list"]=true;
$pageRights["senuc_aluno_acessos_descomplica"]["export"]=true;
$pageRights["senuc_aluno_acessos_descomplica"]["import"]=false;

$nonAdminTablesArr[] = array("senuc_certificados_voluntario","Senuc Certificados Voluntario");
$nonAdminTablesRightsArr["senuc_certificados_voluntario"]=array();
$pageRights["senuc_certificados_voluntario"]["add"]=true;
$pageRights["senuc_certificados_voluntario"]["edit"]=false;
$pageRights["senuc_certificados_voluntario"]["delete"]=false;
$pageRights["senuc_certificados_voluntario"]["list"]=true;
$pageRights["senuc_certificados_voluntario"]["export"]=true;
$pageRights["senuc_certificados_voluntario"]["import"]=true;

$nonAdminTablesArr[] = array("senuc_nucleo_regional","Senuc Nucleo Regional");
$nonAdminTablesRightsArr["senuc_nucleo_regional"]=array();
$pageRights["senuc_nucleo_regional"]["add"]=false;
$pageRights["senuc_nucleo_regional"]["edit"]=true;
$pageRights["senuc_nucleo_regional"]["delete"]=false;
$pageRights["senuc_nucleo_regional"]["list"]=true;
$pageRights["senuc_nucleo_regional"]["export"]=true;
$pageRights["senuc_nucleo_regional"]["import"]=false;


$options["nonAdminTablesArr"] = $nonAdminTablesArr;
$options["nonAdminTablesRightsArr"] = $nonAdminTablesRightsArr;


$pageObject = ListPage::createListPage($strTableName, $options);
 // add button events if exist

// prepare code for build page
$pageObject->prepareForBuildPage();

// show page depends of mode
$pageObject->showPage();
	//$xt->assign_loopsection("grid_row",$rowinfo);
	


?>
