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: mar may 27 15:16:38 ART 2003
17 // | Author: Martin Marrese <mmarre@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
23 require_once 'MECON/HTML/Tabla.php';
24 require_once 'SAMURAI/Perfil.php';
26 //LINKS A PERFILES-ABM {{{
27 $aHref = '<a href="perfiles-abm?accion=##ACCION##&idPerfil=##NUEVO##">';
28 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Perfil"></a>';
29 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Perfil" ></a>';
31 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
32 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
33 header('Location: sel-sistema');
36 //CREO LOS OBJETOS NECESARIOS {{{
37 $TABLA2 = new Tabla ('cellspacing=0');
38 $TABLA = new Tabla ('cellpadding=2');
41 //OBTENGO LA INFORMACION DE LA BASE {{{
42 $perfiles = SAMURAI_Perfil::getPerfiles($DB);
44 //AGREGO LOS DATOS A LAS TABLAS {{{
45 $row = array ($aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Perfil</a>');
46 $TABLA2->addRow($row,'align=right');
47 $row = array ('Id','Descripcion','Tipo','Modif.','Elim.');
48 $TABLA->addRow($row,'cabecera');
49 foreach ($perfiles as $perfil) {
50 $Modif = ereg_replace('##NUEVO##' , $perfil->getId(), $aHrefModif);
51 $Elim = ereg_replace('##NUEVO##' , $perfil->getId(), $aHrefElim );
52 $Modif = ereg_replace('##ACCION##', 'm' , $Modif );
53 $Elim = ereg_replace('##ACCION##', 'e' , $Elim );
54 $row = array ( $perfil->getId(),
55 $perfil->getDescripcion(),
63 //DIBUJO LA PAGINA {{{
64 $MARCO = new Marco ('../../conf/confSecciones.php');
65 $MARCO->addBody($TABLA2->toHtml(1));
66 $MARCO->addBody($TABLA);