<?php
/*
* Alliances Manager (Gestionador de Alianzas) - Travian
* Copyright (C) 2008-12 Viva Mayer, Francisco Mesías <hide@address.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class ControlAdmin extends ControlBase
{
// Con esta funcion se accede al estado y fechas de actualizacion de todos los usuarios
public function miembros()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$usuarios = $admin->miembros($total_pag);
include $this->c_vistas."miembros.php";
}
public function nuevos()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$usuarios = $admin->nuevos();
include $this->c_vistas."nuevos.php";
}
// con esta función activamos nuevos usuarios
public function modificar()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$titulo = self::$texto->get('HEAD26');
$target ="?ctrl=Admin&mod=miembros";
if (isset($_POST['confirm']) and $_POST['confirm']=="si")
{
if ($_POST['form'] == "nuevos") $target ="?ctrl=Admin&mod=nuevos";
if ( isset($_POST['check']) )
{
$funcion = strtolower($_POST['accion']);
$admin->$funcion($target);
}
else {
$error = 'E_seleccion';
include $this->c_vistas."error.php";
}
} else {
$error = 'EPA03';
include $this->c_vistas."error.php";
}
}
// muestra los permisos de los usuarios
public function permisos()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$resultado = $admin->ver_permisos(true);
include $this->c_vistas."permisos.php";
}
public function modpermisos()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$error="";
// si el el post vino desde la vista permisos.php
if ( isset ( $_POST['accion'] ) and $_POST['accion']=="pp" )
{
$resultado = $admin->ver_permisos(false);
//si la funcion devolvio error
if ( $resultado == "E_seleccion" )
{
$error = $resultado; $titulo = self::$texto->get('HEAD26');
$target="?ctrl=Admin&mod=permisos";
include $this->c_vistas."error.php";
}
else include $this->c_vistas."modpermisos.php";
}
elseif ( isset ( $_POST['accion'] ) and $_POST['accion']=="goku" )
$admin->modificar_permisos();
}
// vemos los datos cargados de un miembro activo
public function ver_datos()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$admin->DetalleUsuario($DP, $aldeas, $tropas);
include $this->c_vistas."detalle_usuario.php";
}
// informe por defecto
public function resumen()
{
include $this->c_modelos."ModeloAdmin.php";
$admin = new ModeloAdmin;
$datos = $admin->ResumenUsuarios();
include $this->c_vistas."resumen.php";
}
} // Fin Clase
?>