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';
25 require_once 'SAMURAI/Sistema.php';
28 $aHrefPopup = '<a href="" onClick="window.open(\'perfiles-datos?id_perfil=##PERFIL##\',\'perfilesdatos\',\'height=300,width=400,scrollbars=yes\');return false;">';
29 $aHref = '<a href="perfiles-abm?accion=##ACCION##&id_perfil=##NUEVO##">';
30 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Perfil"></a>';
31 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Perfil" ></a>';
33 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
34 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
35 header('Location: ./../sel-sistema');
38 //CREO LOS OBJETOS NECESARIOS {{{
39 $TABLA2 = new Tabla ('cellspacing=0');
40 $TABLA = new Tabla ('cellpadding=2');
41 $TABLA3 = new Tabla ('cellspacing=0');
42 $SISTEMA = new SAMURAI_Sistema($DB, $_SESSION['samurai']['id_sistema']);
44 //OBTENGO LA INFORMACION DE LA BASE {{{
45 $perfiles = SAMURAI_Perfil::getPerfiles($DB, null, $_SESSION['samurai']['id_sistema']);
47 //AGREGO LOS DATOS A LAS TABLAS {{{
48 $imagen = new HTML_Image('/MECON/images/vinetas_flecha_doble.gif');
49 $row = array ($imagen->toHtml().' <b>SISTEMA: '.$SISTEMA->getNombre().'</b>');
50 $TABLA3->addRow($row,'align=left');
51 $row = array ('<a href="perfiles-nuevo"><img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Perfil</a>');
52 $TABLA2->addRow($row,'align=right');
53 $row = array ('Id','Descripcion','Tipo','Modif.','Elim.');
54 $TABLA->addRow($row,'cabecera');
55 foreach ($perfiles as $perfil) {
56 $Popup = ereg_replace('##PERFIL##', $perfil->getId(), $aHrefPopup);
57 $Modif = ereg_replace('##NUEVO##' , $perfil->getId(), $aHrefModif);
58 $Elim = ereg_replace('##NUEVO##' , $perfil->getId(), $aHrefElim );
59 $Popup = $Popup.$perfil->getDescripcion().'</a>';
60 $Modif = ereg_replace('##ACCION##', 'm' , $Modif );
61 $Elim = ereg_replace('##ACCION##', 'e' , $Elim );
62 $row = array ( $perfil->getId(),
71 //DIBUJO LA PAGINA {{{
72 $MARCO->addBody($TABLA3);
73 $MARCO->addBody($TABLA2->toHtml(1));
74 $MARCO->addBody($TABLA);