Foros del Web » Creando para Internet » Herramientas y Software »

paginacion con dreamweaver

Estas en el tema de paginacion con dreamweaver en el foro de Herramientas y Software en Foros del Web. Hola, buenas tardes! Hace horas que estoy con esto y no puedo avanzar, ojala puedan ayudarme. La cuestion es que estoy intentando una pagina con ...
  #1 (permalink)  
Antiguo 11/02/2008, 12:17
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Información paginacion con dreamweaver

Hola, buenas tardes!

Hace horas que estoy con esto y no puedo avanzar, ojala puedan ayudarme.

La cuestion es que estoy intentando una pagina con DW y no me sale de ninguna manera, simplemente no me muestra los datos a partir de la segunda pagina, que es lo que estoy haciendo mal?... este es el codigo

muchas gracias a todos!

<?php require_once('Connections/orbitel.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_rsBuscar = 15;
$pageNum_rsBuscar = 0;
if (isset($_GET['pageNum_rsBuscar'])) {
$pageNum_rsBuscar = $_GET['pageNum_rsBuscar'];
}
$startRow_rsBuscar = $pageNum_rsBuscar * $maxRows_rsBuscar;

$colname_rsBuscar = "-1";
if (isset($_POST['src'])) {
$colname_rsBuscar = $_POST['src'];
}
mysql_select_db($database_orbitel, $orbitel);
$query_rsBuscar = sprintf("SELECT * FROM cdr WHERE src = %s", GetSQLValueString($colname_rsBuscar, "text"));
$query_limit_rsBuscar = sprintf("%s LIMIT %d, %d", $query_rsBuscar, $startRow_rsBuscar, $maxRows_rsBuscar);
$rsBuscar = mysql_query($query_limit_rsBuscar, $orbitel) or die(mysql_error());
$row_rsBuscar = mysql_fetch_assoc($rsBuscar);

if (isset($_GET['totalRows_rsBuscar'])) {
$totalRows_rsBuscar = $_GET['totalRows_rsBuscar'];
} else {
$all_rsBuscar = mysql_query($query_rsBuscar);
$totalRows_rsBuscar = mysql_num_rows($all_rsBuscar);
}
$totalPages_rsBuscar = ceil($totalRows_rsBuscar/$maxRows_rsBuscar)-1;

$queryString_rsBuscar = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rsBuscar") == false &&
stristr($param, "totalRows_rsBuscar") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rsBuscar = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rsBuscar = sprintf("&totalRows_rsBuscar=%d%s", $totalRows_rsBuscar, $queryString_rsBuscar);

/************************************************** **********************************/
/* Devuelve una cadena con la fecha que se le manda como parámetro en formato largo */
/************************************************** **********************************/
function FechaFormateada2($FechaStamp)
{
$ano = date('Y',$FechaStamp);
$mes = date('n',$FechaStamp);
$dia = date('d',$FechaStamp);
$diasemana = date('w',$FechaStamp);

$diassemanaN= array("Domingo","Lunes","Martes","Miércoles","Juev es","Viernes","Sábado"); $mesesN=array(1=>"Enero","Febrero","Marzo","Abril" ,"Mayo","Junio","Julio","Agosto","Septiembre","Oct ubre","Noviembre","Diciembre");
return $diassemanaN[$diasemana].", $dia de ". $mesesN[$mes] ." de $ano";
}

?>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ORBITEL S.A. // Telecomunicaciones // Resultado</title>
<style type="text/css">
<!--
.Estilo4 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;

}

