2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de EconomÃa |
6 // +--------------------------------------------------------------------+
7 // | This file is part of Intranet. |
9 // | Intranet is free software; you can redistribute it and/or modify |
10 // | it under the terms of the GNU General Public License as published |
11 // | by the Free Software Foundation; either version 2 of the License, |
12 // | or (at your option) any later version. |
14 // | Intranet is distributed in the hope that it will be useful, but |
15 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 // | General Public License for more details. |
19 // | You should have received a copy of the GNU General Public License |
20 // | along with Hooks; if not, write to the Free Software Foundation, |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 // +--------------------------------------------------------------------+
23 // | Creado: Mon Jul 7 17:22:10 2003 |
24 // | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
33 require_once 'DB.php';
36 // +X2C Class 154 :Intranet_Legajos_Familiares
40 class Intranet_Legajos_Familiares extends DB {
62 function Intranet_Legajos_Familiares($agente)// ~X2C
64 $this->agente = $agente;
65 $dsn = 'mysql://intranet:intranet@intranet-db/novedades';
66 $db = DB::connect($dsn);
68 die ($db->getMessage("No pudo conectarse a la base"));
71 WHERE documento = $agente";
72 $result = $db->query($sql);
73 if (DB::isError($result))
74 die ($result->getMessage("Query mal hecho"));
76 for ($fila = 0; $fila < $result->numRows(); $fila++) {
77 $this->datos[$fila] = $result->fetchRow(DB_FETCHMODE_ASSOC);
87 function getHijos()// ~X2C
90 foreach (array_keys($this->datos) as $key) {
91 if($this->datos[$key]['parentesco']=="H") {
92 $aux[$fila]['nombre'] = $this->datos[$key]['nombre'];
93 $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc'];
94 $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc'];
95 $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac'];
96 $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco'];
104 // +X2C Operation 171
109 function getFamiliares()// ~X2C
112 foreach (array_keys($this->datos) as $key) {
113 if($this->datos[$key]['parentesco']!="H") {
114 $aux[$fila]['nombre'] = $this->datos[$key]['nombre'];
115 $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc'];
116 $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc'];
117 $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac'];
118 $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco'];
126 } // -X2C Class :Intranet_Legajos_Familiares