Foros del Web » Programando para Internet » Javascript »

Ayuda con funciones .js y php

Estas en el tema de Ayuda con funciones .js y php en el foro de Javascript en Foros del Web. Hola buenas tardes bueno comento que apenas estoy iniciando con php,javascript y ajax, y necesito algo de ayuda con lagunas funciones. el caso es que ...
  #1 (permalink)  
Antiguo 26/10/2010, 15:29
 
Fecha de Ingreso: octubre-2010
Mensajes: 53
Antigüedad: 13 años, 5 meses
Puntos: 0
Información Ayuda con funciones .js y php

Hola buenas tardes bueno comento que apenas estoy iniciando con php,javascript y ajax, y necesito algo de ayuda con lagunas funciones. el caso es que e creado un archivo reporte.php en el cua contengo estas funciones
Código PHP:
function filtro_fecha($filtro_sel)
      {
       
$argumento explode("@"$filtro_sel);
      
       
       
$argumento[0] = FormatoFecha($argumento[0]);
       
$argumento[1] = FormatoFecha($argumento[1]);
     
       
$consulta "SELECT (aqui la consulta ) as total_monto 
       FROM (nombre tablas) WHERE (condiciones )
       AND '"
$argumento[0] . "' >= fechatr::DATE AND '".$argumento[0]."' <= fechatr::DATE AND '"$argumento[1] . "' >= fechatr::DATE AND '".$argumento[1]."' <= fechatr::DATE  
       GROUP BY fechatr::DATE,nombre ORDER BY fechatr::DATE DESC"
;
       
$idConexion pg_connect($_SESSION['db_conection']);       
       
$listado pg_query($consulta) or die(pg_last_error($idConexion));
        
       
      
$strTitulo "Reporte";
      return 
reporte$listado$strTitulo );
    }
    
     function 
FormatoFecha($Fecha)
    {
        
$Fecha substr($Fecha,6,4)."-".substr($Fecha,3,2)."-".substr($Fecha,0,2);
        return 
$Fecha;
            
    }
  
    function 
reporte($listado$strTitulo )
    {
        
$salida "<div style=\"border: solid 0px black; height: 445px; overflow: auto; background-color: #BDCDDB;\">";
       
$salida .= "<br/><table id=\"ilumi\" width=\"70%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"table-layout: ;\">
                                            <tr>
                                                <td valign=\"top\">
                                                     <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" class=\"Header\">
                                                        <tr>
                                                             <td class=\"HeaderLeft\"></td> 
                                                                <th>$strTitulo</th>
                                                             <td class=\"HeaderRight\"></td> 
                                                        </tr>
                                                     </table>"
;
                                                     
       
$salida .= '<table class="Grid" >';
       if ( 
$listado ){
           
$NumRegistro pg_num_rows$listado );
                if (
$NumRegistro 0)
                {
                   
$salida .=' <table class="Grid" cellspacing="\" cellpadding="" style="empty-cells: show;">
                                                                    <tr class="Caption">
                                                                        <th width="100">Tienda</th>
                                                                        <th width="100">fecha</th>
                                                                        <th width="100">Monto</th>                                                                       
                                                                    </tr>
                                                                </table>'
;
                    
                    
$salida .= "<div style=\"border: solid 0px black; height: 387px; overflow: auto; background-color:#BDCDDB;\">";
        
                    
$salida .= "<table width=\"70%\"  class=\"Grid\" cellspacing=\"\" cellpadding=\"\" style=\"empty-cells: show;\"> ";
                    
$salida .= '<tr class="Row">';
                    
                    while(
$row pg_fetch_assoc$listado ) )
                    {                                                       
                          
$salida .= '<tr class="Row">';
                                                                                                                                       
                                    
//NOMBRE    
                                    
if (!empty($row["nombre"]))          
                                    
$salida .= '<td width="100" style="text-align:right;">'.$row["nombre"].'</td>'
                                    else
                                    
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';
                                                                        
                                    
//FECHA    
                                    
if (!empty($row["fechatr"]))
                                    {
                                        
$salida .= '<td width="100" style="text-align:right; background-color: #f7f7f7;">'.$row["fechatr"].'</td>';
                                    }
                                    else
                                    
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';
                                                                            
                                    
//MONTO 
                                    
if (!empty($row["total_monto"]))     
                                    
$salida .= '<td width="100" style="text-align:right;">'.$row["total_monto"].'</td>';
                                    else
                                    
$salida .= '<td width="100" style="text-align:right;"><font color="#f7f7f7">.</font></td>';                                                                        
                                    
$salida .= '</tr>'."\n";
                          }  
//FIN WHILE
                                                                
                          
$salida .= '</tr>'."\n"
                     return 
$salida;          
                }
                    
            }
              
        }   
         
        
     
//$sajax_request_type = "GET";      
sajax_init();
sajax_export("filtro_fecha");
sajax_handle_client_request();
?> 
tengo otro archivo js con estas funciones

Código HTML:
function filtra_fecha(){
        
        var sel_fecha_ini = document.getElementById("fechaInicial").value;
        var sel_fecha_fin = document.getElementById("fechaFinal").value;
        
        alert(document.getElementById("fechaInicial").value + "@" + document.getElementById("fechaFinal").value );
            x_filtro_fecha(document.getElementById("fechaInicial").value + "@" + document.getElementById("fechaFinal").value, contenedorFiltro3 );
    }
    
    
     function contenedorFiltro3( respuesta ){
        alert("respuesta preparada");
        document.getElementById("x_salida").innerHTML = respuesta; 
    }
y en mi archivo del formulario tengo un boton

<input name="{Button_Name}" type="submit" value="Entrar" class="Button" onclick="filtra_fecha();">


el caso es que corre todo bien el problema surge a lo ultimo ya no ejecuta la funcion contenedorfiltro3

y aparese el siguente error

session (aqui trae varios numeros creo que es el id de la session ) is just finished there is another session in the background
do you want IDE to switch to this session?

aque se debe ayudenme me urge

Etiquetas: funciones, js, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:42.