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 // +----------------------------------------------------------------------+
22 require_once 'MECON/HTML/Tabla.php';
23 require_once 'SAMURAI/Sistema.php';
25 $aHrefPopup = '<a href="" onClick="window.open(\'sistemas-datos?id_sistema=##SISTEMA##\',\'sistemasdatos\',\'height=400,width=400,scrollbars=yes\');return false;">';
26 $aHref = '<a href="sistemas-abm?accion=##ACCION##&idSistema=##NUEVO##">';
27 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Sistema"></a>';
28 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Sistema" ></a>';
29 $aHrefPerm = '<a href="sistemas-permisos?idSistema=##SISTEMA##"><img src="/MECON/images/general_ir4" border="0" alt="Definir Permisos"></a>';
30 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
31 if (!@$_SESSION['samurai']['id_sistema'] || !@$_SESSION['samurai']['login']) {
32 header('Location: ./../sel-sistema');
36 $sistemas = SAMURAI_Sistema::getSistemas($DB);
38 $TABLA2 = new Tabla ('cellspacing=0');
39 $row = array ('<a href="../sel-sistema.php"><img src="/MECON/images/general_ir4" border="0">Seleccionar otro sistema para trabajar</a>', $aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Sistema</a>');
40 $TABLA2->addRow($row);
41 $TABLA2->setColAlign(0,'left');
42 $TABLA2->setColAlign(1,'right');
44 $TABLA = new Tabla ('cellpadding=2');
45 $row = array ('Id','Nombre','Modif.','Elim.','Perm.');
46 $TABLA->addRow($row,'cabecera');
48 foreach ($sistemas as $sistema) {
49 $Popup = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPopup);
50 $Modif = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefModif);
51 $Elim = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefElim);
52 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif);
53 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim);
54 $Perm = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPerm);
55 $Popup = $Popup.$sistema->getNombre().'</a>';
57 $row = array ( $sistema->getId(),
66 //Agrego las cosas al cuerpo de la pagina
68 $MARCO->addBody($TABLA2->toHtml(1));
69 $MARCO->addBody($TABLA);