Rectifique su busqueda por favor."; $label_hprob = "Problemas de salud relacionados con el tema"; $label_vernaculos = "Nombres vernaculares y países"; $label_indexby = "Índice por"; $label_sortby = "Clasificación por"; $label_otrores = "Otros resultados : "; } else if ($lang == "fr") { $label_buscar = "Rechercher une plante"; $label_results = "Rechercher les résultats"; $label_searchby = "Recherche par"; $label_species = "espèces"; // $label_spacer = "------------------------------------------------------------"; $label_spacer = "________________________________________"; $label_entregar = "Recherche"; $label_sino = "synonymes"; $label_vernacular = "noms Vernaculaires"; $label_familia = "famille botanique"; $label_territory = "région"; $label_healthproblem = "problèmes de santé"; $label_hprob = "Problèmes de santé en lien avec le sujet"; $label_vernaculos = "Noms vernaculaires et pays"; $label_indexby = "Index par"; $label_sortby = "Classement par"; $label_vernacular_results = "Plantes avec le nom vernaculaire"; $label_familia_results = "Plantes de la famille botanique"; $label_territory_results = "Plantes du pays"; $label_healthproblem_results = "Plantes traitant le problè de santé"; $label_keywords_results = "Plantes en lien avec le mot"; $label_a = " à "; $label_de = " de "; $label_resultados = "Resultats "; $label_page = "Page"; $label_resultsof = "Resultats de votre recherche par"; $label_por = "par"; $label_nohay = "Aucun document ne correspond avotre recherche.
Veuillez modifier votre recherche SVP."; $label_otrores = "Autres résultats: "; } else if ($lang == "en") { $label_buscar = "Search for a plant"; $label_results = "Search Results"; $label_searchby = "Search by"; $label_sino = "synonyms"; $label_species = "species"; // $label_spacer = "------------------------------------------------------------"; $label_spacer = "________________________________________"; $label_entregar = "Submit"; $label_vernacular = "vernacular names"; $label_familia = "botanical family"; $label_territory = "territory (Location)"; $label_healthproblem = "health problem"; $label_hprob = "Related health problems"; $label_vernaculos = "Vernacular names and territories"; $label_indexby = "Index by"; $label_sortby = "Sort by"; $label_vernacular_results = "Plants with the vernacular name of "; $label_familia_results = "Plants of the botanical family "; $label_territory_results = "Plants in the territory of "; $label_healthproblem_results = "Plants related to the health problem "; $label_keywords_results = "Plants related to the words "; $label_a = " to "; $label_de = " of "; $label_resultados = "Results "; $label_page = "Page"; $label_resultsof = "Results of your search for"; $label_por = "by"; $label_nohay = "No documents match your criteria.
Please redefine your search slightly."; $label_otrores = "Other results: "; } function sino_convert($sinonimos) { if (strlen($sinonimos) > 0) { do{ $pos = strpos("$sinonimos", "="); if ($pos==0){ $pos=strlen($sinonimos); $flag = 1; } $sino = substr("$sinonimos", 0, $pos); $sinonimos = substr("$sinonimos", $pos+1, strlen($sinonimos)-$pos+1); $sino_old = $sino; $sino = trim($sino); $list = split(" ", $sino); if ($sino!=$sino_old){ $list[0] = " ".$list[0]; } if (count($list)<3){ $sinofin = $sinofin."= $sino
"; } else { $sinofin = $sinofin."= ".$list[0]." ".$list[1].""; $x = 3; while ((count($list)-$x+1)>0){ $sinofin = $sinofin." ".$list[$x-1]; $x++; } $sinofin = $sinofin."
"; } } while($flag!=1); return $sinofin; } } if (!$sort) { $sort = "species"; } if ($sort == "species") { $label_indexby = $label_indexby." ".$label_species; } else if ($sort == "territory") { $label_indexby = $label_indexby." ".$label_territory; } // para que salga el titulo "sorteado por sinonimos" else if ($sort == "synon") { $label_indexby = $label_indexby." ".$label_sino; } else if ($sort == "healthproblem") { $label_indexby = $label_indexby." ".$label_familia; } else if ($sort == "familia") { $label_indexby = $label_indexby." ".$label_healthproblem; } echo "$label_indexby
\n\n"; echo "$label_sortby:\n"; if ($sort != "territory" || $pais_id || $QUERY_STRING) { echo "$label_territory | \n"; } if ($sort != "species" || $QUERY_STRING) { echo "$label_species | \n"; } //if ($sort != "vernacular" || $QUERY_STRING) { // echo "$label_vernacular | \n"; //} if ($sort != "familia" || $QUERY_STRING) { echo "$label_familia | \n"; } if ($sort != "healthproblem" || $QUERY_STRING) { echo "$label_healthproblem | \n"; } if ($sort != "synon" || $QUERY_STRING) { echo "$label_sino | \n"; } echo "

