Ver Mensaje Individual
  #7 (permalink)  
Antiguo 31/03/2009, 14:13
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Que esta mal POO

Nuevamente Gator hice lo que me dijiste pero mi pregunta es ahora esta bien mi funcion que hice
Código php:
Ver original
  1. function getNoticias() {
  2.             global $MOD;
  3.            
  4.             $consulta = $MOD['mysql']->consulta('SELECT * FROM noticias');
  5.        
  6.             return $consulta;
  7.         }
  8.        
  9.         function elegirNoticia($categoria) {
  10.             global $MOD;
  11.            
  12.             $consulta = $MOD['mysql']->consulta("SELECT * FROM noticias WHERE categoria='.$categoria'");
  13.        
  14.             return $consulta;
  15.         }

Bien ahora arregle esto de mi select:
Código html:
Ver original
  1. <center>
  2. <form name="buscar" action="index.php?mod=noticias3&pag=listado_noticia" method="post">
  3.  
  4. <P>Mostrar noticias de la categoría:
  5.    <select name="categoria"> <option value=""> Escoger Lista </option>
  6.    <OPTION VALUE="Todas" > Todas </OPTION>
  7.    <option value="Promociones">Promociones</option>
  8.    <OPTION VALUE="Ofertas">Ofertas</OPTION>
  9.    <OPTION VALUE="Costas">Costas</OPTION>
  10.    <OPTION VALUE="GENERAL">GENERAL</OPTION>
  11. <INPUT TYPE="submit" NAME="actualizar" VALUE="Actualizar"></P>
  12. </FORM>
  13.  
  14.          <table border="1">
  15.          <tr>
  16.          <th align="center" colspan="7"> Lista de Delegados Deportivos </th>
  17.          </tr>
  18.               <tr>
  19.                 <td>ID</td>
  20.                 <td>titulo</td>
  21.                 <td>texto_Corto</td>
  22.                 <td>Texto Completo </td>
  23.                 <td>estado</td>
  24.                 <td>categoria</td>
  25.                 <td align="center" colspan="2">Opciones</td>
  26.               </tr>
  27.               <?php
  28.                 foreach ($items_noticia1 as $item_noticia1) {
  29.               ?>
  30.               <tr>
  31.                 <td><?php echo $item_noticia1->id ?></td>
  32.                 <td><?php echo $item_noticia1->titulo ?></td>
  33.                 <td><?php echo $item_noticia1->texto_corto ?></td>
  34.                 <td><?php echo $item_noticia1->texto_completo ?></td>
  35.                 <td><?php echo $item_noticia1->estado ?></td>
  36.                 <td><?php echo $item_noticia1->categoria ?></td>
  37.                 <td> <a href="index.php?mod=noticias3&pag=editar&id=<?php echo $item_noticia1->id; ?> "> modificar </a>
  38.                 </td>
  39.                 <td>
  40.                     <a href="index.php?mod=noticias3&pag=eliminar&id=<?php echo $item_noticia1->id; ?> ">Eliminar</a>
  41.                 </td>
  42.               </tr>
  43.               <?php
  44.                 }
  45.               ?>
  46.               <tr>
  47.                 <td colspan="7" align="left">Nro de Resultados: <?php echo count($items_noticia1); ?></td>
  48.               </tr>
  49.            
  50.            
  51.               <tr><td colspan="7"   align="center">
  52.             <a href="index.php?mod=noticias3&pag=insertar" >Nuevo</a></td></tr>
  53.            
  54.            
  55.            
  56.             </table>
  57.             </center>

Y en mi controlador hice esto:
Código php:
Ver original
  1. break;
  2.         case 'listado_noticia':
  3.         default:
  4.             var_dump($_POST['categoria']);
  5.             $categoria = $_POST['categoria'];
  6.             $items_noticia1 = $MOD['noticias']->elegirNoticia($categoria);// con esta quiero que me muestre las notcias pero con la categoria que eleji
  7.            
  8.             $items_noticia1 = $MOD['noticias']->getNoticias();// con esta linea me muestra todas las noticias de manera general
  9.             //if(!empty($_SESSION['usuario_id'])&&($_SESSION['usuario_nivel']==3)){
  10.                 include('modulos/noticias3/vistas/listado_noticia.html.php');
Pese a todo esto sigo sin poder ver las notcias que seleciono en mi select no me hace la accion ???