+<?php
+// vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
+// +--------------------------------------------------------------------+
+// | Ministerio de Economía |
+// | Intranet |
+// +--------------------------------------------------------------------+
+// | This file is part of Intranet. |
+// | |
+// | Intranet is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published |
+// | by the Free Software Foundation; either version 2 of the License, |
+// | or (at your option) any later version. |
+// | |
+// | Intranet is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Hooks; if not, write to the Free Software Foundation, |
+// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +--------------------------------------------------------------------+
+// | Creado: Mon Jul 7 17:22:10 2003 |
+// | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+
+
+// +X2C includes
+require_once 'DB.php';
+// ~X2C
+
+// +X2C Class 154 :Intranet_Legajos_Familiares
+/**
+ * @access public
+ */
+class Intranet_Legajos_Familiares extends DB {
+ /**
+ * @var int $agente
+ * @access public
+ */
+ var $agente;
+
+ /**
+ * @var int $datos
+ * @access public
+ */
+ var $datos;
+
+ // ~X2C
+
+ // +X2C Operation 169
+ /**
+ * @param int $agente
+ *
+ * @return void
+ * @access public
+ */
+ function Intranet_Legajos_Familiares($agente)// ~X2C
+ {
+ $this->agente = $agente;
+ $dsn = 'mysql://intranet:intranet@intranet-db/novedades';
+ $db = DB::connect($dsn);
+ if (DB::isError($db))
+ die ($db->getMessage("No pudo conectarse a la base"));
+ $sql = "SELECT *
+ FROM web004
+ WHERE documento = $agente";
+ $result = $db->query($sql);
+ if (DB::isError($result))
+ die ($result->getMessage("Query mal hecho"));
+
+ for ($fila = 0; $fila < $result->numRows(); $fila++) {
+ $this->datos[$fila] = $result->fetchRow(DB_FETCHMODE_ASSOC);
+ }
+ }
+ // -X2C
+
+ // +X2C Operation 170
+ /**
+ * @return void
+ * @access public
+ */
+ function getHijos()// ~X2C
+ {
+ $fila = 0;
+ foreach (array_keys($this->datos) as $key) {
+ if($this->datos[$key]['parentesco']=="H") {
+ $aux[$fila]['nombre'] = $this->datos[$key]['nombre'];
+ $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc'];
+ $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc'];
+ $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac'];
+ $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco'];
+ $fila++;
+ }
+ }
+ return $aux;
+ }
+ // -X2C
+
+ // +X2C Operation 171
+ /**
+ * @return void
+ * @access public
+ */
+ function getFamiliares()// ~X2C
+ {
+ $fila = 0;
+ foreach (array_keys($this->datos) as $key) {
+ if($this->datos[$key]['parentesco']!="H") {
+ $aux[$fila]['nombre'] = $this->datos[$key]['nombre'];
+ $aux[$fila]['tipo_doc'] = $this->datos[$key]['tipodoc'];
+ $aux[$fila]['nro_doc'] = $this->datos[$key]['nrodoc'];
+ $aux[$fila]['fecha_nac'] = $this->datos[$key]['fecha_nac'];
+ $aux[$fila]['parentesco'] = $this->datos[$key]['parentesco'];
+ $fila++;
+ }
+ }
+ return $aux;
+ }
+ // -X2C
+
+} // -X2C Class :Intranet_Legajos_Familiares
+?>