67 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?
 | 
						|
   if ( !isset($orderBy) ) $orderBy ="id";
 | 
						|
   if ( !isset($orderDir) ) $orderDir ="ASC";
 | 
						|
   if ( !isset($parent) ) $parent='';
 | 
						|
 | 
						|
//   echo "Listado de Estilos<br><br>";
 | 
						|
 | 
						|
   displayList($conexion, $orderBy, $orderDir, $parent);
 | 
						|
 | 
						|
function cambiaProporciones()
 | 
						|
{
 | 
						|
 global $db_Foto_w, $db_Foto_h;
 | 
						|
 $W = 125; $H=125; 
 | 
						|
 | 
						|
 if ( $db_Foto_w > 0 )
 | 
						|
 {
 | 
						|
  if ( $db_Foto_w > $db_Foto_h )
 | 
						|
  {
 | 
						|
	  $db_Foto_h = intval(($db_Foto_h/$db_Foto_w)*$W); $db_Foto_w=$W;
 | 
						|
  } else {
 | 
						|
	  $db_Foto_w = intval(($db_Foto_w/$db_Foto_h)*$H); $db_Foto_h=$H;
 | 
						|
  }
 | 
						|
 }
 | 
						|
}
 | 
						|
 | 
						|
function displayList($cnx, $orderBy, $orderDir, $parent)
 | 
						|
{
 | 
						|
 global $db_Foto_w, $db_Foto_h;
 | 
						|
 $thisLOCATION = "./?dgo=ver_grupo.php";
 | 
						|
 $res = @mysql_query( "SELECT e.id, e.titulo, e.descr, e.Foto_mime, e.Foto_w, e.Foto_h FROM estilos AS e WHERE e.parent='$parent' ORDER BY e.$orderBy $orderDir", $cnx ) OR die( "Error<br>".@mysql_error($cnx) );;
 | 
						|
 | 
						|
 $numBloq = 0;
 | 
						|
 | 
						|
 echo "<STYLE type=text/css>#im {
 | 
						|
        FILTER: alpha(opacity=50)
 | 
						|
        }
 | 
						|
</STYLE>";
 | 
						|
 | 
						|
 echo "<center><table>";
 | 
						|
 while( $datos=@mysql_fetch_array($res) )
 | 
						|
 {
 | 
						|
  list ( $db_id, $db_titulo, $db_descr, $db_Foto_mime, $db_Foto_w, $db_Foto_h )= $datos;
 | 
						|
  
 | 
						|
  $numBloq++;
 | 
						|
 | 
						|
  cambiaProporciones();
 | 
						|
  $lBlq1 = "<a href=\"$thisLOCATION&ide=$db_id\"><img src=\"gimage.php?db=estilos&db_id=$db_id&db_mime=$db_Foto_mime\" width=\"$db_Foto_w\" height=\"$db_Foto_h\"
 | 
						|
border=\"0\" alt=\"".urldecode($db_descr)."\" id=im onmouseover=high(this)
 | 
						|
onmouseout=low(this)><br>$db_titulo</a>"; 
 | 
						|
  
 | 
						|
  if ( $numBloq == 1 )
 | 
						|
   echo "<tr>";  
 | 
						|
 | 
						|
  echo "<td><table class=td_estilos><tr><td>$lBlq1</td></tr></table></td>"; 
 | 
						|
 | 
						|
  if ( $numBloq == 3 )
 | 
						|
   echo "</tr>";
 | 
						|
 }
 | 
						|
 
 | 
						|
 if ($numBloq == 1) echo "<td></td><td></td>";
 | 
						|
 else if ($numBloq==2) echo "<td></td>";
 | 
						|
 | 
						|
 echo "</table></center><hr><br><br><br>";
 | 
						|
}
 | 
						|
 | 
						|
?>
 |