Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/11/2004, 21:13
apañero
 
Fecha de Ingreso: abril-2004
Mensajes: 310
Antigüedad: 20 años
Puntos: 0
puf funciona perfecto en la página de prueba, el tema es que la cosa de prueba la puse como referencia, para luego yo cambiar lo poco que fuera, no esperaba un código nuevo... Vaya artista estás hecho jeje. La página de prueba es el resultado de un script en php, si aplico tal cual ese javascript al script en php no funciona porque el script en php es más complejo que esa página de prueba. Fue bonito en la página de prueba XD

Te pongo la función principal en php que se encarga de pintar el calendario con los eventos diarios (los eventos estan guardados en un txt)

Código:
function drawTable ($yr, $mn)
{

    global $PHP_SELF, $mouse_over_effect;
    global $Sun,$Mon,$Tue,$Wed,$Thu,$Fri, $Sat, $first_day_monday;  
    
    $entries = $this->getDaysInMonth ($yr, $mn);
    $firstSq = $this->getFirstDayInMonth ($yr, $mn);

    $arr_dates = array();
    $arr_priority = array();

    $this->getEntryArray($yr, $mn, $arr_dates, $arr_priority);
    
    
    echo "<table class='calendarTable' cellspacing='0' cellpadding='0' border='1' bordercolor='#111111' align='center'>\n";
    echo "<tr class='calendarRow'>\n";
    if ($first_day_monday)
	 {
       echo "<td class='weekheader'><b>$Mon</b></td>\n";
       echo"<td class='weekheader'><b>$Tue</b></td>\n";
       echo "<td class='weekheader'><b>$Wed</b></td>\n";
       echo "<td class='weekheader'><b>$Thu</b></td>\n";
       echo"<td class='weekheader'><b>$Fri</b></td>\n";
       echo"<td class='weekheader'><b>$Sat</b></td>\n";
	    echo "<td  class='weekheader'><b>$Sun</b></td>\n";
	 }
	 else
	 {
	    echo "<td  class='weekheader'><b>$Sun</b></td>\n";
	    echo "<td class='weekheader'><b>$Mon</b></td>\n";
       echo"<td class='weekheader'><b>$Tue</b></td>\n";
       echo "<td class='weekheader'><b>$Wed</b></td>\n";
       echo "<td class='weekheader'><b>$Thu</b></td>\n";
       echo"<td class='weekheader'><b>$Fri</b></td>\n";
       echo"<td class='weekheader'><b>$Sat</b></td>\n";
	    
	 }
    echo "</tr>\n";
    // some of the first sqaures may be blank i.e if month doesn't
    // start on Sunday. so use $count to determine if square is blank
    $day_date= $first_day_monday -  $firstSq ;
               
    for ($theRow=0; $theRow<6; $theRow++)
    {
        echo "<tr class='calendarRow'>\n";
        for ($theCol=0; $theCol<7; $theCol++)
        {
            $textEntry = "";
            $day_date++;
            if ($day_date<  1 || $day_date> $entries)
            {
                echo " <td class ='emptydate'><div align='center'>-</div></td>\n";
                continue;
            }
            else
            {
                // see if there is an entry for this date and if there is
                // get the index of the array holding that date info
                $found = false;
                $found_index = 0;
                for ($j = 0; $j< count($arr_dates); $j++)
                {
                   if (intval ($arr_dates[$j]) == $day_date)
                   {
                      $found = true;
                      $found_index = $j;
                   }
                }

            }

            $ind = 0;
            if (!$found)
            {
                echo "<td align='center' class ='emptydate'>\n";
            }
            else
            {
                $ind = $arr_priority[$found_index];
                echo "<td align='center' class='filledColor$ind'>\n";
                         
                if ($mouse_over_effect)
                {                    
                    $textEntry =  $this->showUserDayEvent($yr, $mn, $day_date, $pri);
                                       
                    $textEntry = str_replace( "\"", "&quot;",$textEntry);
                    $textEntry = str_replace( "'", "&rsquo;",$textEntry);
                    $textEntry = str_replace( "\r\n", "&nbsp;",$textEntry);                   
                    
                }

                
            }

            if (strlen($textEntry))
            {
               echo "<a target='principal' href = '#' onClick=\";return false\" onMouseover=\"showtip(this,event,'$textEntry');return false\" onMouseOut=\"hidetip()\">$day_date</a>";
            }
            else 
            {
                 echo "$day_date";
            }
           
            echo "</td>\n";
        }
        echo "</tr>\n";
    }
    echo "</table>";
   

   $this->show_colour_codes();
  }
Espero que esto no fastidie tu perfecto trabajo, a ver si puedes readaptarlo. Si te falta alguna funcion o cosa por saber aquí me tienes XD

muchas gracias por todo