Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/02/2008, 12:17
idelatorre
 
Fecha de Ingreso: febrero-2003
Mensajes: 37
Antigüedad: 22 años
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);
?>