BODY {
SCROLLBAR-FACE-COLOR: #CCCCCC; SCROLLBAR-HIGHLIGHT-COLOR: #D6D3CE;
SCROLLBAR-SHADOW-COLOR: #006699; SCROLLBAR-3DLIGHT-COLOR: #003366;
SCROLLBAR-ARROW-COLOR:#6699CC; SCROLLBAR-TRACK-COLOR:#D8D8D8 ;
SCROLLBAR-DARKSHADOW-COLOR: #003366
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #006699;
}
a:active {
text-decoration: none;
color: #000000;
}
.Estilo16 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #FFFFFF; }
.Estilo17 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #FFFFFF;
font-weight: bold;
}
.Estilo19 {
font-size: 12px;
color: #EEEEEE;
}
.Estilo20 {
color: #003366;
font-weight: bold;
font-size: 14px;
}

-->
</style>
</head>

<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="25" height="25" valign="top"><img src="imagenes/esqArribaIzq.png" width="25" height="25" /></td>
<td width="550" height="25" align="center" valign="middle" bgcolor="#006699" class="Estilo17"><span class="Estilo19">Consumos hasta el
<?php $fecha = time();
echo FechaFormateada2($fecha); ?>
</span></td>
<td width="25" height="25" valign="top"><img src="imagenes/esqArribaDer.png" width="25" height="25" /></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006699">
<tr>
<td width="70" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">ORIGEN</span></td>
<td width="164" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">DESTINO</span></td>
<td width="164" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">INICIO</span></td>
<td width="65" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">TARIFA</span></td>
<td width="65" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">DURACION</span></td>
<td width="65" height="25" align="center" valign="middle" bgcolor="#999999"><span class="Estilo16">COSTO</span></td>
</tr>
</table>
<?php do { ?>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006699">
<tr>
<td width="70" height="30" align="left" valign="middle" bgcolor="#EEEEEE" class="Estilo4">&nbsp;<?php echo $row_rsBuscar['src']; ?></td>
<td width="164" height="30" bgcolor="#EEEEEE" class="Estilo4">&nbsp;
<label><?php echo $row_rsBuscar['dst']; ?></label></td>
<td width="164" bgcolor="#EEEEEE" class="Estilo4">&nbsp;<?php echo $row_rsBuscar['start']; ?></td>
<td width="65" align="right" bgcolor="#EEEEEE" class="Estilo4">$ &nbsp;<?php echo $row_rsBuscar['pvp']; ?>&nbsp;&nbsp;</td>
<td width="65" align="right" bgcolor="#EEEEEE" class="Estilo4">&nbsp;<?php echo $row_rsBuscar['pvp_duration']; ?>&nbsp;&nbsp;</td>
<td width="65" align="right" bgcolor="#EEEEEE" class="Estilo4">$ &nbsp;<?php echo $row_rsBuscar['total_pvp']; ?>&nbsp;&nbsp;</td>
</tr>
</table>
<?php } while ($row_rsBuscar = mysql_fetch_assoc($rsBuscar)); ?><table width="600" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="298" height="30" align="left" valign="bottom" class="Estilo4">&nbsp;
Registros <span class="Estilo20"><?php echo ($startRow_rsBuscar + 1) ?></span> a <span class="Estilo20"><?php echo min($startRow_rsBuscar + $maxRows_rsBuscar, $totalRows_rsBuscar) ?></span> de <span class="Estilo20"><?php echo $totalRows_rsBuscar ?> </span></td>
<td width="299" align="right" valign="bottom" class="Estilo4">&nbsp;
<table border="0">
<tr>
<td><?php if ($pageNum_rsBuscar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsBuscar=%d%s", $currentPage, 0, $queryString_rsBuscar); ?>" class="Estilo4">Primero</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_rsBuscar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsBuscar=%d%s", $currentPage, max(0, $pageNum_rsBuscar - 1), $queryString_rsBuscar); ?>" class="Estilo4">Anterior</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_rsBuscar < $totalPages_rsBuscar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsBuscar=%d%s", $currentPage, min($totalPages_rsBuscar, $pageNum_rsBuscar + 1), $queryString_rsBuscar); ?>" class="Estilo4">Siguiente</a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_rsBuscar < $totalPages_rsBuscar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsBuscar=%d%s", $currentPage, $totalPages_rsBuscar, $queryString_rsBuscar); ?>" class="Estilo4">&Uacute;ltimo</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsBuscar);
?>
  #2 (permalink)  
