<?php trim("header.txt"); 

// matrix color


function show_index($title, $query, $id) {
	if (pg_numrows($query) != 0) {
		if (strlen($title) > 1) {
			font("-1");
			echo "<b>$title</b><br>\n";
		}
		font('-2');
		for ($i = 0 ; $i < pg_numrows($query) ; $i++) {
			$get = pg_fetch_row($query, $i);
			echo "<a href=\"indice.php3?$id=$get[0]\">$get[1]</a>";
			if ($i != pg_numrows($query)-1) {
				echo ", ";
			}
		}
		font("-1");
	}
}

// get indexes
$query_region = pg_exec($conn, "SELECT region_id, region_$lang FROM lista_region WHERE region_id > 0 ORDER BY orden DESC, region_$lang");
$query_tipo = pg_exec($conn, "SELECT tipo_id, tipo_$lang FROM lista_tipo WHERE tipo_id > 0 ORDER BY tipo_id");
$query_tematica = pg_exec($conn, "SELECT tematica_id, tematica_$lang FROM lista_tematica WHERE tematica_id > 0 ORDER BY orden DESC, tematica_$lang");
$query_categoria = pg_exec($conn, "SELECT categoria_id, categoria_$lang FROM lista_categoria WHERE categoria_id > 0 ORDER BY categoria_$lang");

?>
			
			Le METASITE CARIBTIC est l'ensemble des références en ligne sur l'Internet 
			relevant de la coopération dans les Caraïbes. Il ne s'agit donc pas d'un 
			portail exhaustif mais d'un outil pour professionnels, qui sera centré essentiellement 
			sur les sites internationaux, gouvernementaux, para-gouvernementaux, 
			associatifs, universitaires qui ont un rapport direct ou indirect avec 
			la coopération scientifique, culturelle, économique et politique dans 
			les Caraïbes. Cela exclut les sites à vocation purement commerciale, sauf 
			peut-être les services qui répondent à cette 
			définition (cabinets de consultants par exemple).
			<p>
			
			<form name=buscar method=post action="indice.php3">
			<?php font("+1"); ?>
			Recherche interne<br>
			<hr width=100%>
			<?php font(-1); ?>
			<input type=text width=45 name="keywords"> &nbsp; &nbsp;
			<input type=submit name=submit value="Chercher!"> &nbsp; &nbsp; <font size=-2>
			(<a href="buscarmas.php3">recherche avanc&eacute;e</a>)</font><p>
			</form>
			
			<?php font("+1"); ?>
			Index<br>
			<hr width=100%>
			<?php 
				font('-1');
				echo "<b>Par thème</b><br>\n";
				font('-2');
				for ($i = 0 ; $i < pg_numrows($query_tematica) ; $i++) {
					$get = pg_fetch_row($query_tematica, $i);
					echo "<a href=\"indice.php3?tematica_id=$get[0]\">$get[1]</a>";
					$query_count = pg_exec($conn, "SELECT count(pin) FROM principal WHERE tematica_id='$get[0]' AND revisada != 'no'");
					if (pg_numrows($query_count) != 0) {
						$get_count = pg_fetch_row($query_count, 0);
						echo " ($get_count[0])";
					} else {
						echo " (0)";
					}
					if ($i != pg_numrows($query_tematica)-1) {
						echo ", ";
					}
				}
				font("-1");
			?>
			
			<p>
			<?php show_index("Par régions ou pays", $query_region, "region_id"); ?>
			<p>
			<?php show_index("Par &eacute;diteur", $query_categoria, "categoria_id"); ?>
			<p>
			<?php show_index("Par type de références", $query_tipo, "tipo_id"); ?>

<?php include("footer.txt"); ?><html> 