\n"; if ($sort == "species") { $search = "SELECT distinct p.ref_id, p.cientifico, p.sinonimos, fl.familia FROM principal p, familia_lista fl WHERE fl.familia_id=p.familia_id AND p.tipo_id=1 ORDER BY p.cientifico"; $query = pg_exec($conn, $search); $totalmono = pg_numrows($query); $start_count = 0; if ($QUERY_STRING){ $start_count = $QUERY_STRING; } $end = $start_count + 20; if ($end>$totalmono){ $end = $totalmono; } if ($totalmono>20){ $step=0; $stc = $start_count+1; echo "
$label_resultados $stc $label_a $end $label_de $totalmono

"; $otrores = $label_otrores; for ($cpt=0; $cpt < $totalmono; $cpt=$cpt+20){ $step++; $next_cpt = $cpt+20; if ($next_cpt>$totalmono){ $next_cpt = $totalmono; } if ($cpt !=$start_count){ $otrores .= "$step "; } else{ $otrores .= "$step "; } } echo $otrores."
"; } if ($totalmono != 0) { for ($i=$start_count; $i < $end; $i++) { $get = pg_fetch_row($query, $i); //mise des 2 premiers mots du nom scientifique en italique $cientifico = $get[1]; if (strlen($cientifico) > 0) { $list = split(" ", $cientifico); if (count($list)<3){ $cientifico = "".$cientifico.""; } else { $cientifico = "".$list[0]." ".$list[1].""; $x = 3; while ((count($list)-$x+1)>0){ $cientifico= $cientifico." ".$list[$x-1]; $x++; } } } $sino =sino_convert($get[2]); echo "\n\n

\n$cientifico
\n"; if (strlen($get[2]) != 0) { echo "$sino\n"; } echo strtoupper($get[3])."
\n"; // para presentar los paises y nombres vernaculos $queryterr = pg_exec($conn, "select distinct v.ref_id, pl.pais_$lang, v.vernaculos from vernaculos v, pais_lista pl where pl.pais_id=v.pais_id AND v.ref_id=$get[0] order by vernaculos"); if (pg_numrows($queryterr) != 0) { $j = 0; echo "$label_vernaculos: "; while ($j < pg_numrows($queryterr)) { $getthisterr = pg_fetch_row($queryterr, $j); if ($j != 0) { $getprevterr = pg_fetch_row($queryterr, $j-1); } if ($j+1 < pg_numrows($queryterr)) { $getnextterr = pg_fetch_row($queryterr, $j+1); } if ($getthisterr[2] != $getprevterr[2]) { echo " $getthisterr[1]"; } else { echo ", $getthisterr[1]"; } if ($getthisterr[2] != $getnextterr[2] || $j+1 == pg_numrows($queryterr)) { echo ": $getthisterr[2]"; } $j++; } echo "
\n"; } //para presentar los problemas de salud $queryhprob = pg_exec($conn, "select distinct u.ref_id, el.enfermedad_$lang from usos u, enfermedad_lista el where el.enfermedad_id=u.enfermedad_id AND ref_id=$get[0]"); if (pg_numrows($queryhprob) != 0) { $k = 0; while ($k < pg_numrows($queryhprob)) { $gethprob = pg_fetch_row($queryhprob, $k); if (!$hprob) { $hprob = $gethprob[1]; } else { $hprob = $hprob.", $gethprob[1]"; } $k++; } echo "$label_hprob: $hprob
\n"; $hprob = ""; } } } echo "
".$otrores."
"; } else if ($sort == "territory") { if (!$QUERY_STRING){ $terrysearch = "select distinct pl.pais_id, pl.pais_$lang FROM pais_lista pl, principal p, vernaculos v WHERE p.ref_id=v.ref_id AND v.pais_id=pl.pais_id AND p.tipo_id=1 order by pl.pais_$lang"; $queryterry = pg_exec($conn, $terrysearch); if (pg_numrows($queryterry) != 0) { $p = 0; while ($p < pg_numrows($queryterry)) { $getter = pg_fetch_row($queryterry, $p); echo "\n\n$getter[1]
\n\n"; $p++; } } } else{ $q_stringa = $QUERY_STRING; $q_stringb = 0; if ($QUERY_STRING>99){ $q_stringa = substr($QUERY_STRING, 0, 2); $q_stringb = substr($QUERY_STRING, 3, 10); } echo "