Antiguo 11/02/2008, 12:22
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Re: paginacion con dreamweaver

tienes un link donde se pueda ver que hace la página?
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #3 (permalink)  
Antiguo 11/02/2008, 12:48
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Re: paginacion con dreamweaver

si, juaniquillo, lo subi en

http://www.colegionet.com.ar/orbitel/buscar.php

el codigo a buscar es 1003

saludos
  #4 (permalink)  
Antiguo 11/02/2008, 14:41
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Re: paginacion con dreamweaver

Yo creo que lo que pasa es que tienes que enviar el POST del primer formulario (el de buscar) cada vez que le das a los links de la paginación porque si no es así el recordset no te devuelve nada. Yo por eso uso GET en vez de POST cada vez que voy a paginar los resultados de una búsqueda.
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #5 (permalink)  
Antiguo 12/02/2008, 05:13
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Re: paginacion con dreamweaver

el formulario buscar.php, tambien lo puse con GET pero el resultado es peor, pues no me trae nada de nada...

http://www.colegionet.com.ar/orbitel/buscarGET.php

el codigo a buscar es 1003

saludos (y gracias por la paciencia)
  #6 (permalink)  
Antiguo 12/02/2008, 07:16
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Re: paginacion con dreamweaver

¿pero hiciste el cambio en el recordset también? tienes que cambiar donde dice:

Código PHP:
 $colname_rsBuscar "-1";
if (isset(
$_POST['src'])) {
  
$colname_rsBuscar $_POST['src'];

por:

Código PHP:
 $colname_rsBuscar "-1";
if (isset(
$_GET['src'])) {
  
$colname_rsBuscar $_GET['src'];

O darle doble click al recordset en el panel de 'Applications' en la pestaña de 'Sever Behabior' y cambiar en la parte del filtro donde dice 'Form Variable' a 'URL Parameter'.
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #7 (permalink)  
Antiguo 12/02/2008, 10:52
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Re: paginacion con dreamweaver

upppppppppppssss... claro que no!!! (IDIOTA DE MI), gracias, y perdon por la tonto del problema, pero no sabes las vueltas que le di... y estaba ahi en mi nariz en lo mas obvio.....

Algo mas (espero no ser demasiado pesado) la ultima columna es (como ya te habras dado cuenta) el costo de la llamada, lo que debería hacer es poner la suma total de esa columna al final de todo (en este caso en la pagina 5) podrias orientarme por donde empezar?

muchas gracias por tu ayuda

saludos
  #8 (permalink)  
Antiguo 12/02/2008, 11:52
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Pregunta Re: paginacion con dreamweaver

con esto logre que me imprima el costo total COMPLETO y no solo el del 1003....

mysql_select_db($database_orbitel, $orbitel);
$query_rsSuma = "SELECT sum(total_pvp) as resultado FROM cdr";
$rsSuma = mysql_query($query_rsSuma, $orbitel) or die(mysql_error());
$row_rsSuma = mysql_fetch_assoc($rsSuma);
$totalRows_rsSuma = mysql_num_rows($rsSuma);

como hago para que, depende el nro que busque, me de el total

saludos
  #9 (permalink)  
Antiguo 12/02/2008, 12:53
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 21 años, 2 meses
Puntos: 0
Re: paginacion con dreamweaver

terminado (al menos por ahora) lo solucione filtrando por usuario.... (definitivamente no es mi dia)

$query_rsSumando = sprintf("SELECT sum(total_pvp) as resultado FROM cdr WHERE src = %s", GetSQLValueString($colname_rsSumando, "text"));

gracias por todo

saludos
  #10 (permalink)  
Antiguo 12/02/2008, 17:32
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Re: paginacion con dreamweaver

Pues que bueno que pudiste resolverlo. Saludos.
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 13:02.