print("<h2>Listing $count documents</h2></td>\n");
print("<table id=\"files_list\">");
print("<tr>\n");
//printf("<th></th>\n");
printf("<th><a href=\"list.php?order=%s\">Sel.</a></th>\n", ($order == "id DESC" ) ? "id%20ASC" : "id%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Tipo</a></th>\n", ($order == "type DESC" ) ? "type%20ASC" : "type%20DESC" );
//printf("<th><a href=\"list.php?order=%s\">Filename</a></th>\n", ($order == "name DESC" ) ? "name%20ASC" : "name%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Documento</a></th>\n", ($order == "name DESC" ) ? "name%20ASC" : "name%20DESC" );
//printf("<th><a href=\"list.php?order=%s\">Size</a></th>\n", ($order == "size DESC" ) ? "size%20ASC" : "size%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Tamaño</a></th>\n", ($order == "size DESC" ) ? "size%20ASC" : "size%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Rev</a></th>\n", ($order == "revision DESC" ) ? "revision%20ASC" : "revision%20DESC" );
//printf("<th><a href=\"list.php?order=%s\">Author</a></th>\n", ($order == "author DESC" ) ? "author%20ASC" : "author%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Autor</a></th>\n", ($order == "author DESC" ) ? "author%20ASC" : "author%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Maintainer</a></th>\n", ($order == "maintainer DESC" ) ? "maintainer%20ASC" : "maintainer%20DESC" );
//printf("<th><a href=\"list.php?order=%s\">Created</a></th>\n", ($order == "cdate DESC" ) ? "cdate%20ASC" : "cdate%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Fecha de Creación</a></th>\n", ($order == "cdate DESC" ) ? "cdate%20ASC" : "cdate%20DESC" );
//printf("<th><a href=\"list.php?order=%s\">Modified</a></th>\n", ($order == "mdate DESC" ) ? "mdate%20ASC" : "mdate%20DESC" );
printf("<th><a href=\"list.php?order=%s\">Ultima Modificación</a></th>\n", ($order == "mdate DESC" ) ? "mdate%20ASC" : "mdate%20DESC" );
printf("<th></th>\n");
print("</tr>\n");
while($row = @mysql_fetch_array($res)) {
print("<tr>\n");
print ("<td><input type='checkbox' value='$row[id]'></td>\n");
//print("<td>$row[id]</td>\n"); //prueba exitosa de id por Oscar
print("<td><a href=\"download.php?doc_id=$row[id]\"><img src=\"pix/". get_extension($row[name]) .".gif\" height=\"16\" width=\"16\" alt=\"[". strtoupper(get_extension($row[name])) ."]\" border=\"0\"></a></td>\n");
print("<td><a href=\"detail.php?doc_id=$row[id]\">$row[name]</a></td>\n");
if($row[size] < 0)
continue;
if( $row[size] < 10240 ) {
$size_str = sprintf("%d bytes", $row[size]);
} else if( $row[size] < 1048576 ) {
$size_str = sprintf("%.1f Kb", ($row[size]/1024));
} else {
$size_str = sprintf("%.1f Mb", ($row[size])/(1024*1024));
}
print("<td>$size_str</td>\n");
print("<td>$row[revision]</td>\n");
print("<td>$row[author]</td>\n");
print("<td>$row[maintainer]</td>\n");
print("<td>$row[created]</td>\n");
printf("<td%s</td>\n", ($row[modified] == NULL) ? " align=\"center\">-" : ">$row[modified]" );
printf("<td><img src=\"pix/%s.gif\" height=\"15\" width=\"15\" alt=\"[ Access: %s ]\"></td>\n", ($row[level] == NULL) ? "G" : $row[level], access_string( ($row[level] == NULL) ? "G" : $row[level] ) );
print("</tr>\n");
}
}
|