\n"; $queryspecies = pg_exec($conn, "SELECT distinct p.ref_id, p.cientifico, p.sinonimos, fl.familia FROM principal p, familia_lista fl, vernaculos v WHERE v.ref_id=p.ref_id AND v.pais_id='$q_stringa' AND fl.familia_id=p.familia_id AND p.tipo_id=1 ORDER BY p.cientifico"); $totalmono = pg_numrows($queryspecies); $start_count = 0; if ($q_stringb){ $start_count = $q_stringb; } $end = $start_count + 20; if ($end>$totalmono){ $end = $totalmono; } if ($totalmono>20){ $step=0; $stc = $start_count+1; echo "$label_resultados $stc $label_a $end $label_de $totalmono

$label_otrores"; for ($cpt=0; $cpt < $totalmono; $cpt=$cpt+20){ $step++; $next_cpt = $cpt+20; if ($next_cpt>$totalmono){ $next_cpt = $totalmono; } if ($cpt !=$start_count){ if (strlen("$q_stringa")<2){ $q_stringa = "0".$q_stringa; } $aaficher = "$step "; echo $aaficher; } else{ echo "$step "; } } } if ($totalmono != 0) { for ($n=$start_count; $n < $end; $n++) { $get = pg_fetch_row($queryspecies, $n); //mise des 2 premiers mots du nom scientifique en italique $cientifico = $get[1]; if (strlen($cientifico) > 0) { $list = split(" ", $cientifico); if (count($list)<3){ $cientifico = "".$cientifico.""; } else { $cientifico = "".$list[0]." ".$list[1].""; $x = 3; while ((count($list)-$x+1)>0){ $cientifico= $cientifico." ".$list[$x-1]; $x++; } } } //mise des 2 premiers mots du synonime en italique $sino =sino_convert($get[2]); echo "\n\n

\n$cientifico
\n"; if (strlen($get[2]) != 0) { echo "$sino\n"; } echo strtoupper($get[3])."
\n"; $queryterr = pg_exec($conn, "select distinct v.ref_id, pl.pais_$lang, v.vernaculos from vernaculos v, pais_lista pl where pl.pais_id=v.pais_id AND v.ref_id=$get[0] order by vernaculos"); if (pg_numrows($queryterr) != 0) { $j = 0; echo "$label_vernaculos: "; while ($j < pg_numrows($queryterr)) { $getthisterr = pg_fetch_row($queryterr, $j); if ($j != 0) { $getprevterr = pg_fetch_row($queryterr, $j-1); } if ($j+1 < pg_numrows($queryterr)) { $getnextterr = pg_fetch_row($queryterr, $j+1); } if ($getthisterr[2] != $getprevterr[2]) { echo " $getthisterr[1]"; } else { echo ", $getthisterr[1]"; } if ($getthisterr[2] != $getnextterr[2] || $j+1 == pg_numrows($queryterr)) { echo ": $getthisterr[2]"; } $j++; } echo "
\n"; } $queryhprob = pg_exec($conn, "select distinct u.ref_id, el.enfermedad_$lang from usos u, enfermedad_lista el where el.enfermedad_id=u.enfermedad_id AND ref_id=$get[0]"); if (pg_numrows($queryhprob) != 0) { $k = 0; while ($k < pg_numrows($queryhprob)) { $gethprob = pg_fetch_row($queryhprob, $k); if (!$hprob) { $hprob = $gethprob[1]; } else { $hprob = $hprob.", $gethprob[1]"; } $k++; } echo "$label_hprob: $hprob
\n"; $hprob = ""; } } } $i++; echo "

