Página principal | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases

Samurai.php

Ir a la documentación de este archivo.
00001 <?php
00002 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
00003 // +----------------------------------------------------------------------+
00004 // | PHP Version 4                                                        |
00005 // +----------------------------------------------------------------------+
00006 // | Copyright (c) 1997-2003 The PHP Group                                |
00007 // +----------------------------------------------------------------------+
00008 // | This source file is subject to version 2.02 of the PHP license,      |
00009 // | that is bundled with this package in the file LICENSE, and is        |
00010 // | available at through the world-wide-web at                           |
00011 // | http://www.php.net/license/2_02.txt.                                 |
00012 // | If you did not receive a copy of the PHP license and are unable to   |
00013 // | obtain it through the world-wide-web, please send a note to          |
00014 // | license@php.net so we can mail you a copy immediately.               |
00015 // +----------------------------------------------------------------------+
00016 // | Created: Tue May 27 17:05:58 2003
00017 // | Author:  Martin Marrese - Myrna Degano <mmarre@mecon.gov.ar - mdegan@mecon.gov.ar>
00018 // +----------------------------------------------------------------------+
00019 //
00020 // $Id: Samurai.php 26 2003-07-07 22:45:35Z mmarre $
00021 // $Author: mmarre $
00022 // $URL: http://portal.mecon.ar/svn/samurai/tronco/lib/SAMURAI/Samurai.php $
00023 // $Date: 2003-07-07 19:45:35 -0300 (Mon, 07 Jul 2003) $
00024 // $Rev: 26 $
00025 //
00026 
00027 #require_once 'PEAR.php';
00028 require_once 'Sistema.php';
00029 require_once 'Usuario.php';
00030 require_once 'Permiso.php';
00031 require_once 'Perfil.php';
00032 
00033 
00034 
00035 // +X2C Class 274 :Samurai
00041 class Samurai {
00048     var $_id_sistema;
00049 
00056     var $_db;
00057 
00058     // ~X2C
00059 
00060     // +X2C Operation 280
00070     function Samurai(&$db, $idSistema = null) // ~X2C
00071     {
00072         $this->_id_sistema = $idSistema;
00073         $this->_db = &$db;
00074     }
00075     // -X2C
00076 
00077     // +X2C Operation 283
00084     function _getIdSistemas() // ~X2C
00085     {
00086         $rta = array();
00087         $sql = include 'Samurai/consultas.php';
00088         $dbh = $this->_db->prepare($sql['obtener_id_sistemas']);
00089         $res = $this->_db->execute($dbh);
00090         while ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
00091             array_push($rta,$re['id_sistema']);
00092         }        
00093         $res->free();
00094         return $rta;
00095     }
00096     // -X2C
00097 
00098     // +X2C Operation 285
00105     function _armarArraySistemas() // ~X2C
00106     {
00107         $rta = array ();
00108         foreach ($this->_getIdSistemas() as $id) {
00109             $tmp = new Sistema($this->_db,$id);
00110             array_push($rta, $tmp);
00111         }
00112         return $rta;
00113     }
00114     // -X2C
00115 
00116     // +X2C Operation 286
00123     function getSistemas() // ~X2C
00124     {
00125         return $this->_armarArraySistemas();
00126     }
00127     // -X2C
00128 
00129 
00130 
00131 
00132 
00133 
00134     // +X2C Operation 320
00141     function getSelectSistemas() // ~X2C
00142     {
00143         $rta = array ();
00144         foreach ($this->_armarArraySistemas() as $sistema) {
00145             $rta[$sistema->getId()] = $sistema->getNombre();
00146         }
00147         return $rta;
00148     }
00149     // -X2C
00150 
00151     // +X2C Operation 327
00156     function getPerfiles() // ~X2C
00157     {
00158         return $this->_armarArrayPerfiles();
00159     }
00160     // -X2C
00161 
00162     // +X2C Operation 328
00167     function _armarArrayPerfiles() // ~X2C
00168     {
00169         $rta = array ();
00170         foreach ($this->_getIdPerfiles() as $id) {
00171             $tmp = new Perfil($this->_db,$id);
00172             array_push($rta, $tmp);
00173         }
00174         return $rta;
00175     }
00176     // -X2C
00177 
00178     // +X2C Operation 329
00185     function _getIdPerfiles() // ~X2C
00186     {
00187         $rta = array();
00188         $sql = include 'Samurai/consultas.php';
00189         $dbh = $this->_db->prepare($sql['obtener_id_perfiles']);
00190         $tmp[] = $_SESSION['samurai']['id_sistema'];
00191         $res = $this->_db->execute($dbh, $tmp);
00192         while ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
00193             array_push($rta,$re['id_perfil']);
00194         }        
00195         $res->free();
00196         return $rta;
00197     }
00198     // -X2C
00199 
00200 } // -X2C Class :Samurai
00201 
00202 ?>

Generado el Tue Jul 8 11:36:21 2003 para SAMURAI por doxygen 1.3.2