Les muestro el código que tengo:
Código:
<?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;
}
}
if ($_COOKIE['BRM_CODIGO']<>'') {
$BPR_CODIGO=$_COOKIE['BRM_CODIGO'];
$DTM_SERIAL_P=$_COOKIE['DTM_SERIAL_P'];
mysql_select_db($database_Invent_Gme, $Invent_Gme);
if ($BPR_CODIGO<>'99'){
$query_sql_partes = "SELECT mae_parte_equipo.*, BMC_DESCRIPCION,BPR_DESCRIPCION FROM `mae_parte_equipo` INNER JOIN BAS_PERIFERICOS ON `DTM_COD_PERIFERICO`=BPR_CODIGO INNER JOIN BAS_MARCA ON `DTM_MARCA`= BMC_CODIGO WHERE BPR_CODIGO=$BPR_CODIGO AND DTM_SERIAL_P LIKE ('%$DTM_SERIAL_P%') ORDER BY 3";
} else {
$query_sql_partes = "SELECT mae_parte_equipo.*, BMC_DESCRIPCION,BPR_DESCRIPCION FROM `mae_parte_equipo` INNER JOIN BAS_PERIFERICOS ON `DTM_COD_PERIFERICO`=BPR_CODIGO INNER JOIN BAS_MARCA ON `DTM_MARCA`= BMC_CODIGO /*WHERE BPR_CODIGO=$BPR_CODIGO AND DTM_SERIAL_P LIKE ('%$DTM_SERIAL_P%')*/ ORDER BY 3";
}
$sql_partes = mysql_query($query_sql_partes, $Invent_Gme) or die(mysql_error());
$row_sql_partes = mysql_fetch_assoc($sql_partes);
$totalRows_sql_partes = mysql_num_rows($sql_partes);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> </title>
<link href="/InventarioGme/estilos.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php if ($totalRows_sql_partes == 0 && $DTM_SERIAL_P <>'') { // Show if recordset empty ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="row0">
<td height="25">No hay resultados para la consulta realizada</td>
</tr>
</table>
<?php } // Show if recordset empty ?>
<p> </P>
<p>
<?php if ($totalRows_sql_partes > 0 ) { // Show if recordset empty ?>
</p>
<table width="912" border="1">
<tr>
<th width="181" class="row0" scope="col">Serial Parte</th>
<th width="207" class="row0" scope="col">Tipo Periférico</th>
<th width="210" class="row0" scope="col">Marca</th>
<th width="120" class="row0" scope="col">Código equipo</th>
<th width="76" class="row0" scope="col">Empresa</th>
</tr>
<?php do { ?>
<tr>
<td class="row2"><?php echo $row_sql_partes['DTM_SERIAL_P']; ?></td>
<td class="row2"><?php echo $row_sql_partes['BPR_DESCRIPCION']; ?></td>
<td class="row2"><?php echo $row_sql_partes['BMC_DESCRIPCION']; ?></td>
<td class="row2"><?php echo $row_sql_partes['DTM_COD_EQUIPO']; ?></td>
<td class="row2"><?php echo $row_sql_partes['DTM_COD_EMPRESA']; ?></td>
</tr>
<?php } while ($row_sql_partes = mysql_fetch_assoc($sql_partes)); ?>
</table>
<?php } ?>
<p> </p>
<p> </p>
<p> </p>
<?php
//------------- Paginador--------------
$_pagi_sql = $query_sql_partes ;
$_pagi_cuantos = 10 ;
include("/InventarioGME/paginator.inc.php");
while($row = mysql_fetch_array($_pagi_result)){
echo $row['nombre']."<br />";
}
//-------------------------------------
?>
<?php echo"<p>".$_pagi_navegacion."</p>"; ?>
</body>
</html>
<?php if ($totalRows_sql_partes > 0 ) { // Show if recordset empty
mysql_free_result($sql_partes);
}
?>
Soy algo nuevo en esto de la programación Web, encontré lo del paginador en este foro y quise probarlo pero algo estoy haciendo mal y no se que es.
Gracias de antemano.