Viewing file: listaautores.php (6.19 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html> <head>
<link rel="stylesheet" type="text/css" href="nuevo.css">
<link rel="STYLESHEET" type="text/css" href="estilo.css"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script>
</head> <?php if ($_REQUEST['n']){ include "./indexmenu.php"; if ($_REQUEST["genero"]){ echo "<center><h2>".$_REQUEST['genero']." ".$_REQUEST['subgenero']."</h2></center>"; }else{ echo "<center><h2>Lista de Autores, <b>ordenada alfabeticamente</b></h2></center>"; } }
include "conn.php"; require "./class.datagrid.php"; //echo "<center><h2><b>Selecci�n alfabetica</b></h2>";
$arrayalfabeto=ARRAY("A","B","C","D","E","F","G","H","I","J","K","L","M","N","�","O","P","Q","R","S","T","U","V","W","X","Y","Z"); ?><center><table border=0><tr> <?php foreach ($arrayalfabeto as $key=>$valor){ $valor2=$valor."%";
/* $valor=strtolower($valor); ?><td><a href="listaautoresbis.php?autor=<?php echo utf8_encode('$valor2');?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('<?echo "abecedario_".$valor;?>','','/abecedario/<?echo "abecedario_".$valor.".gif";?>',1)"><img id="<?echo "abecedario_".$valor;?>" class="letra" src="/abecedario/<?echo "abecedario_".$valor.".gif";?>" alt="Orden alfab�tico letra <? echo $valor;?>" /></a></td> */?>
<td bgcolor="#DDE0E1"><a href="listaautoresbis.php?autor= <?php
if (@$_REQUEST['n']){ echo utf8_encode($valor2)."&n=".$_REQUEST['n']; }ELSE{ echo utf8_encode($valor2)."&n="; } ?>"><?echo $valor; ?></a>
<?php } echo "</tr></table>"; echo "<br>"; echo "<h2><b>Selecci�n flexible</b></h2>"; echo "<center>Puede ordenar la lista a su gusto, simplemente pulsando en las cabeceras <B>en negrita</B> ( POR DEFECTO, ORDENADO POR APELLIDO)<br><BR>";
if (@!$_REQUEST['genero']){ $genero="%"; }else{ $genero=$_REQUEST['genero']; } if (@!$_REQUEST['subgenero']){ $subgenero="%"; }else{ $subgenero=$_REQUEST['subgenero']; }
//$query="select distinct(autor) as autores, (select count(*) from libros where autor=autores) as obras from libros where inftp=1"; $query="select distinct(autor) as 'autores', count(*) as obras from libros where libros.inftp=1 group by autor";
$grid = new dataGrid($query,$conn); // bound the function to the rows //$grid->setRowActionFunction("action");
$grid->showColumn("autores"); $grid->showColumn("obras");
$grid->setColumnHTMLProperties("autores", "align=center");
$grid->setDefaultSortColumn("autores"); $grid->enableSorting("autores") ;
//$grid->setRowActionFunction("titulo","action");
$grid->unsetActionFunction("autores"); $grid->unsetActionFunction("obras");
$grid->setActionFunction("autores","abrir_masiva2"); $grid->setActionFunction("obras","abrir_masiva2");
$grid->render();
mysql_close($conn);
/********** function abrir_masiva($value_of_clicked_field, $array_with_the_values_of_all_fields_in_clicked_row) { $enlace= $array_with_the_values_of_all_fields_in_clicked_row["autores"];
echo "<pre>"; echo "----------$value_of_clicked_field<br>"; print_r($array_with_the_values_of_all_fields_in_clicked_row);
if (!empty($enlace)){ $query="select autor,genero,subgenero as tematica,titulo,fecha_subida,tamano,ruta from libros where autor='$enlace'"; $grid2 = new dataGrid($query,$conn);
$grid2->showColumn("autor"); $grid2->showColumn("titulo"); $grid2->showColumn("genero"); $grid2->showColumn("tematica"); $grid2->showColumn("tamano"); $grid2->showColumn("fecha_subida");
$grid2->setColumnHTMLProperties("autor", "align=center"); $grid2->setColumnHTMLProperties("titulo", "align=left"); $grid2->setColumnHTMLProperties("genero", "align=center"); $grid2->setColumnHTMLProperties("tematica", "align=center"); $grid2->setColumnHTMLProperties("tamano", "align=center"); $grid2->setColumnHTMLProperties("fecha_subida", "align=center");
$grid2->setDefaultSortColumn("titulo"); $grid2->enableSorting("autor") ; $grid2->enableSorting("tamano"); $grid2->enableSorting("fecha_subida");
//$grid->setRowActionFunction("titulo","action"); $grid2->unsetActionFunction("titulo"); $grid2->unsetActionFunction("autor"); $grid2->unsetActionFunction("genero"); $grid2->unsetActionFunction("fecha_subida"); $grid2->setActionFunction("titulo","abrir_masiva2"); $grid2->setActionFunction("autor","abrir_masiva2"); $grid2->setActionFunction("genero","abrir_masiva2"); $grid2->setActionFunction("tamano","abrir_masiva2"); $grid2->setActionFunction("fecha_subida","abrir_masiva2");
$grid2->render(); } else{ echo "tralara<br>"; } return; }
*////////////////
function abrir_masiva2($value_of_clicked_field, $array_with_the_values_of_all_fields_in_clicked_row) { @ $enlace="./listaautoresbis.php?autor=". utf8_encode(trim($array_with_the_values_of_all_fields_in_clicked_row['autores']))."&n=".$_REQUEST['n'] ; // print_r($array_with_the_values_of_all_fields_in_clicked_row); //$enlace= $array_with_the_values_of_all_fields_in_clicked_row["ruta"]; //return "location.href='".$enlace."'"; return "javascript:document.location.href='$enlace'"; } ?>
|