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 //VERIFICO SI SE TIENE ACCESO A LA PAGINA{{{
23 $SAMURAI_PERM->setSistema(SAMURAI_PERM);
24 if (!$SAMURAI_PERM->tiene(SAMURAI_PERM_DEVELOPER)) {
25 $SAMURAI_PERM->chequear(SAMURAI_PERM_DEVELOPER);
27 $MARCO =& new MECON_Marco ('/var/www/sistemas/samurai/sistema/conf/confSecciones.php', $SAMURAI_PERM);
29 require_once 'MECON/HTML/Tabla.php';
30 require_once 'SAMURAI/Sistema.php';
32 $aHrefPopup = '<a href="" onClick="window.open(\'sistemas-datos?id_sistema=##SISTEMA##\',\'sistemasdatos\',\'height=400,width=400,scrollbars=yes\');return false;">';
33 $aHref = '<a href="sistemas-abm?accion=##ACCION##&idSistema=##NUEVO##">';
34 $aHrefModif = $aHref.'<img src="/MECON/images/general_modificar.gif" border="0" alt="Modificar Sistema"></a>';
35 $aHrefElim = $aHref.'<img src="/MECON/images/general_eliminar.gif" border="0" alt="Eliminar Sistema" ></a>';
36 $aHrefPerm = '<a href="sistemas-permisos?idSistema=##SISTEMA##"><img src="/MECON/images/general_ir" border="0" alt="Definir Permisos"></a>';
37 //VEO SI HAY QUE ELEGIR EN QUE SISTEMA TRABAJAR {{{
38 if (!@$_SESSION['samurai']['id_sistema']) {
39 header('Location: ./../sel-sistema?redirect=sistemas/sistemas');
43 $sistemas = SAMURAI_Sistema::getSistemas($DB);
45 $TABLA2 = new MECON_HTML_Tabla ('cellspacing=0');
46 $row = array ('<a href="../sel-sistema.php"><img src="/MECON/images/general_ir" border="0">Seleccionar otro sistema para trabajar</a>', $aHref.'<img src="/MECON/images/general_nuevo.gif" border="0">Ingresar Nuevo Sistema</a>');
47 $TABLA2->addRow($row);
48 $TABLA2->updateColAttributes(0,'align="left"');
49 $TABLA2->updateColAttributes(1,'align="right"');
51 $TABLA = new MECON_HTML_Tabla ('cellpadding=2');
52 $row = array ('Id','Nombre','Modif.','Elim.','Perm.');
53 $TABLA->addRow($row,'cabecera');
55 foreach ($sistemas as $sistema) {
56 $Popup = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPopup);
57 $Modif = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefModif);
58 $Elim = ereg_replace('##NUEVO##' , $sistema->getId(), $aHrefElim);
59 $Modif = ereg_replace('##ACCION##' , 'm' , $Modif);
60 $Elim = ereg_replace('##ACCION##' , 'e' , $Elim);
61 $Perm = ereg_replace('##SISTEMA##', $sistema->getId(), $aHrefPerm);
62 $Popup = $Popup.$sistema->getNombre().'</a>';
64 $row = array ( $sistema->getId(),
72 $TABLA->updateColAttributes(0, 'width="5%"');
73 $TABLA->updateColAttributes(2, 'width="8%"');
74 $TABLA->updateColAttributes(3, 'width="8%"');
75 $TABLA->updateColAttributes(4, 'width="8%"');
77 //Agrego las cosas al cuerpo de la pagina
79 $MARCO->addBody($TABLA2->toHtml(1));
80 $MARCO->addBody($TABLA);