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

Hola amigos tengo un listado que me nuestra las noticias por categorias bueno eso es lo que intento haces, tengo un select con la opciones de busqueda pongo buscar pero no me muestra nada me da error
Este es mi listado
Código php:
Ver original
  1. <FORM NAME="selecciona" action="index.php?mod=noticias3&pag=listado_noticia" METHOD="POST">
  2. <P>Mostrar noticias de la categoría:
  3. <SELECT NAME="categoria">
  4.    <OPTION VALUE="Todas" SELECTED>Todas
  5.    <OPTION VALUE="Promociones">Promociones
  6.    <OPTION VALUE="Ofertas">Ofertas
  7.    <OPTION VALUE="Costas">Costas
  8.    <OPTION VALUE="GENERAL">GENERAL
  9. </SELECT>
  10. <INPUT TYPE="submit" NAME="actualizar" VALUE="Actualizar"></P>
  11. </FORM>
  12.  
  13.          <table border="1">
  14.          <tr>
  15.          <th align="center" colspan="7"> Lista de Delegados Deportivos </th>
  16.          </tr>
  17.               <tr>
  18.                 <td>ID</td>
  19.                 <td>titulo</td>
  20.                 <td>texto_Corto</td>
  21.                 <td>Texto Completo </td>
  22.                 <td>estado</td>
  23.                 <td>categoria</td>
  24.                 <td align="center" colspan="2">Opciones</td>
  25.               </tr>
  26.               <?php
  27.                 foreach ($items_noticia1 as $item_noticia1) {
  28.               ?>
  29.               <tr>
  30.                 <td><?php echo $item_noticia1->id ?></td>
  31.                 <td><?php echo $item_noticia1->titulo ?></td>
  32.                 <td><?php echo $item_noticia1->texto_corto ?></td>
  33.                 <td><?php echo $item_noticia1->texto_completo ?></td>
  34.                 <td><?php echo $item_noticia1->estado ?></td>
  35.                 <td><?php echo $item_noticia1->categoria ?></td>
  36.                 <td> <a href="index.php?mod=noticias3&pag=editar&id=<?php echo $item_noticia1->id; ?> "> modificar </a>
  37.                 </td>

Este es mi parte de ctrl donde esta viendo:
Código php:
Ver original
  1. case 'listado_noticia':
  2.         default:
  3.            $categoria = $_POST['categoria'];
  4.            $id = intval($_GET['id']);
  5.                    
  6.                 if(empty($id)){
  7.                     $items_noticia1 = $MOD['noticias']->getNoticia($id);
  8.                 } else {
  9.                     $items_noticia1 = $MOD['noticias']->getNoticia($id);
  10.                 }
  11.                 include('modulos/noticias3/vistas/listado_noticia.html.php');

Y este es mi modulo
Código php:
Ver original
  1. function getNoticia($categoria) {
  2.             global $MOD;
  3.            
  4.             $consulta = $MOD['mysql']->consulta('SELECT * FROM noticias WHERE categoria='.$categoria);
  5.        
  6.             return $consulta;
  7.         }
  8.        
  9.         function getNoticias() {
  10.             global $MOD;
  11.            
  12.             $consulta = $MOD['mysql']->consulta('SELECT * FROM noticias');
  13.        
  14.             return $consulta;
  15.         }

Al hacer clivk en mi boton no me produce nada sigue igual

Última edición por majony; 31/03/2009 a las 10:11 Razón: error de codigo