2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
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: Thu Jun 19 15:17:11 2003
17 // | Author: Gonzalo Merayo <gmeray@mecon.gov.ar>
18 // +----------------------------------------------------------------------+
27 #require_once 'PEAR.php';
28 require_once 'DB.php';
29 require_once 'MECON/Tiempo/Hora.php';
34 // +X2C Class 131 :Agente
58 function getDependencia() // ~X2C
60 return $this->datos['codep'];//TODO esta no es la columna correcta
69 function getTipo() // ~X2C
71 if(is_null($this->datos['tipo_agente']))
72 return 'CON '.$this->datos['marco_legal'];
74 return $this->datos['tipo_agente'];
86 function Agente($agente) // ~X2C
88 $this->agente = $agente;
89 $dsn = 'mysql://intranet:intranet@intranet-db/novedades';
90 $db = DB::connect($dsn);
91 if (DB::isError($db)) die ($db->getMessage("No pudo conectarse a la base"));
94 WHERE nrodoc = $agente";
95 $result = $db->query($sql);
96 if(DB::isError($result))
97 die($result->getMessage("query mal hecho"));
98 if($result->numRows() > 0)
100 $this->datos = $result->fetchRow(DB_FETCHMODE_ASSOC);
104 $dsn = 'mysql://intranet:intranet@intranet-db/Contratados';
105 $db = DB::connect($dsn);
106 if (DB::isError($db)) die ($db->getMessage("No pudo conectarse a la base"));
109 WHERE nrodoc = $agente";
110 $result = $db->query($sql);
111 if(DB::isError($result))
112 die($result->getMessage("query mal hecho"));
113 if($result->numRows() > 0)
115 $this->datos = $result->fetchRow(DB_FETCHMODE_ASSOC);
118 trigger_error("Ahhhhh, agente no encontrado!");
123 // +X2C Operation 138
128 function getNombre() // ~X2C
130 return $this->datos['nombre'];
134 // +X2C Operation 139
139 function getHoraDesde() // ~X2C
141 if(is_null($this->datos['hentra']))
142 return new Hora($this->datos['hora_desde']);
144 return new Hora($this->datos['hentra']);
148 // +X2C Operation 140
153 function getHoraHasta() // ~X2C
155 if(is_null($this->datos['hsale']))
156 return new Hora($this->datos['hora_hasta']);
158 return new Hora($this->datos['hsale']);
162 // +X2C Operation 149
167 function getCuil()// ~X2C
169 trigger_error('Not implemented!', E_USER_WARNING);
173 // +X2C Operation 151
178 function getOtrosDatos()// ~X2C
180 if(!is_null($this->datos['tipo_agente'])) {
181 $aux['fecha_nac'] = $this->datos['fecha_nac'];
182 $aux['edad'] = $this->datos['edad'];
183 $aux['estado_civil'] = $this->datos['estado_civil'];
184 $aux['domicilio'] = $this->datos['domicilio'];
185 $aux['puerta'] = $this->datos['num_puerta'];
186 $aux['piso'] = $this->datos['piso'];
187 $aux['depto'] = $this->datos['depto'];
188 $aux['localidad'] = $this->datos['localidad'];
189 $aux['provincia'] = $this->datos['provincia'];
190 $aux['calle1'] = $this->datos['calle1'];
191 $aux['calle2'] = $this->datos['calle2'];
192 $aux['cp'] = $this->datos['cp'];
193 $aux['telefono'] = $this->datos['telefono'];
194 $aux['cargo'] = $this->datos['cargo'];
195 $aux['nivel'] = $this->datos['nivel'];
196 $aux['grado'] = $this->datos['grado'];
197 $aux['func_ejec'] = $this->datos['func_ejec'];
198 $aux['obra_social'] = $this->datos['obra_social'];
199 $aux['afiliado'] = $this->datos['afiliado'];
200 $aux['conyuge'] = $this->datos['conyuge'];
201 $aux['fecha_nac_conyuge'] = $this->datos['fecha_nac_cony'];
202 $aux['tipo_doc_conyuge'] = $this->datos['tipodoc_cony'];
203 $aux['nro_doc_cony'] = $this->datos['nrodoc_cony'];
208 } // -X2C Class :Agente