Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/12/2012, 17:36
juan_aalberto
 
Fecha de Ingreso: octubre-2012
Ubicación: Durango
Mensajes: 34
Antigüedad: 11 años, 6 meses
Puntos: 0
Sonrisa Respuesta: problema con método post en menú dinámico

Hola gracias por las respuestas, ya pude solucionar el problema tuve que cambiar algunas cosas pero finalmente aquí esta el código por si a alguien le sirve:

Código PHP:
Ver original
  1. <?php
  2. require("conexion.php");
  3. require("funciones.php");
  4.  
  5. $criterio = getParam($_GET["criterio"], "");
  6. $total = 0;
  7. if ($criterio != "") {
  8.     $query = "SELECT sucursales.nombre_sucursal, opsucursales.depositos, opsucursales.retiros,(@opsucursales.total:[email protected] + opsucursales.depositos - opsucursales.retiros + opsucursales.balance_inicial)balance
  9. FROM opsucursales, sucursales JOIN (SELECT @opsucursales.total:=0) t1 WHERE sucursales.id=opsucursales.sucursale_id and sucursales.nombre_sucursal like ".sqlValue($criterio."%", "text")."";
  10.  
  11.  
  12. $query2 = "SELECT nombre_sucursal, id FROM sucursales ORDER BY id";
  13. $queEmp2 = mysql_query($query2, $conexion);
  14.     $queEmp = mysql_query($query, $conexion);
  15.     $total = mysql_num_rows($queEmp);
  16. }
  17. ?>
  18. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  19. <html xmlns="http://www.w3.org/1999/xhtml">
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  22. <title>prueba 3</title>
  23. <link rel="stylesheet" type="text/css" href="grid.css" />
  24. <link rel="stylesheet" type="text/css" href="components/css/common_style.css" />
  25. <!--<link href="styles.css" rel="stylesheet" type="text/css" />-->
  26. </head>
  27. <body>
  28. <h3>Buscar Sucursal</h3>
  29.  
  30. <form id="frbuscar" name="frbuscar" method="get" action="">
  31.     <input name="criterio" type="text" id="criterio" size="25" value="<?php echo $criterio; ?>" /> &nbsp;
  32.    
  33.     <input type="submit" id="btbuscar" value="Buscar" />
  34. </form>
  35. <?php if ($total > 0) { ?>
  36. <p><em>Total de Resultados: <?php echo $total; ?></em></p>
  37.  
  38. <table>
  39. <tr>
  40.  <th></th>
  41.  </th>
  42.  </tr>
  43. <?php if($rsEmp = mysql_fetch_assoc($queEmp)) { ?>
  44. <tr>
  45. <td>
  46. <h1><?php echo $rsEmp['nombre_sucursal']; ?></h1>
  47.   <?php } ?>
  48. </td>
  49. </tr>
  50.  
  51. <table class="grid"  style="width: "  >
  52.  <thead>
  53.   <tr class="even">
  54.  
  55.   <th class="even" height="35" class="odd row-selector">nombre sucursal</th>
  56.   <th class="even">cargo</th>
  57.   <th class="odd">abono</th>
  58.     <th class="even">balance</th>
  59.    
  60.   </tr>
  61.   </thead>
  62.  
  63.   <tbody>
  64.   <?php while ($rsEmp = mysql_fetch_assoc($queEmp)) { ?>
  65.   <tr>
  66.  
  67.   <td class="even" style="width: 30px;"  ><?php echo $rsEmp['nombre_sucursal']; ?></td>
  68.   <td class="odd" style="width: 30px;"  ><?php echo $rsEmp['depositos']; ?></td>
  69.   <td class="even" style="width: 30px;"  ><?php echo $rsEmp['retiros']; ?></td>
  70.     <td class="odd" style="width: 30px;"  ><?php echo $rsEmp['balance']; ?></td>
  71.    
  72.   </tr>
  73.   <?php } ?>
  74.     </tbody>
  75. </table>
  76. <?php } ?>
  77.  
  78. <p>&nbsp;</p>
  79.  
  80. </body>
  81. </html>

como pueden observar en lugar de un menú puse un buscador y me funciona a la perfección, me hubiera gustado usar un menú dinámico pero pues no se pudo, si alguien me ayudara a utilizar un menú dinámico en lugar del buscador se lo agradecería mucho.
__________________
Intenta no volverte un hombre de éxito, sino volverte un hombre de valor
-----Albert Einstein-----