Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/03/2006, 12:40
Lolilla
 
Fecha de Ingreso: marzo-2005
Mensajes: 21
Antigüedad: 19 años, 1 mes
Puntos: 0
Jpinedo ha hecho un gran trabajo con el Paginator, muy facil de seguir y con muchas explicaciones para poderlo entender e instalar.

Mi problema es que lo estoy intentando instalar dentro de un script que he sacado de hotscripts.com.

Cada uno de los scripts por su parte funciona bien. Pero cuando intento hacerlos funcionar juntos, es cuando tengo el problema.

El script en cuestión es para seleccionar los registros de mi base de datos en función de la primera letra de uno de los campos, de la A a la Z.

A continuación pongo el código del script por si alguien me puede echar una mano.

Código PHP:
<?php
        
require("src/connect.php");
               
        
$_pagi_sql "select Nombre,Composicion,Presentacion,Fabricante,Familia,PrecioVenta from producto,fabricante,familia where producto.Nombre like '".$_POST["hSort"]."%' and fabricante.IdFabricante=producto.IdFabricante and familia.IdFamilia=Producto.IdFamilia order by producto.Nombre";
        
$_pagi_cuantos=10;
        
        
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Lista de Precios;</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../CSS/stylesheet.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="800" border="0" align="center" class="brdr">



  <tr> 
    <td colspan="2" align="center" class="titulo" height="30">Lista de Precios</td>
  </tr>
  
  <tr> 
    <td colspan="2" class="separador"><hr size="1"></td>
  </tr>
  <tr> 
    <td colspan="2" align="center" valign="top" class="letras"> 
      <?
          
for($i=0;$i<=25;$i++)
          {
?>
      <a href="#" onClick="return submitForm(document.frmContact,'<?=chr(65+$i);?>','Sorting');"> 
      <? echo(chr(65+$i)." ");?></a> 
      <? ?>
      
    <?php include("paginator.inc.php");    ?> 
     
  </tr>
  <tr> 
    <td colspan="2" class="separador"><hr size="1"></td>
  </tr>
  <tr> 
    <td colspan="2" valign="top" class="lista"> <form action="" method="post" name="frmContact" id="frmContact">
        <table width="100%" border="0" cellspacing="0">
          <tr> 
            <td width="18%" class="titulo_lista">Nombre</td>
            <td width="30%" class="titulo_lista">Composición</td>
            <td width="17%" class="titulo_lista">Presentación</td>
            <td width="10%" class="titulo_lista">Fabricante</td>
            <td width="17%" align="center" class="titulo_lista">Familia</td>
            <td width="8%" align="center" class="titulo_lista">Precio</td>
          </tr>
          <tr> 
            <td colspan="6" class="separador"><hr size="1"></td>
          </tr>
          <? while($row=mysql_fetch_array($_pagi_result)){ ?>
          <tr> 
            <td width="18%" class="lista"> 
              <?=$row["Nombre"];?>
            </td>
            <td width="30%" class="lista"> 
              
              <?=$row["Composicion"];?> 
            </td>
            <td width="17%" class="lista">
              <?=$row["Presentacion"];?>
            </td>
            <td width="10%" class="lista">
              <?=$row["Fabricante"];?>
            </td>
            <td width="17%" align="center" class="lista">
              <?=$row["Familia"];?>
            </td>
            <td width="8%" align="center" class="lista">
              <?=$row["PrecioVenta"];?>
            </td>
          </tr>
               
          <? ?>
        </table>
        <input type="hidden" name="hABId" id="hABId">
        <input type="hidden" name="hSort" id="hSort" value="[A-Z]">
        <input type="hidden" name="hExtra" id="hExtra" value="">
      </form>
      <script language="JavaScript">
        function submitForm(obj,myVal,actionStr)
        {
                obj.hABId.value=myVal;
                        if(actionStr=='Sorting')
                        {
                                actionStr = ".";
                                obj.hSort.value=myVal;
                        }
                        if(actionStr=='Delete')
                        {
                                if(!confirm("Are you sure want to Delete This Contact?\n\rAll information about This Contact will be lost.\n\rPlease click 'OK' if you are sure. Else click 'Cancel'."))
                                {
                                        return false;
                                }
                                actionStr = ".";
                                obj.hSort.value="";
                                obj.hExtra.value="Delete";
                        }
            obj.action=actionStr;
            obj.submit();
        }
    </script> </td>
  </tr>
</table>
<table width="800">
  <tr>
    <td align="right" valign="bottom" height="50"><?php echo"<p>".$_pagi_navegacion."<p>"?>
    </td>
  </tr>
</table>
</body>
</html>
¿Puede alguien ayudarme?

salu2