1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>SAMURAI: Samurai.php Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
6 <!-- Generado por Doxygen 1.3.2 -->
7 <div class="qindex"><a class="qindex" href="main.html">Página principal</a> | <a class="qindex" href="classes.html">Lista alfabética</a> | <a class="qindex" href="annotated.html">Lista de componentes</a> | <a class="qindex" href="files.html">Lista de archivos</a> | <a class="qindex" href="functions.html">Miembros de las clases</a></div>
8 <h1>Samurai.php</h1><a href="Samurai_8php.html">Ir a la documentación de este archivo.</a><div class="fragment"><pre>00001 <?php
9 00002 <span class="comment">// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:</span>
10 00003 <span class="comment">// +----------------------------------------------------------------------+</span>
11 00004 <span class="comment">// | PHP Version 4 |</span>
12 00005 <span class="comment">// +----------------------------------------------------------------------+</span>
13 00006 <span class="comment">// | Copyright (c) 1997-2003 The PHP Group |</span>
14 00007 <span class="comment">// +----------------------------------------------------------------------+</span>
15 00008 <span class="comment">// | This source file is subject to version 2.02 of the PHP license, |</span>
16 00009 <span class="comment">// | that is bundled with this package in the file LICENSE, and is |</span>
17 00010 <span class="comment">// | available at through the world-wide-web at |</span>
18 00011 <span class="comment">// | http://www.php.net/license/2_02.txt. |</span>
19 00012 <span class="comment">// | If you did not receive a copy of the PHP license and are unable to |</span>
20 00013 <span class="comment">// | obtain it through the world-wide-web, please send a note to |</span>
21 00014 <span class="comment">// | license@php.net so we can mail you a copy immediately. |</span>
22 00015 <span class="comment">// +----------------------------------------------------------------------+</span>
23 00016 <span class="comment">// | Created: Tue May 27 17:05:58 2003</span>
24 00017 <span class="comment">// | Author: Martin Marrese - Myrna Degano <mmarre@mecon.gov.ar - mdegan@mecon.gov.ar></span>
25 00018 <span class="comment">// +----------------------------------------------------------------------+</span>
26 00019 <span class="comment">//</span>
27 00020 <span class="comment">// $Id: Samurai.php 26 2003-07-07 22:45:35Z mmarre $</span>
28 00021 <span class="comment">// $Author: mmarre $</span>
29 00022 <span class="comment">// $URL: http://portal.mecon.ar/svn/samurai/tronco/lib/SAMURAI/Samurai.php $</span>
30 00023 <span class="comment">// $Date: 2003-07-07 19:45:35 -0300 (Mon, 07 Jul 2003) $</span>
31 00024 <span class="comment">// $Rev: 26 $</span>
32 00025 <span class="comment">//</span>
34 00027 <span class="preprocessor">#require_once 'PEAR.php';</span>
35 00028 <span class="preprocessor"></span>require_once 'Sistema.php';
36 00029 require_once 'Usuario.php';
37 00030 require_once 'Permiso.php';
38 00031 require_once 'Perfil.php';
42 00035 <span class="comment">// +X2C Class 274 :Samurai</span>
43 <a name="l00041"></a><a class="code" href="classSamurai.html">00041</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classSamurai.html">Samurai</a> {
44 <a name="l00048"></a><a class="code" href="classSamurai.html#o0">00048</a> var $<a class="code" href="classSamurai.html#o0">_id_sistema</a>;
46 <a name="l00056"></a><a class="code" href="classSamurai.html#o1">00056</a> var $<a class="code" href="classSamurai.html#o1">_db</a>;
48 00058 <span class="comment">// ~X2C</span>
50 00060 <span class="comment">// +X2C Operation 280</span>
51 <a name="l00070"></a><a class="code" href="classSamurai.html#a0">00070</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a0">Samurai</a>(&$db, $idSistema = null) <span class="comment">// ~X2C</span>
53 00072 $this-><a class="code" href="classSamurai.html#o0">_id_sistema</a> = $idSistema;
54 00073 $this-><a class="code" href="classSamurai.html#o1">_db</a> = &$db;
56 00075 <span class="comment">// -X2C</span>
58 00077 <span class="comment">// +X2C Operation 283</span>
59 <a name="l00084"></a><a class="code" href="classSamurai.html#a1">00084</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a1">_getIdSistemas</a>() <span class="comment">// ~X2C</span>
62 00087 $sql = include 'Samurai/consultas.php';
63 00088 $dbh = $this-><a class="code" href="classSamurai.html#o1">_db</a>->prepare($sql['obtener_id_sistemas']);
64 00089 $res = $this-><a class="code" href="classSamurai.html#o1">_db</a>->execute($dbh);
65 00090 <span class="keywordflow">while</span> ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
66 00091 array_push($rta,$re['id_sistema']);
68 00093 $res->free();
69 00094 <span class="keywordflow">return</span> $rta;
71 00096 <span class="comment">// -X2C</span>
73 00098 <span class="comment">// +X2C Operation 285</span>
74 <a name="l00105"></a><a class="code" href="classSamurai.html#a2">00105</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a2">_armarArraySistemas</a>() <span class="comment">// ~X2C</span>
76 00107 $rta = array ();
77 00108 foreach ($this->_getIdSistemas() as $id) {
78 00109 $tmp = <span class="keyword">new</span> Sistema($this->_db,$id);
79 00110 array_push($rta, $tmp);
81 00112 <span class="keywordflow">return</span> $rta;
83 00114 <span class="comment">// -X2C</span>
85 00116 <span class="comment">// +X2C Operation 286</span>
86 <a name="l00123"></a><a class="code" href="classSamurai.html#a3">00123</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a3">getSistemas</a>() <span class="comment">// ~X2C</span>
88 00125 <span class="keywordflow">return</span> $this-><a class="code" href="classSamurai.html#a2">_armarArraySistemas</a>();
90 00127 <span class="comment">// -X2C</span>
97 00134 <span class="comment">// +X2C Operation 320</span>
98 <a name="l00141"></a><a class="code" href="classSamurai.html#a4">00141</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a4">getSelectSistemas</a>() <span class="comment">// ~X2C</span>
100 00143 $rta = array ();
101 00144 foreach ($this->_armarArraySistemas() as $sistema) {
102 00145 $rta[$sistema->getId()] = $sistema->getNombre();
104 00147 <span class="keywordflow">return</span> $rta;
106 00149 <span class="comment">// -X2C</span>
108 00151 <span class="comment">// +X2C Operation 327</span>
109 <a name="l00156"></a><a class="code" href="classSamurai.html#a5">00156</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a5">getPerfiles</a>() <span class="comment">// ~X2C</span>
111 00158 <span class="keywordflow">return</span> $this-><a class="code" href="classSamurai.html#a6">_armarArrayPerfiles</a>();
113 00160 <span class="comment">// -X2C</span>
115 00162 <span class="comment">// +X2C Operation 328</span>
116 <a name="l00167"></a><a class="code" href="classSamurai.html#a6">00167</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a6">_armarArrayPerfiles</a>() <span class="comment">// ~X2C</span>
118 00169 $rta = array ();
119 00170 foreach ($this->_getIdPerfiles() as $id) {
120 00171 $tmp = <span class="keyword">new</span> Perfil($this->_db,$id);
121 00172 array_push($rta, $tmp);
123 00174 <span class="keywordflow">return</span> $rta;
125 00176 <span class="comment">// -X2C</span>
127 00178 <span class="comment">// +X2C Operation 329</span>
128 <a name="l00185"></a><a class="code" href="classSamurai.html#a7">00185</a> <span class="comment"></span> function <a class="code" href="classSamurai.html#a7">_getIdPerfiles</a>() <span class="comment">// ~X2C</span>
130 00187 $rta = array();
131 00188 $sql = include 'Samurai/consultas.php';
132 00189 $dbh = $this-><a class="code" href="classSamurai.html#o1">_db</a>->prepare($sql['obtener_id_perfiles']);
133 00190 $tmp[] = $_SESSION['samurai']['id_sistema'];
134 00191 $res = $this-><a class="code" href="classSamurai.html#o1">_db</a>->execute($dbh, $tmp);
135 00192 <span class="keywordflow">while</span> ($re = $res->fetchrow(DB_FETCHMODE_ASSOC)) {
136 00193 array_push($rta,$re['id_perfil']);
138 00195 $res->free();
139 00196 <span class="keywordflow">return</span> $rta;
141 00198 <span class="comment">// -X2C</span>
143 00200 } <span class="comment">// -X2C Class :Samurai</span>
146 </pre></div><hr size="1"><address style="align: right;"><small>Generado el Tue Jul 8 11:36:21 2003 para SAMURAI por
147 <a href="http://www.doxygen.org/index.html">
148 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
149 </a>1.3.2 </small></address>