<?php 

$bgcolor1 = "#8080ff";
$bgcolor2 = "#FFFFFF";
$bgcolor3 = "#FFFFFF";

$bgrecientes = "#68d038";
$bgrecientes_body = "navy";
$fontrecientes_title = "white";
$bgindex = "white";

if (strstr($PATH_INFO, "/")) {
	$p = substr($PATH_INFO, 1);
	$e_path = explode("/", $p);
	$i = 0;
	while ($i < count($e_path)) {
		$name = $e_path[$i];
		$val = $e_path[$i+1];
		$$name = $val;
		$i = $i+2;
	}
}

if (strstr($REQUEST_URI, "/espanol/")) {
	$lang = "es";
	$dir = "espanol";
	$lenguaid = "1";
} 
if (strstr($REQUEST_URI, "/francais/")) {
	$lang = "fr";
	$dir = "francais";
	$lenguaid = "2";
} 
if (strstr($REQUEST_URI, "/english/")) {
	$lang = "en";
	$dir = "english";
	$lenguaid = "3";
} 
if (strstr($REQUEST_URI, "/texto/")) {
	$dir = "texto/".$dir;
}


// descripcion por idioma

if ($lang == "es") {
	$label_seccion_main = "TRABAJOS HECHOS";
	$label_seccion_tema = "INDICE POR TEMA";
	$label_seccion_region = "INDICE POR REGI&Oacute;N";
	$label_seccion_tipo = "INDICE POR TIPO DE TRABAJO";

	$label_titulo = "Trabajos y logros de Funredes";
	$label_intro = "Le presentamos con orgullo tres maneras de ver lo que FUNREDES ha hecho desde su inicio en 1993.  La primera es una lista por tipo de trabajo que hemos hecho.  Luego, hemos organizado estos trabajos por regi&oacute;n y tema de relevancia.  Si todav&iacute;a no puede localizar las informaciones que busca, aprov&eacute;chese de nuestro <a href=\"buscarsql.php3\">motor de b&uacute;squeda interna</a> y no hesite de contactarnos.<br>";
	$label_tipos = "Lo que hemos hecho por tipo de trabajo";
	$label_porregion = "Lo que hemos hecho en cada regi&oacute;n";
	$label_portema = "Lo que hemos hecho sobre cada tema";
	$label_index_tema = "&iacute;ndice por tema";
	$label_index_region = "&iacute;ndice por regi&oacute;n";
	$label_index_tipo = "&iacute;ndice por tipo de trabajo";
	$label_trabajosrecientes = "TRABAJOS RECIENTES";
	$label_retour = "regresar";

	$label_coorg = "Conferencias (co)organizadas";
	$label_partic = "Conferencias con participación";
	$label_convenios = "Convenios";
	$label_docint = "Documentos internos";
	$label_editoriales = "Editoriales";
	$label_finan = "Informaciones financieras";
	$label_infositio = "Información sobre este sitio";
	$label_proyectos = "Proyectos";
	$label_publicaciones = "Publicaciones";
	$label_servicios = "Servicios";
} else if ($lang == "fr") {
	$label_seccion_main = "TRAVAUX EFFECTU&Eacute;S";
	$label_seccion_tema = "INDEX PAR SUJET";
	$label_seccion_region = "INDEX PAR R&Eacute;GION";
	$label_seccion_tipo = "INDEX PAR TYPE DE TRAVAIL";

	$label_titulo = "Travaux effectu&eacute;s par Funredes";
	$label_intro = "Nous sommes fiers de vous présenter trois façons de voir les travaux effectués par Funredes depuis ses débuts, en 1993. En premier lieu, nous avons organisé nos documents selon le type de travail ou de t&acirc;ches accomplies, en deuxième lieu selon la région ou le sujet abordé.  Et enfin si vous ne pouvez toujours pas retrouver l'information que vous cherchez, essayez notre <a href=\"buscarsql.php3\">moteur de recherche interne</a> ou contactez-nous.<br>";
	$label_tipos = "Ce qu'on a fait par type de travail";
	$label_porregion = "Ce qu'on a fait dans chaque r&eacute;gion";
	$label_portema = "Ce qu'on a fait dans chaque sujet";
	$label_index_tema = "index par sujet";
	$label_index_region = "index par r&eacute;gion";
	$label_index_tipo = "index par type de travail";
	$label_trabajosrecientes = "TRAVAUX RECENTS";
	$label_retour = "retour";

	$label_coorg = "Conférences (co)organizées";
	$label_partic = "Conférences avec participation";
	$label_convenios = "Conventions";
	$label_docint = "Documents internes";
	$label_editoriales = "Editoriaux";
	$label_finan = "Informations financières";
	$label_infositio = "Information sur ce site";
	$label_proyectos = "Projets";
	$label_publicaciones = "Publications";
	$label_servicios = "Services";
} else if ($lang == "en") {
	$label_seccion_main = "OUR WORK";
	$label_seccion_tema = "INDEX BY TOPIC";
	$label_seccion_region = "INDEX BY REGION";
	$label_seccion_tipo = "INDEX BY TYPE OF WORK";

	$label_titulo = "Our Work";
	$label_intro = "We are proud to present to you three different ways to see what Funredes has done since its beginning in 1993.  The first way is an index by type of accomplishment or work.  Then, we've organized our work by region and topic of relevance.  If you still canot find the information you're looking for, take advantage of our <a href=\"buscarsql.php3\">Internal Search Engine</a> and don't hesitate to contact us.<br>";
	$label_tipos = "Our Work Organized by Type of Work";
	$label_porregion = "Our Work Organized by Region";
	$label_portema = "Our Work Organized by Topic";
	$label_index_tema = "index by topic";
	$label_index_region = "index by region";
	$label_index_tipo = "index by type of work";
	$label_trabajosrecientes = "RECENT WORK";
	$label_retour = "back";

	$label_coorg = "(Co)organized Conferences";
	$label_partic = "Conferences We've Participated In";
	$label_convenios = "Agreements";
	$label_docint = "Internal Documents";
	$label_editoriales = "Editorials";
	$label_finan = "Financial Information";
	$label_infositio = "About This Site";
	$label_proyectos = "Projects";
	$label_publicaciones = "Publications";
	$label_servicios = "Services";
}

