Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/08/2013, 23:03
rcuyan40
 
Fecha de Ingreso: agosto-2013
Mensajes: 6
Antigüedad: 10 años, 9 meses
Puntos: 0
Pregunta Respuesta: Funcion loadXMLDoc Ajax

Gracias por responder quimfv.

Donde me pierdo es donde me indicas que "busca" sera la nueva funcion que lanzara la busqueda a mi base

Este es mi codigo que envia el Post

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">

<
head>

<
title>Calendario</title>
<
script type="text/javascript" src="ajax.js"></script>
<!-- <link rel="stylesheet" type="text/css" href="estilos.css" /> -->
<!-- <META HTTP-EQUIV="REFRESH" CONTENT="2;URL=index.php"> -->

<!-- Calendario-->
    <meta http-equiv="content-language" content="en" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />

    
    <link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1.css" type="text/css" />
    <link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1-adobe_cs3.css" type="text/css" />
    <link rel="stylesheet" media="screen" href="styles/vlaCal-v2.1-apple_widget.css" type="text/css" />
    
    <script type="text/javascript" src="jslib/mootools-1.2-core-compressed.js"></script>
    <script type="text/javascript" src="jslib/vlaCal-v2.1-compressed.js"></script>

    <style>

    input {
        text-align: center;
        font-family: calibri, arial, sans-serif;
        font-size: 13px;
        background-color: white;
        border: 1px solid;
        border-color: #abadb3 #dbdfe6 #e3e9ef #e2e3ea;
        padding: 2px;
    }
    input:focus, input:hover  {
        border-color: #5794bf #b7d5ea #c7e2f1 #c5daed;
    }

    </style>

        <script type="text/javascript">
        window.addEvent('domready', function() { 

            new vlaDatePicker('exampleII', { separator: '-', leadingZero: true, twoDigitYear: false, offset: { y: 3 }, alignX: 'center', alignY: 'bottom', format: 'y/m/d' });
        
        });    
        </script>
</head>
<body>

<center>    
<h1>
    <b>Prototipo I - Calendario</b>
</h1>



Feha<input id="exampleII" name="date" type="text" style="width: 80px;" maxlength="10" onBlur="busca(this.value)" onkeyup="loadXMLDoc()" required />
</br></br>
    <style>

    margin-top: 10px;
    border-style:dashed;
    width: 500px;
    height: 500px;
    background-color:#F0FFF0;
    text-align: left;
    color:#00008B;
    padding:10px 10px;

    </style>
    
<div id="myDiv"></div>
</center>

</body>
</html> 
El Post que recibe y query
Código PHP:
<?php

include 'conexion.php';

$variable_post=$_POST['variable_post'];
$conexion_db=conexion();

$query_fecha="select  alumno.nombre as alumno, fecha.fecha as fecha, hora.hora as hora, profesor.nombre as profesor from alumno, fecha, hora, hofeproal, profesor where hofeproal.idalumno = alumno.idalumno and hofeproal.idfecha = fecha.idfecha and hofeproal.idhora = hora.idhora and hofeproal.idprofesor = profesor.idprofesor and fecha.fecha LIKE '".$variable_post."%'";
$datos_fecha=mysql_query($query_fecha,$conexion_db);
$fila_db mysql_fetch_assoc($datos_fecha);
$total_fecha mysql_num_rows($datos_fecha);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Horario</title>
    <link rel="stylesheet" type="text/css" href="../style/style.css"/>
    <!-- <META HTTP-EQUIV="REFRESH" CONTENT="2;URL=index.php"> -->
</head>
<body>
    <table border="1" >
        <tr>
            <td>Alumno</td>
            <td>Fecha</td>
            <td>Horario</td>
            <td>Profesor</td>
        </tr>
<?php do { ?>    
        <tr>    
            <td><?php echo $fila_db['alumno'];?></td>
            <td><?php echo $fila_db['fecha'];?></td>
            <td><?php echo $fila_db['hora'];?></td>
            <td><?php echo $fila_db['profesor'];?></td>
        </tr>
<?php } while($fila_db=mysql_fetch_assoc($datos_fecha)) ?>
    </table>
    </body>
    </html>
Si pueden hecharme otra manita