el codigo es este
Código PHP:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- TWO STEPS TO INSTALL ANNUAL CALENDAR WITH EVENTS:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<style type="text/css">
body {
background-color : #cccccc;
}
div.hol {
background-color : #ffffff;
cursor:pointer;
}
td.outer {
cellpadding : 1en;
border : solid #666666;
}
table.inner {
background-color : #999999;
font-size : 8pt;
}
.textmes {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
text-decoration: none;
}
.dia {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;
text-decoration: none;
}
DIV.divhelp {
BORDER-RIGHT: black 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: black 1px solid; PADDING-LEFT: 4px; VISIBILITY: hidden; PADDING-BOTTOM: 4px; BORDER-LEFT: black 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: black 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff
}
DIV#helpsample1 {
WIDTH: 100px
}
</style>
<script type="text/javascript">
var months = ["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","novembre","Desembre"];
var daycounts = [31,28,31,30,31,30,31,31,30,31,30,31]; //for leap years, remember to set february to 29 days
// comensament de dies del 2006
var firstdays = [6,2,2,5,0,3,5,1,4,6,2,4];
//2004 firstdays = [3,6,7,3,5,1,3,6,2,4,0,2];
// This is where you put in the appointments. follow pattern [fromday,frommonth,today,tomonth,message]
var apps = [
//[15,3,13,4,"això ha de sortir al març i al abril"],
//[12,6,12,6,"my birthday"],
//[28,8,2,9,"Proba en el calendari"],
//[22,11,22,11,"Party with colleagues"],
[2,6,2,6,"És el meu aniversari"],
[1,1,1,1,"és cap d´any"]
];
function CheckDate(month,dayno)
{
var retval = new String(dayno);
var m = month + 1;
for(var app = 0; app < apps.length; app++)
{
if(m == apps[app][1] ) //first month
{
if(apps[app][3] - apps[app][1] > 0)
{
if(dayno >= apps[app][0])
{
retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";
}
}
else
{
if(dayno >= apps[app][0] && dayno <= apps[app][2])
{
retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";
}
}
}
else if(m == apps[app][3]) // second month
{
if(dayno <= apps[app][2])
{
retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";
}
}
else if( m > apps[app][1] && m < apps[app][3] )
{
retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";
}
}
return retval;
}
function PrintMonth(month)
{
var done = false;
var day = 0;
document.write("<table class='inner'><caption><b><span class='textmes'>" + months[month] + "</span></b></caption><thead>");
document.write("<th><span class='textmes'>Dil</span></th><th><span class='textmes'>Dim</span></th><th><span class='textmes'>Dic</span></th><th><span class='textmes'>Dij</span></th><th><span class='textmes'>Div</span></th><th><span class='textmes'>Dis</span></th><th><span class='textmes'>Diu</span></th></thead>");
while(!done)
{
document.write("<tr>");
PrintWeek(month,day, firstdays[month], daycounts[month]);
document.write("</tr>");
day = day + 7;
if( day > daycounts[month] + firstdays[month])
{
done = true;
}
}
document.write("</tbody></table><p>");
}
function PrintWeek(monthno,start,min,max)
{
var d;
var desc;
for(var j = 0; j < 7; j++)
{
document.write("<td>");
d = start + j;
if(d >= min && d < max + min)
{
desc = CheckDate(monthno,d - min + 1);
document.write(desc);
}
document.write("</td>");
}
}
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY jshelp.init()>
<DIV class=divhelp id=helpsample1><b>prova exemple 1</b><br>Això es la prova per mostrar<br> coses al calendari</b></DIV>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<center><h1>calendari 20<span class="Estilo1">05</span></h1>
</center>
Passa el ratolí per sobre per veure les activitats
<table>
<tr>
<td class="outer">
<script type="text/javascript">
PrintMonth(0);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(1);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(2);
</script>
</td>
</tr>
<tr>
<td class="outer">
<script type="text/javascript">
PrintMonth(3);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(4);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(5);
</script>
</td>
</tr>
<tr>
<td class="outer">
<script type="text/javascript">
PrintMonth(6);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(7);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(8);
</script>
</td>
</tr>
<tr>
<td class="outer">
<script type="text/javascript">
PrintMonth(9);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(10);
</script>
</td>
<td class="outer">
<script type="text/javascript">
PrintMonth(11);
</script>
</td>
</tr>
</table>
<!-- Script Size: 5.48 KB -->
<body>
</body>
</html>
pero lo que passa es que ahora tengo un problema
puedo poner un comentario en los dias que yo quiera pero lo hago de esta manera
Código PHP:
retval = "<div class='hol' title='" + apps[app][4] + "'>" + dayno + "</div>";
he intentado hacerlo con mouse Over llamando otra funciona de otro script pero no me funcion
y no se como hacer para que quando pasen el raton por encima del dia señalado me salga un glovo con lo que yo quiera que salgam, mas bien lo que esta en apps[app][4]
alguien me puede hecar un cable?
gracias