2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4 foldmethod=marker:
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2003 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.02 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Created: miƩ jul 16 12:51:57 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
24 require_once 'MECON/HTML/Tabla.php';
25 require_once 'SAMURAI/Usuario.php';
26 require_once 'SAMURAI/Sistema.php';
27 require_once 'HTML/Image.php';
30 //LINKS A USUARIOS-ABM {{{
31 $aHref = '<a href="usuarios-abm?accion=##ACCION##&login=##NUEVO##">';
32 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Usuario"></a>';
33 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Usuario" ></a>';
35 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
36 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
37 header('Location: ./../sel-sistema');
40 //CREO LOS OBJETOS NECESARIOS {{{
41 $TABLA2 = new Tabla ('cellspacing=0');
42 $TABLA = new Tabla ('cellpadding=2');
43 $TABLA3 = new Tabla ('cellspacing=0');
44 $SISTEMA = new SAMURAI_Sistema($DB, $_SESSION['samurai']['id_sistema']);
46 //OBTENGO LA INFORMACION DE LA BASE {{{
47 $usuarios = SAMURAI_Usuario::getUsuarios($DB, $_SESSION['samurai']['id_sistema']);
49 //AGREGO LOS DATOS A LAS TABLAS {{{
50 $imagen = new HTML_Image('/MECON/images/vinetas_flecha_doble.gif');
51 $row = array ($imagen->toHtml().' <b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
52 $TABLA3->addRow($row,'align=left');
53 $row = array ($aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Agregar Nuevo Usuario</a>');
54 $TABLA2->addRow($row,'align=right');
55 $row = array ('Login','Nombre','Modif.','Elim.');
56 $TABLA->addRow($row,'cabecera');
57 foreach ($usuarios as $usuario) {
58 $Modif = ereg_replace('##NUEVO##' , $usuario->getLogin(), $aHrefModif);
59 $Elim = ereg_replace('##NUEVO##' , $usuario->getLogin(), $aHrefElim );
60 $Modif = ereg_replace('##ACCION##', 'm' , $Modif );
61 $Elim = ereg_replace('##ACCION##', 'e' , $Elim );
62 $row = array ( $usuario->getLogin(),
63 $usuario->getNombre(),
70 //DIBUJO LA PAGINA {{{
71 $MARCO = new Marco ('../../conf/confSecciones.php');
72 $MARCO->addBody($TABLA3);
73 $MARCO->addBody($TABLA2->toHtml(1));
74 $MARCO->addBody($TABLA);