| Regresar a la Página Principal
MOSTRAR MENSAJES DE CONDENA Y CONDOLENCIAS
<%-- crear una conexión con la base de datos --%>
<% int total = -1; %>
SELECT COUNT(cod_mensaje) as TOTAL FROM nuke_mb_mensajes WHERE cod_victima=0 AND fecha > '2004-03-10'
<% if ( pageContext.getAttribute("total") != null ) total= new Integer((String)pageContext.getAttribute("total")).intValue();%>
<% // PAGINACION
int grupo_pagina = 10, grupo = 1, cantidad = 10, inicio = 1, fin = 10;
int paginas = 0, mostrar_desde = 0, mostrar_hasta = 0;
if ( request.getParameter("cantidad") != null && !request.getParameter("cantidad").equals("") ){
cantidad = new Integer( request.getParameter("cantidad") ).intValue();
}
if ( request.getParameter("grupo") != null && !request.getParameter("grupo").equals("") ){
grupo = new Integer( request.getParameter("grupo") ).intValue();
}
//total = 322;//MantDocumento.fromDBCantidad( documento, fecha_desde, fecha_hasta, 1, -1 );
inicio = (grupo - 1) * cantidad + 1;
fin = ( grupo * cantidad > total ) ? total : grupo * cantidad;
paginas = total / cantidad + (( total % cantidad ) > 0 ? 1 : 0);
if ( paginas <= 9 ) {
mostrar_desde = 1; mostrar_hasta = paginas;
} else {
if ( grupo <= 5 ) {
mostrar_desde = 1; mostrar_hasta = 9;
} else if ( grupo >= ( paginas - 4 ) ) {
mostrar_desde = paginas - 8; mostrar_hasta = paginas;
} else {
mostrar_desde = grupo - 4; mostrar_hasta = grupo + 4;
}
}
%>
<% if ( grupo > 1 ){%>
| << |
< |
<%}%>
<% for ( int i = mostrar_desde; i <= mostrar_hasta; i++ ){
if ( i != grupo ){%>
<%=i%> |
<%} else {%>
<%=i%> |
<%}%>
<%}%>
<% if ( grupo < paginas ){%>
> |
>> |
<%}%>
| Total mensajes : <%=total%> |
SELECT nombre, provincia,
fecha, mensaje FROM nuke_mb_mensajes WHERE cod_victima=0 AND fecha > '2004-03-10'
order by fecha DESC LIMIT <%=inicio-1%>, <%=cantidad%>
|
Mensaje enviado por
|
|
|