if (!$titulo) {
	$titulo = $label_titulo;
}
if ($index == "tema") {
	$label_seccion = $label_seccion_tema;
} else if ($index == "region") {
	$label_seccion = $label_seccion_region;
} else if ($index == "tipo") {
	$label_seccion = $label_seccion_tipo;
}

$size_trabajos = GetImageSize("/home/httpd/html/images/dibujo_trabajos.gif"); 


$navbar = "<a href=\"http://".$HTTP_HOST."\">FUNREDES</a> <b>:</b> ";
if (!$index) {
	$navbar = $navbar."$label_seccion_main";
} else {
	$navbar = $navbar."<a href=\"/$dir/brochure.php3\">$label_seccion_main</a> <b>:</b> <b>$label_seccion</b>";
}

// termina descripcion por idioma

$conn = pg_pconnect("dbname=sif user=mike");

include("header.php3");
include("../incluir/filepathandname.inc");


?>
	<table width=100% border=0 cellpadding=0 cellspacing=0>
		<tr>
			<td width=175 valign=top>
				<table width=100% cellpadding=3 cellspacing=0 bgcolor="<?php echo $bgrecientes ?>" border=0><tr><td>
				<table width=100% cellpadding=3 cellspacing=0>
					<tr>
						<td bgcolor="<?php echo $bgrecientes ?>"><font face="<?php echo $font1 ?>" color="<?php echo $fontrecientes_title ?>" size=-1>
							<center><b><?php echo $label_trabajosrecientes ?></b></center>
						</td>
					</tr>
					<tr>
						<td bgcolor="<?php echo $bgrecientes_body ?>"><font face="<?php echo $font1 ?>" size=-1>
<?php
	$query_recientes = pg_exec($conn, "SELECT docid, titulo_$lang, conferencia_$lang, fechadecreacion, tipo FROM principal WHERE tipo!=12 AND tipo!=15 AND tipo!=16 AND tipo!=17 AND tipo!=10 ORDER BY fechadecreacion DESC LIMIT 3");
	$i = 0;
	while ($i < pg_numrows($query_recientes)) {
		$get_recientes = pg_fetch_row($query_recientes, $i);
		$tipoid = $get_recientes[4];
		echo "<font size=-1>\n <a href=\"/$dir/".$filepathandname[$tipoid]."/docid/$get_recientes[0]\">";
		if ($tipoid == "3" || $tipoid == "4") {
			echo $get_recientes[2];
		} else {
			echo $get_recientes[1];
		}
		echo "</a><br>\n";
		echo "<font color=white size=-2>$get_recientes[3]<p>\n\n";
		$i++;
	}
?>
						</td>
					</tr>
				</table>
				</td></tr></table>

<?php
	if ($index) {
?>
				<table width=100% cellpadding=3 cellspacing=0 bgcolor="<?php echo $bgrecientes ?>" border=0><tr><td>
				<table width=100% cellpadding=3 cellspacing=0>
					</tr>
					<tr>
						<td bgcolor="<?php echo $bgrecientes_body ?>"><font face="<?php echo $font1 ?>" size=-1 color="<?php echo $fontrecientes_body ?>">
<?php
	if ($index != "tema") {
		echo "<a href=\"/$dir/brochure.php3/index/tema\">$label_index_tema</a><p>";
	}
	if ($index != "region") {
		echo "<a href=\"/$dir/brochure.php3/index/region\">$label_index_region</a><p>";
	}
	if ($index != "tipo") {
		echo "<a href=\"/$dir/brochure.php3/index/tipo\">$label_index_tipo</a><p>";
	}
	echo "<a href=\"/$dir/brochure.php3\">$label_retour</a>";
?>
						</td>
					</tr>
				</table>
				</td></tr></table>
<?php 
	}
