Ver Mensaje Individual
  #59 (permalink)  
Antiguo 30/03/2009, 15:07
Avatar de a83
a83
 
Fecha de Ingreso: noviembre-2005
Ubicación: Santiago de chile
Mensajes: 637
Antigüedad: 19 años, 2 meses
Puntos: 1
no me esta mostrando la infromacion que le pido

tengo problemas al buscar la informcion

me busca pero me muestra todo los reguistros no me los esta calsificando por numero y fechas

Código PHP:
      <?php
     
function cambiaf_a_mysql ($fecha){
     if(
$fecha!='')
      {
     
ereg"([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})"$fecha$mifecha);
           
$lafecha=$mifecha[3]."-".$mifecha[2]."-".$mifecha[1];
             return 
$lafecha;
     }
     else
     {
     return 
false;
     }    
     }
      
$desde=$_POST['Fecha1'];

      
$hasta=$_POST['Fecha'];

      
$Numero=$_POST['Empleado'];

      
$fechas="";

      
$id_opPOST="";
      if(
cambiaf_a_mysql($desde)!=false && cambiaf_a_mysql($hasta)!=false)
      {
      
$fechas="'".cambiaf_a_mysql($desde)."' <= p3.Fecha and p3.Fecha <= '".cambiaf_a_mysql($hasta)."' and ";
      }
      if(
$Numero!='')
      {
      
$id_opPOST="p3.id_op=".$Numero." and ";
      }
      
$desde=cambiaf_a_mysql($Fecha1); 
      
$hasta=cambiaf_a_mysql($Fecha);
     echo 
$consulta ="select p1.Nombre as id_Cliente, p2.Nombre,p3.Fecha as Fecha,p4.Nombre as producto 
     from tblclientes as p1, tblempleados as p2, tbl_op as p3,tblproducto as p4,tblproducciones as p5
     where "
.$fechas." ".$id_opPOST."
     p2.Id_Empleado=p3.Id_Empleado
     and p4.id_Producto=p5.id_Producto
     and p3.id_op=p5.id_op order by p3.Fecha"
;
     
$_SESSION['consultEXCEL']=$consulta;
$resCons=mysql_query($consulta);
echo
"<h2>Empresas Resultantes:</h2>";
$total=0;
while(
$row=mysql_fetch_array($resCons))

{
    echo
"<div class='datos'>
    <b>Nombre</b>: "
.$row['id_Cliente']."<br>
    <b>cantidad</b>: "
.$row['Nombre']."<br>
    <b>Fecha</b>: "
.$row['Fecha']."<br>
    <b>Producto</b>: "
.$row['producto']."<br>

    </div><br>"
;
  
}
?>