\n\n"; } }else if ($sort == "synon"){ // recoje todo los nombres cientificos y sinonimos $query = pg_exec($conn, "SELECT DISTINCT cientifico, ref_id FROM principal WHERE tipo_id=1 AND cientifico !='null' UNION SELECT DISTINCT sinonimos, ref_id FROM principal WHERE tipo_id=1 AND sinonimos!='null' AND cientifico!='null'"); for ($i=0; $i < pg_numrows($query); $i++) { $get = pg_fetch_row($query, $i); //mise des 2 premiers mots du nom scientifique en italique $cientifico = $get[1]; //echo $get[1]." : ".$get[0]."
"; $tab_temp = explode("=", $get[0]); for ($j=0; $j"; } } } ksort($resultados); $i = 0; foreach ($resultados as $key => $val) { //echo $i." : ".$val." : ".$key."
\n"; $liens[$i] = "$key
\n"; $i++; } $totalmono = $i; //$totalmono = pg_numrows($query); $start_count = 0; if ($QUERY_STRING){ $start_count = $QUERY_STRING; } $end = $start_count + 20; if ($end>$totalmono){ $end = $totalmono; } if ($totalmono>20){ $step=0; $stc = $start_count+1; echo "
$label_resultados $stc $label_a $end $label_de $totalmono

"; $otrosres = "$label_otrores"; for ($cpt=0; $cpt < $totalmono; $cpt=$cpt+20){ $step++; $next_cpt = $cpt+20; if ($next_cpt>$totalmono){ $next_cpt = $totalmono; } if ($cpt !=$start_count){ $otrosres .= "$step "; } else{ $otrosres .= "$step "; } } } echo $otrosres."

"; for ($i = $start_count; $i<$end; $i++){ echo $liens[$i]; } echo "
".$otrosres."

"; } else if ($sort == "familia") { if (!$QUERY_STRING){ $familysearch = "SELECT distinct fl.familia, fl.familia_id FROM principal p, familia_lista fl WHERE fl.familia_id=p.familia_id AND p.tipo_id=1 ORDER BY fl.familia"; $queryfamily = pg_exec($conn, $familysearch); if (pg_numrows($queryfamily) != 0) { $p = 0; while ($p < pg_numrows($queryfamily)) { $getfam = pg_fetch_row($queryfamily, $p); echo "\n\n$getfam[0]
\n\n"; $p++; } } } else{ echo "
\n"; $search = "SELECT distinct p.ref_id, p.cientifico, p.sinonimos, fl.familia FROM principal p, familia_lista fl WHERE fl.familia_id=p.familia_id AND p.tipo_id=1 AND p.familia_id='$QUERY_STRING' ORDER BY p.cientifico"; $query = pg_exec($conn, $search); $i = 0; if (pg_numrows($query) != 0) { while ($i < pg_numrows($query)) { $get = pg_fetch_row($query, $i); //mise des 2 premiers mots du nom scientifique en italique $cientifico = $get[1]; if (strlen($cientifico) > 0) { $list = split(" ", $cientifico); if (count($list)<3){ $cientifico = "".$cientifico.""; } else { $cientifico = "".$list[0]." ".$list[1].""; $x = 3; while ((count($list)-$x+1)>0){ $cientifico= $cientifico." ".$list[$x-1]; $x++; } } } //mise des 2 premiers mots du synonime en italique $sino =sino_convert($get[2]); echo "\n\n

\n$cientifico
\n"; if (strlen($get[2]) != 0) { echo "$sino\n"; } echo strtoupper($get[3])."
\n"; $queryterr = pg_exec($conn, "select distinct v.ref_id, pl.pais_$lang, v.vernaculos from vernaculos v, pais_lista pl where pl.pais_id=v.pais_id AND v.ref_id=$get[0] order by vernaculos"); if (pg_numrows($queryterr) != 0) { $j = 0; echo "$label_vernaculos: "; while ($j < pg_numrows($queryterr)) { $getthisterr = pg_fetch_row($queryterr, $j); if ($j != 0) { $getprevterr = pg_fetch_row($queryterr, $j-1); } if ($j+1 < pg_numrows($queryterr)) { $getnextterr = pg_fetch_row($queryterr, $j+1); } if ($getthisterr[2] != $getprevterr[2]) { echo " $getthisterr[1]"; } else { echo ", $getthisterr[1]"; } if ($getthisterr[2] != $getnextterr[2] || $j+1 == pg_numrows($queryterr)) { echo ": $getthisterr[2]"; } $j++; } echo "
\n"; } $queryhprob = pg_exec($conn, "select distinct u.ref_id, el.enfermedad_$lang from usos u, enfermedad_lista el where el.enfermedad_id=u.enfermedad_id AND ref_id=$get[0]"); if (pg_numrows($queryhprob) != 0) { $k = 0; while ($k < pg_numrows($queryhprob)) { $gethprob = pg_fetch_row($queryhprob, $k); if (!$hprob) { $hprob = $gethprob[1]; } else { $hprob = $hprob.", $gethprob[1]"; } $k++; } echo "$label_hprob: $hprob
\n"; $hprob = ""; } $i++; } } echo "

\n\n"; } } else if ($sort == "healthproblem") { if (!$QUERY_STRING){ $healthsearch = "SELECT DISTINCT el.enfermedad_$lang, el.enfermedad_id FROM principal p, enfermedad_lista el, usos u WHERE el.enfermedad_id=u.enfermedad_id AND u.ref_id=p.ref_id AND p.tipo_id=1 ORDER BY el.enfermedad_$lang"; $queryhealth = pg_exec($conn, $healthsearch); if (pg_numrows($queryhealth) != 0) { $p = 0; while ($p < pg_numrows($queryhealth)) { $getheal = pg_fetch_row($queryhealth, $p); echo "\n\n$getheal[0]
\n\n"; $p++; } } } else{ echo "
"; $search = "SELECT DISTINCT p.ref_id, p.cientifico, p.sinonimos, fl.familia FROM principal p, familia_lista fl, usos u WHERE u.ref_id=p.ref_id AND p.tipo_id=1 AND u.enfermedad_id='$QUERY_STRING' ORDER BY p.cientifico"; $query = pg_exec($conn, $search); $i = 0; $healmem = ""; if (pg_numrows($query) != 0) { while ($i < pg_numrows($query)) { $get = pg_fetch_row($query, $i); $oldhealmem = $healmem; $healmem = $get[0]; if ($healmem!=$oldhealmem){ //mise des 2 premiers mots du nom scientifique en italique $cientifico = $get[1]; if (strlen($cientifico) > 0) { $list = split(" ", $cientifico); if (count($list)<3){ $cientifico = "".$cientifico.""; } else { $cientifico = "".$list[0]." ".$list[1].""; $x = 3; while ((count($list)-$x+1)>0){ $cientifico= $cientifico." ".$list[$x-1]; $x++; } } } //mise des 2 premiers mots du synonime en italique $sino =sino_convert($get[2]); echo "\n\n

\n$cientifico
\n"; if (strlen($get[2]) != 0) { echo "$sino\n"; } echo strtoupper($get[3])."
\n"; $queryterr = pg_exec($conn, "select distinct v.ref_id, pl.pais_$lang, v.vernaculos from vernaculos v, pais_lista pl where pl.pais_id=v.pais_id AND v.ref_id=$get[0] order by vernaculos"); if (pg_numrows($queryterr) != 0) { $j = 0; echo "$label_vernaculos: "; while ($j < pg_numrows($queryterr)) { $getthisterr = pg_fetch_row($queryterr, $j); if ($j != 0) { $getprevterr = pg_fetch_row($queryterr, $j-1); } if ($j+1 < pg_numrows($queryterr)) { $getnextterr = pg_fetch_row($queryterr, $j+1); } if ($getthisterr[2] != $getprevterr[2]) { echo " $getthisterr[1]"; } else { echo ", $getthisterr[1]"; } if ($getthisterr[2] != $getnextterr[2] || $j+1 == pg_numrows($queryterr)) { echo ": $getthisterr[2]"; } $j++; } echo "
\n"; } $queryhprob = pg_exec($conn, "select distinct u.ref_id, el.enfermedad_$lang from usos u, enfermedad_lista el where el.enfermedad_id=u.enfermedad_id AND ref_id=$get[0]"); if (pg_numrows($queryhprob) != 0) { $k = 0; while ($k < pg_numrows($queryhprob)) { $gethprob = pg_fetch_row($queryhprob, $k); if (!$hprob) { $hprob = $gethprob[1]; } else { $hprob = $hprob.", $gethprob[1]"; } $k++; } echo "$label_hprob: $hprob
\n"; $hprob = ""; } } $i++; } }//el fin del else de la linea 687, antes del "blocquote"// echo "

\n\n"; } } //NOTA: esta parte pertenece al conteo del numero de pagina resultado de la consulta de las plantas, esto sale en la parte final de la pagina (resultado 1 2 3 4)// include("../footer.html"); ?>