 
include "conexion/conexion.php";
$cat=$_GET["cat"];
$pro=$_GET["pro"];
$ubi=$_GET["ubi"];
if(isset($cat)){
	$ordenado= 'Ordenadas por Categoría';
		$resultCategoria=mysql_query("SELECT * FROM categorias ORDER BY idCategoria",$conexion);
		while($rowCategoria=mysql_fetch_row($resultCategoria)){
		if($rowCategoria[0]==$cat){
		$criterio=$rowCategoria[1];
		}
		}
		$result = mysql_query("SELECT * FROM practicas WHERE idCategoria=$cat AND aprobada=1 ORDER BY titulo");
}elseif(isset($pro)){
	$ordenado= 'Ordenadas por Problema que intentan resolver';
		$resultProblema=mysql_query("SELECT * FROM problemas ORDER BY idProblema",$conexion);
		while($rowProblema=mysql_fetch_row($resultProblema)){
		if($rowProblema[0]==$pro){
		
		$criterio= $rowProblema[1];
		}
		}
		$result = mysql_query("SELECT * FROM practicas WHERE idProblema=$pro AND aprobada=1 ORDER BY titulo");
}else{
	$ordenado= 'Ordenadas por Ubicación geográfica de desarrollo de la práctica';
		$resultUbicacion=mysql_query("SELECT * FROM ubicacion ORDER BY idUbicacion",$conexion);
		while($rowUbicacion=mysql_fetch_row($resultUbicacion)){
		if($rowUbicacion[0]==$ubi){
		$criterio=$rowUbicacion[1];
		}
		}
		$result = mysql_query("SELECT * FROM practicas WHERE idUbicacion=$ubi AND aprobada=1 ORDER BY titulo");
}
?>
» 
while($row=mysql_fetch_row($result)){
	$resultCategoria=mysql_query("SELECT * FROM categorias ORDER BY idCategoria",$conexion);
		while($rowCategoria=mysql_fetch_row($resultCategoria)){
			if($rowCategoria[0]==$row[2]){
				$categoria=$rowCategoria[1];
			}
		}
	$resultUbicacion=mysql_query("SELECT * FROM ubicacion ORDER BY idUbicacion",$conexion);
		while($rowUbicacion=mysql_fetch_row($resultUbicacion)){
		if($rowUbicacion[0]==$row[3]){
		$ubicacion=$rowUbicacion[1];
		}
	}
	$resultActores=mysql_query("SELECT * FROM actores ORDER BY idActor",$conexion);
		while($rowActor=mysql_fetch_row($resultActores)){
		if($rowActor[0]==$row[7]){
		$actores=$rowActor[1];
		}
	}
	$resultProblema=mysql_query("SELECT * FROM problemas ORDER BY idProblema",$conexion);
		while($rowProblema=mysql_fetch_row($resultProblema)){
		if($rowProblema[0]==$row[10]){
		
		$problema= $rowProblema[1];
		}
		}
?>
$resultO = mysql_query("SELECT * FROM organizaciones WHERE idPractica=$row[0]");
$rowO=mysql_fetch_row($resultO);
	$resultUbicacion=mysql_query("SELECT * FROM ubicacion ORDER BY idUbicacion",$conexion);
		while($rowUbicacion=mysql_fetch_row($resultUbicacion)){
		if($rowUbicacion[0]==$rowO[8]){
		$ubicacionO=$rowUbicacion[1];
		}
	}
#-------------------------------
$final = "$row[11]";
$hay = substr("$final",290);
$rest = substr("$final",0,290);
if (!empty($hay)){
$rest.="...";
}else{
$rest="$final";
}
#-------------------------------
?>
}
?>