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 //VERIFICO SI SE TIENE ACCESO A LA PAGINA{{{
26 $SAMURAI_PERM->chequear(SAMURAI_PERM_DEVELOPER);
28 $aHrefPopup = '<a href="" onClick="window.open(\'sistemas-datos?id_sistema=##SISTEMA##\',\'sistemasdatos\',\'height=400,width=400,scrollbars=yes\');return false;">';
29 $aHref = '<a href="sistemas-abm?accion=##ACCION##&idSistema=##NUEVO##">';
30 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Sistema"></a>';
31 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Sistema" ></a>';
32 $aHrefPerm = '<a href="sistemas-permisos?idSistema=##SISTEMA##"><img src="/MECON/images/general_ir4" border="0" alt="Definir Permisos"></a>';
33 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
34 if (!@$_SESSION['samurai']['id_sistema']) {
35 header('Location: ./../sel-sistema?redirect=sistemas/sistemas');
39 $sistemas = SAMURAI_Sistema::getSistemas($DB);
41 $TABLA2 = new MECON_HTML_Tabla ('cellspacing=0');
42 $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>');
43 $TABLA2->addRow($row);
44 $TABLA2->updateColAttributes(0,'align="left"');
45 $TABLA2->updateColAttributes(1,'align="right"');
47 $TABLA = new MECON_HTML_Tabla ('cellpadding=2');
48 $row = array ('Id','Nombre','Modif.','Elim.','Perm.');
49 $TABLA->addRow($row,'cabecera');
51 foreach ($sistemas as $sistema) {
52 $Popup = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPopup);
53 $Modif = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefModif);
54 $Elim = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefElim);
55 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif);
56 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim);
57 $Perm = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPerm);
58 $Popup = $Popup.$sistema->getNombre().'</a>';
60 $row = array ( $sistema->getId(),
68 $TABLA->updateColAttributes(0, 'width="5%"');
69 $TABLA->updateColAttributes(2, 'width="8%"');
70 $TABLA->updateColAttributes(3, 'width="8%"');
71 $TABLA->updateColAttributes(4, 'width="8%"');
73 //Agrego las cosas al cuerpo de la pagina
75 $MARCO->addBody($TABLA2->toHtml(1));
76 $MARCO->addBody($TABLA);