$sql="select * from tbl_rednemoris_descarga where int_estado='1' ";
if($fk_categoria!="" && $fk_categoria!="Seleccione:")
{
$sql=$sql." and fk_categoria = '".$fk_categoria."'";
}
if($_SESSION['orden1']==""){ $_SESSION['orden1'] = "asc"; }
if($_SESSION['orden2']==""){ $_SESSION['orden2'] = "desc"; }
if($_SESSION['orden3']==""){ $_SESSION['orden3'] = "desc"; }
if($_SESSION['orden4']==""){ $_SESSION['orden4'] = "desc"; }
switch($o)
{
case 1:
if($_SESSION['orden1']=="desc"){ $_SESSION['orden1'] = "asc"; }
else{ $_SESSION['orden1'] = "desc"; }
$sql=$sql." order by date_publicado ".$_SESSION['orden1'];
break;
case 2:
if($_SESSION['orden2']=="desc"){ $_SESSION['orden2'] = "asc"; }
else{ $_SESSION['orden2'] = "desc"; }
$sql=$sql." order by fk_categoria ".$_SESSION['orden2']; ;
break;
case 3:
if($_SESSION['orden3']=="desc"){ $_SESSION['orden3'] = "asc"; }
else{ $_SESSION['orden3'] = "desc"; }
$sql=$sql." order by txt_titulo ".$_SESSION['orden3']; ;
break;
case 4:
if($_SESSION['orden4']=="desc"){ $_SESSION['orden4'] = "asc"; }
else{ $_SESSION['orden4'] = "desc"; }
$sql=$sql." order by txt_descripcion ".$_SESSION['orden4'];
break;
default:
if($_SESSION['orden1']=="desc"){ $_SESSION['orden1'] = "asc"; }
else{ $_SESSION['orden1'] = "desc"; }
$sql=$sql." order by date_publicado ".$_SESSION['orden1'];
break;
}
$descarga = new cls_tbl_descarga();
$lista = $descarga->lista($sql);
for($i=0;$i
echo inc_fecha_joint($lista[$i]['date_publicado'],5)?>
$categoria = new cls_tbl_categoria($lista[$i]['fk_categoria']);
echo $categoria->gettxt_nombre();?>
echo $lista[$i]['txt_descripcion']?>
}
if(count($lista)==0)
{
echo "no hay descargas para la categoría seleccionada";
}
?>