1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
3 Ministerio de EconomÃa
5 -------------------------------------------------------------------------------
6 This file is part of meconlib.
8 meconlib is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 meconlib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: Thu Jun 19 16:54:08 2003
22 Autor: Gonzalo Merayo <gmeray@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
27 #require_once 'PEAR.php';
28 require_once 'MECON/Agente.php';
29 require_once 'DB.php';
31 // +X2C Class 145 :Dependencia
52 function dependencia($codep) // ~X2C
54 $this->codep = $codep;
63 function getAgentes() // ~X2C
67 $dsn = 'mysql://intranet:intranet@intranet-db/novedades';
68 $db = DB::connect($dsn);
69 if (DB::isError($db)) die ($db->getMessage("No pudo conectarse a la base"));
72 WHERE codep = '$this->codep'";
73 $result = $db->query($sql);
74 if(DB::isError($result))
75 die($result->getMessage("query mal hecho"));
76 while($row = $result->fetchRow())
77 $agentes[] = new Agente($row[0]);
79 $dsn = 'mysql://intranet:intranet@intranet-db/Contratados';
80 $db = DB::connect($dsn);
81 if (DB::isError($db)) die ($db->getMessage("No pudo conectarse a la base"));
84 WHERE codep = '$this->codep'";
85 $result = $db->query($sql);
86 if(DB::isError($result))
87 die($result->getMessage("query mal hecho"));
88 while($row = $result->fetchRow())
89 $agentes[] = new Agente($row[0]);
100 function getDependencias() // ~X2C
102 $dsn = 'mysql://intranet:intranet@intranet-db/CODEP';
103 $db = DB::connect($dsn);
104 if (DB::isError($db)) die ($db->getMessage("No pudo conectarse a la base"));
105 $sql = "SELECT codigo_actual
107 WHERE dependencia_esta_activa = 1";
108 $result = $db->query($sql);
109 if(DB::isError($result))
110 die($result->getMessage("query mal hecho"));
111 $dependencias = array();
112 while($row = $result->fetchRow())
113 $dependencias[] = $row[0];
114 return $dependencias;
118 } // -X2C Class :Dependencia