?>							
				<p>
				<img src="/images/dibujo_trabajos.gif" alt="<?php echo $label_titulo ?>" $size_trabajos[3] ><p>

			</td>
			<td valign=top>

				<table width=100% cellpadding=3 cellspacing=0>
					<tr>
						<td><font face="<?php echo $font1 ?>">
						</td>
						<td valign=top align=left>
							<p align=left>
							<?php
							echo "<font size=-2 face=\"$font1\">$navbar</font><p>";
							?>
							<font face="<?php echo $font1 ?>" size=+3><?php echo $label_titulo ?>
							</p>
						</td>
					</tr>
					<tr>
						<td colspan=2><font size=-1 face="<?php echo $font1 ?>"><blockquote><p><br></br><br></br>
<?php 
	if (!$index) {
?>
							<?php echo $label_intro ?><p>
								<table cellpadding=5 cellspacing=3 border=0 align=center>
									<tr>
										<td bgcolor="<?php echo $bgindex ?>"><font size=-1 face="<?php echo $font1 ?>">
											<center><a href="<?php echo $PHP_SELF ?>/index/tipo"><?php echo $label_index_tipo ?></a></center>
										</td>
										<td bgcolor="<?php echo $bgindex ?>"><font size=-1 face="<?php echo $font1 ?>">
											<center><a href="<?php echo $PHP_SELF ?>/index/region"><?php echo $label_index_region ?></a></center>
										</td>
										<td bgcolor="<?php echo $bgindex ?>"><font size=-1 face="<?php echo $font1 ?>">
											<center><a href="<?php echo $PHP_SELF ?>/index/tema"><?php echo $label_index_tema ?></a></center>
										</td>
									</tr>
								</table>
<?php
	} else if ($index == "tipo") {
		echo "<b><u>$label_tipos:</b></u>\n";
?>
	<ol>
		<li><a href="/<?php echo $dir ?>/conferencias/coorganizadas.php3"><?php echo $label_coorg ?></a>
		<li><a href="/<?php echo $dir ?>/conferencias/participacion.php3"><?php echo $label_partic ?></a>
		<li><a href="/<?php echo $dir ?>/institucion/convenios.php3"><?php echo $label_convenios ?></a>
		<li><a href="/<?php echo $dir ?>/institucion/documentosinternos.php3"><?php echo $label_docint ?></a>
		<li><a href="/<?php echo $dir ?>/editoriales.php3"><?php echo $label_editoriales ?></a>
		<li><a href="/<?php echo $dir ?>/institucion/estatutosypresupuestos.php3"><?php echo $label_finan ?></a>
		<li><a href="/<?php echo $dir ?>/infositio/"><?php echo $label_infositio ?></a>
		<li><a href="/<?php echo $dir ?>/proyectos/"><?php echo $label_proyectos ?></a>
		<li><a href="/<?php echo $dir ?>/publicaciones/"><?php echo $label_publicaciones ?></a>
		<li><a href="/<?php echo $dir ?>/servicios/"><?php echo $label_servicios ?></a>
	</ol>
<?php
	} else if ($index == "tema") {
		echo "<b><u>$label_portema:</b></u>";
		echo "<ol>\n";
		$query = pg_exec($conn, "SELECT temaid, tema_$lang FROM temalista ORDER BY tema_$lang");
		$r = 0;
		while ($r < pg_numrows($query)) {
			$get = pg_fetch_row($query, $r);
			echo "<li><a href=\"/$dir/carpeta.php3/temaid/$get[0]/datos/si\">$get[1]</a>\n";
			$r++;
		}
		echo "</ol>\n\n";
	} else if ($index == "region") {
		echo "<b><u>$label_porregion:</b></u>\n";
		echo "<ol>\n";
		$query = pg_exec($conn, "SELECT regionid, region_$lang FROM regionlista ORDER BY region_$lang");
		$r = 0;
		while ($r < pg_numrows($query)) {
			$get = pg_fetch_row($query, $r);
			echo "<li><a href=\"/$dir/carpeta.php3/regionid/$get[0]/datos/si\">$get[1]</a>\n";
			$r++;
		}
	echo "</ol>\n\n";
	}
?>
							</blockquote>
						</td>
					</tr>
				</table>

			</td>
		</tr>
	</table>
<?php

	




include("footer.php3");
?>
