<?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 `nick` ";
$gsqlFrom="from `usuario`";
$gsqlWhereExpr="";
$gsqlTail="";
// $gstrSQL = "SELECT TableName,   GroupID,   AccessMask  FROM minigest_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>"."No tiene permiso para acceder a esta tabla"." <a href=\"login.php\">"."Regresar a la página de conexión"."</a></p>";
	return;
}



$layout = new TLayout("ug_rights","BoldAqua","MobileAqua");
$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->containers["left"][] = array("name"=>"vmenu","block"=>"menu_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["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("articulo","Articulo");
$nonAdminTablesRightsArr["articulo"]=array();
$pageRights["articulo"]["add"]=true;
$pageRights["articulo"]["edit"]=true;
$pageRights["articulo"]["delete"]=true;
$pageRights["articulo"]["list"]=true;
$pageRights["articulo"]["export"]=true;
$pageRights["articulo"]["import"]=false;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

$nonAdminTablesArr[] = array("reimprimir_mov_cajas","Reimprimir Mov Cajas");
$nonAdminTablesRightsArr["reimprimir_mov_cajas"]=array();
$pageRights["reimprimir_mov_cajas"]["add"]=false;
$pageRights["reimprimir_mov_cajas"]["edit"]=false;
$pageRights["reimprimir_mov_cajas"]["delete"]=false;
$pageRights["reimprimir_mov_cajas"]["list"]=true;
$pageRights["reimprimir_mov_cajas"]["export"]=true;
$pageRights["reimprimir_mov_cajas"]["import"]=false;

$nonAdminTablesArr[] = array("v_det_movimiento","V Det Movimiento");
$nonAdminTablesRightsArr["v_det_movimiento"]=array();
$pageRights["v_det_movimiento"]["add"]=false;
$pageRights["v_det_movimiento"]["edit"]=false;
$pageRights["v_det_movimiento"]["delete"]=false;
$pageRights["v_det_movimiento"]["list"]=true;
$pageRights["v_det_movimiento"]["export"]=true;
$pageRights["v_det_movimiento"]["import"]=false;

$nonAdminTablesArr[] = array("cuentas_abiertas","Cuentas Abiertas");
$nonAdminTablesRightsArr["cuentas_abiertas"]=array();
$pageRights["cuentas_abiertas"]["add"]=true;
$pageRights["cuentas_abiertas"]["edit"]=true;
$pageRights["cuentas_abiertas"]["delete"]=true;
$pageRights["cuentas_abiertas"]["list"]=true;
$pageRights["cuentas_abiertas"]["export"]=true;
$pageRights["cuentas_abiertas"]["import"]=true;

$nonAdminTablesArr[] = array("inf_ventas_articulos","Inf Ventas Articulos");
$nonAdminTablesRightsArr["inf_ventas_articulos"]=array();
$pageRights["inf_ventas_articulos"]["add"]=false;
$pageRights["inf_ventas_articulos"]["edit"]=false;
$pageRights["inf_ventas_articulos"]["delete"]=false;
$pageRights["inf_ventas_articulos"]["list"]=true;
$pageRights["inf_ventas_articulos"]["export"]=true;
$pageRights["inf_ventas_articulos"]["import"]=false;

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

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

$nonAdminTablesArr[] = array("inf_ventas_resumido","Inf Ventas Resumido");
$nonAdminTablesRightsArr["inf_ventas_resumido"]=array();
$pageRights["inf_ventas_resumido"]["add"]=false;
$pageRights["inf_ventas_resumido"]["edit"]=false;
$pageRights["inf_ventas_resumido"]["delete"]=false;
$pageRights["inf_ventas_resumido"]["list"]=true;
$pageRights["inf_ventas_resumido"]["export"]=false;
$pageRights["inf_ventas_resumido"]["import"]=false;

$nonAdminTablesArr[] = array("inf_ventas_proveedores","Inf Ventas Proveedores");
$nonAdminTablesRightsArr["inf_ventas_proveedores"]=array();
$pageRights["inf_ventas_proveedores"]["add"]=true;
$pageRights["inf_ventas_proveedores"]["edit"]=false;
$pageRights["inf_ventas_proveedores"]["delete"]=false;
$pageRights["inf_ventas_proveedores"]["list"]=true;
$pageRights["inf_ventas_proveedores"]["export"]=true;
$pageRights["inf_ventas_proveedores"]["import"]=false;

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

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

$nonAdminTablesArr[] = array("inf_mov_cajas","Inf Mov Cajas");
$nonAdminTablesRightsArr["inf_mov_cajas"]=array();
$pageRights["inf_mov_cajas"]["add"]=false;
$pageRights["inf_mov_cajas"]["edit"]=false;
$pageRights["inf_mov_cajas"]["delete"]=false;
$pageRights["inf_mov_cajas"]["list"]=true;
$pageRights["inf_mov_cajas"]["export"]=false;
$pageRights["inf_mov_cajas"]["import"]=false;

$nonAdminTablesArr[] = array("ranking_clientes_total","Ranking Clientes Total");
$nonAdminTablesRightsArr["ranking_clientes_total"]=array();
$pageRights["ranking_clientes_total"]["add"]=true;
$pageRights["ranking_clientes_total"]["edit"]=false;
$pageRights["ranking_clientes_total"]["delete"]=false;
$pageRights["ranking_clientes_total"]["list"]=true;
$pageRights["ranking_clientes_total"]["export"]=true;
$pageRights["ranking_clientes_total"]["import"]=false;

$nonAdminTablesArr[] = array("ranking_clientes_cant","Ranking Clientes Cant");
$nonAdminTablesRightsArr["ranking_clientes_cant"]=array();
$pageRights["ranking_clientes_cant"]["add"]=true;
$pageRights["ranking_clientes_cant"]["edit"]=false;
$pageRights["ranking_clientes_cant"]["delete"]=false;
$pageRights["ranking_clientes_cant"]["list"]=true;
$pageRights["ranking_clientes_cant"]["export"]=true;
$pageRights["ranking_clientes_cant"]["import"]=false;

$nonAdminTablesArr[] = array("inf_ventas_detallado","Inf Ventas Detallado");
$nonAdminTablesRightsArr["inf_ventas_detallado"]=array();
$pageRights["inf_ventas_detallado"]["add"]=false;
$pageRights["inf_ventas_detallado"]["edit"]=false;
$pageRights["inf_ventas_detallado"]["delete"]=false;
$pageRights["inf_ventas_detallado"]["list"]=true;
$pageRights["inf_ventas_detallado"]["export"]=false;
$pageRights["inf_ventas_detallado"]["import"]=false;

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

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

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

$nonAdminTablesArr[] = array("inf_ingresos_vs_egresos","Inf Ingresos Vs Egresos");
$nonAdminTablesRightsArr["inf_ingresos_vs_egresos"]=array();
$pageRights["inf_ingresos_vs_egresos"]["add"]=false;
$pageRights["inf_ingresos_vs_egresos"]["edit"]=false;
$pageRights["inf_ingresos_vs_egresos"]["delete"]=false;
$pageRights["inf_ingresos_vs_egresos"]["list"]=true;
$pageRights["inf_ingresos_vs_egresos"]["export"]=false;
$pageRights["inf_ingresos_vs_egresos"]["import"]=false;

$nonAdminTablesArr[] = array("informe","Informe");
$nonAdminTablesRightsArr["informe"]=array();
$pageRights["informe"]["add"]=false;
$pageRights["informe"]["edit"]=false;
$pageRights["informe"]["delete"]=false;
$pageRights["informe"]["list"]=true;
$pageRights["informe"]["export"]=true;
$pageRights["informe"]["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);
	


?>
