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 Class :Agente