Foros del Web » Programando para Internet » PHP »

Ayuda con Paginartor

Estas en el tema de Ayuda con Paginartor en el foro de PHP en Foros del Web. 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() ? ...
  #1 (permalink)  
Antiguo 15/10/2009, 16:19
Avatar de Algadar  
Fecha de Ingreso: abril-2009
Mensajes: 115
Antigüedad: 15 años
Puntos: 1
Ayuda con Paginartor

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&eacute;rico</th>
    <th width="210" class="row0" scope="col">Marca</th>
    <th width="120" class="row0" scope="col">C&oacute;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>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</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.
  #2 (permalink)  
Antiguo 15/10/2009, 16:23
 
Fecha de Ingreso: agosto-2009
Ubicación: Al fondo a la derecha
Mensajes: 308
Antigüedad: 14 años, 9 meses
Puntos: 6
Respuesta: Ayuda con Paginartor

qué error te aparece...
__________________
Abre tu mente: Index no signigica index, significa índice
  #3 (permalink)  
Antiguo 16/10/2009, 06:00
Avatar de Algadar  
Fecha de Ingreso: abril-2009
Mensajes: 115
Antigüedad: 15 años
Puntos: 1
Respuesta: Ayuda con Paginartor

Warning: main(/InventarioGME/paginator.inc.php) [function.main]: failed to open stream: No such file or directory in C:\AppServ\www\InventarioGme\Consulta_partesII.php on line 2793

Warning: main() [function.include]: Failed opening '/InventarioGME/paginator.inc.php' for inclusion (include_path='.;c:\php4\pear') in C:\AppServ\www\InventarioGme\Consulta_partesII.php on line 2793

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\InventarioGme\Consulta_partesII.php on line 2793
  #4 (permalink)  
Antiguo 16/10/2009, 10:18
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Ayuda con Paginartor

Revisa que el path al archivo sea el correcto, ya que al parecer no encuentra la clase.

Saludos.
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




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