Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/12/2010, 20:16
moz90
 
Fecha de Ingreso: mayo-2009
Mensajes: 94
Antigüedad: 15 años
Puntos: 0
Pregunta Ayuda, hacer consulta de eventos mediante calendario JSCal2-1.8

Hola amigos foreroros espero me puedan ayudar, estoy haciendo un sistemita que registra eventos (confenferencias,etc), y quiero hacer consultas a estos eventos por fechas a travez de un calendario, eh usado el calendario JSCal2-1.8 que es un calendario bastante bueno y facil de usar.

Lo quiero hacer es que al hacer clcick en determinado dia en el calendario me filtre los datos y me muestre los eventos que se realizaran en determinada fecha, eh logrado haciendolo mediante un boton, pero necesito hacerlo directamente al hacer click en la fecha, plis si alguien pudieran darme una mano se lo agradeceria en grande... este es parte del codigo, por lo que se puede hacer algo con el javascript pero no se mucho:

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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CLINICA - PROGRAMACION </title>
<script src="js/jscal2.js"></script>
<script src="js/lang/es.js"></script>
<link rel="stylesheet" type="text/css" href="css/jscal2.css" />
<link rel="stylesheet" type="text/css" href="css/border-radius.css" />
<link rel="stylesheet" type="text/css" href="css/steel/steel.css" />

</head>

<body>
EVENTOS - CLINICA
<table width="903" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="229" height="909" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="229" height="909">
        
        <div>
        <form action="index2.php" method="post" enctype="multipart/form-data">
      <table>
        <tr>
          <td colspan="4" id="cont"></td>
        </tr>
        <tr>
          <td>
            <input name="date" id="f_date" type="hidden" value="" />
          </td>
          
        </tr>
      </table>
      <input name="Enviar" type="submit" value="--Ver Eventos--" />
  </form>
  <script type="text/javascript">//<![CDATA[

      // this handler is designed to work both for onSelect and onTimeChange
      // events.  It updates the input fields according to what's selected in
      // the calendar.
      function updateFields(cal) {
              var date = cal.selection.get();
              if (date) {
                      date = Calendar.intToDate(date);
                      document.getElementById("f_date").value = Calendar.printDate(date, "%Y-%m-%d");
              }
              
      };

      Calendar.setup({
              cont         : "cont",
              onSelect     : updateFields,
              onTimeChange : updateFields
      });

    //]]></script>
        </div>
                </form>        </td>
      </tr>
      <tr>
    </table>    </td>
    <td width="650" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="674" height="909">   <?php
include("include/config.php");                   
include(
"include/functions.php");
require_once 
'include/PHPPaging.lib.php';
$fecha=$_POST["date"];
if(
$fecha==NULL)
{
$paging = new PHPPaging;
$paging->agregarConsulta("select idev,fechev,lugarev,nombrev,ponent1ev,ponent2ev,ponent3ev,ponent4ev,tipoespecialidad from eventos order by fechev DESC");
}else{
$paging = new PHPPaging;
$paging->agregarConsulta("select idev,fechev,lugarev,nombrev,ponent1ev,ponent2ev,ponent3ev,ponent4ev,tipoespecialidad from eventos where fechev='$fecha' order by fechev DESC");

}
$paging->ejecutar();  
while(
$rows=$paging->fetchResultado()){
$especialidad=$rows["tipoespecialidad"];
$idevento=$rows["idev"];
$fecha=$rows["fechev"];
$ponent1=$rows["ponent1ev"];
$ponent2=$rows["ponent2ev"];
$ponent3=$rows["ponent3ev"];
$ponent4=$rows["ponent4ev"];
include(
"admin/consult1.php");

echo 
"<br>";
echo 
"<div style='background:#FF9'><a href='popup2.php?id=$idevento' onclick=\"popup('popup2.php?id=$idevento'); return false;\">".date('d/m/Y'strtotime($fecha))." <span>".$rows['lugarev']."</a></div><p>".$rows['nombrev']."</p>";
echo 
"<div>";
echo 
"</p>";
}
echo 
"<br>";
echo 
"<div align='left'><span class='Estilo2'><b>Paginas ".$paging->fetchNavegacion()."</b></span></div>";

?></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</body>
</html>

esta es la fuente del calendario: http://www.dynarch.com/projects/calendar/download/1.8/


saludoss