clase=$pclase; $this->onmouseover=$ponmouseover; $this->onmouseout=$ponmouseout; $this->onclick=$ponclick; $this->nombre_mes[1]=array ("January",0x0001); $this->nombre_mes[2]=array ("February",0x0002); $this->nombre_mes[3]=array ("March",0x0004); $this->nombre_mes[4]=array ("April",0x0008); $this->nombre_mes[5]=array ("May",0x0010); $this->nombre_mes[6]=array ("June",0x0020); $this->nombre_mes[7]=array ("July",0x0040); $this->nombre_mes[8]=array ("August",0x0080); $this->nombre_mes[9]=array ("September",0x0100); $this->nombre_mes[10]=array ("October",0x0200); $this->nombre_mes[11]=array ("November",0x0400); $this->nombre_mes[12]=array ("December",0x0800); $this->nombre_dia[1]=array ("Mo",0x01); // size 1 bytes $this->nombre_dia[2]=array ("Tu",0x02); $this->nombre_dia[3]=array ("We",0x04); $this->nombre_dia[4]=array ("Th",0x08); $this->nombre_dia[5]=array ("Fr",0x10); $this->nombre_dia[6]=array ("Sa",0x20); $this->nombre_dia[7]=array ("Su",0x40); $this->dias_meses[1]=31; $this->dias_meses[2]=28; $this->dias_meses[3]=31; $this->dias_meses[4]=30; $this->dias_meses[5]=31; $this->dias_meses[6]=30; $this->dias_meses[7]=31; $this->dias_meses[8]=31; $this->dias_meses[9]=30; $this->dias_meses[10]=31; $this->dias_meses[11]=30; $this->dias_meses[12]=31; $this->semanas[1]=array ("1ª",0x01); // size 1 bytes $this->semanas[2]=array ("2ª",0x02); $this->semanas[3]=array ("3ª",0x04); $this->semanas[4]=array ("4ª",0x08); $this->semanas[5]=array ("5ª",0x10); $this->semanas[6]=array ("Last",0x20); $this->numero_annos[2010]=0x0001; // size 2 bytes $this->numero_annos[2011]=0x0002; $this->numero_annos[2012]=0x0004; $this->numero_annos[2013]=0x0008; $this->numero_annos[2014]=0x0010; $this->numero_annos[2015]=0x0020; $this->numero_annos[2016]=0x0040; $this->numero_annos[2017]=0x0080; $this->numero_annos[2018]=0x0100; $this->numero_annos[2019]=0x0200; $this->numero_annos[2020]=0x0400; $this->numero_annos[2021]=0x0800; $this->numero_annos[2022]=0x1000; $this->numero_annos[2023]=0x2000; $this->numero_annos[2024]=0x4000; $this->numero_annos[2025]=0x8000; $this->numero_dias[1]=0x00000001; // size 4 bytes $this->numero_dias[2]=0x00000002; $this->numero_dias[3]=0x00000004; $this->numero_dias[4]=0x00000008; $this->numero_dias[5]=0x00000010; $this->numero_dias[6]=0x00000020; $this->numero_dias[7]=0x00000040; $this->numero_dias[8]=0x00000080; $this->numero_dias[9]=0x00000100; $this->numero_dias[10]=0x00000200; $this->numero_dias[11]=0x00000400; $this->numero_dias[12]=0x00000800; $this->numero_dias[13]=0x00001000; $this->numero_dias[14]=0x00002000; $this->numero_dias[15]=0x00004000; $this->numero_dias[16]=0x00008000; $this->numero_dias[17]=0x00010000; $this->numero_dias[18]=0x00020000; $this->numero_dias[19]=0x00040000; $this->numero_dias[20]=0x00080000; $this->numero_dias[21]=0x00100000; $this->numero_dias[22]=0x00200000; $this->numero_dias[23]=0x00400000; $this->numero_dias[24]=0x00800000; $this->numero_dias[25]=0x01000000; $this->numero_dias[26]=0x02000000; $this->numero_dias[27]=0x04000000; $this->numero_dias[28]=0x08000000; $this->numero_dias[29]=0x10000000; $this->numero_dias[30]=0x20000000; $this->numero_dias[31]=0x40000000; $this->numero_dias[32]=0x80000000; $this->numero_horas[1]=array ("0:00", 0x0001); // size 2 bytes $this->numero_horas[2]=array ("1:00", 0x0002); $this->numero_horas[3]=array ("2:00", 0x0004); $this->numero_horas[4]=array ("3:00", 0x0008); $this->numero_horas[5]=array ("4:00", 0x0010); $this->numero_horas[6]=array ("5:00", 0x0020); $this->numero_horas[7]=array ("6:00", 0x0040); $this->numero_horas[8]=array ("7:00", 0x0080); $this->numero_horas[9]=array ("8:00", 0x0100); $this->numero_horas[10]=array ("9:00",0x0200); $this->numero_horas[11]=array ("10:00",0x0400); $this->numero_horas[12]=array ("11:00",0x0800); /* $this->numero_horas[1]=array ("8:00",0x00000001); // size 4 bytes $this->numero_horas[2]=array ("8:30",0x00000002); $this->numero_horas[3]=array ("9:00",0x00000004); $this->numero_horas[4]=array ("9:30",0x00000008); $this->numero_horas[5]=array ("10:00",0x00000010); $this->numero_horas[6]=array ("10:30",0x00000020); $this->numero_horas[7]=array ("11:00",0x00000040); $this->numero_horas[8]=array ("11:30",0x00000080); $this->numero_horas[9]=array ("12:00",0x00000100); $this->numero_horas[10]=array ("12:30",0x00000200); $this->numero_horas[11]=array ("13:00",0x00000400); $this->numero_horas[12]=array ("13:30",0x00000800); $this->numero_horas[13]=array ("14:00",0x00001000); $this->numero_horas[14]=array ("14:30",0x00002000); $this->numero_horas[15]=array ("15:00",0x00004000); $this->numero_horas[16]=array ("15:30",0x00008000); $this->numero_horas[17]=array ("16:00",0x00010000); $this->numero_horas[18]=array ("16:30",0x00020000); $this->numero_horas[19]=array ("17:00",0x00040000); $this->numero_horas[20]=array ("17:30",0x00080000); $this->numero_horas[21]=array ("18:00",0x00100000); $this->numero_horas[22]=array ("18:30",0x00200000); $this->numero_horas[23]=array ("19:00",0x00400000); $this->numero_horas[24]=array ("19:30",0x00800000); $this->numero_horas[25]=array ("20:00",0x01000000); $this->numero_horas[26]=array ("20:30",0x02000000); $this->numero_horas[27]=array ("21:00",0x04000000); $this->numero_horas[28]=array ("21:30",0x08000000); */ } /* ------------------------------------------------------------------------------------------- These function returns true if last year was a leap-year or false if it was not Input parameter: A number representing 1 year ----------------------------------------------------------------------------------------------*/ function bisiesto($anob){ if ($anob%4==0) return(true); else return(false); } /* ------------------------------------------------------------------------------------------- This function returns a string with the HTML code of a years range ----------------------------------------------------------------------------------------------*/ function Annos($ano_desde,$ano_hasta){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal years for ($i=$ano_desde; $i<=ano_hasta; ){ $HTML_calendario.=''.chr(13); } $HTML_calendario.='
Years
'.$this->numero_annos[$i][0].'
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with the HTML code of year and month schedule chosen and they are class properties. ----------------------------------------------------------------------------------------------*/ function MesAnno($mes,$anno){ $fecha="$anno-$mes-1"; $ds=date("N", strtotime($fecha)); if ($ds==0) $ds=7; $swbi=0; // Suma para bisiesto if ($this->bisiesto($anno) && $mes==2) $swbi=1; $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Month name $HTML_calendario.=''.chr(13); for ($i=1;$i<8;$i++) $HTML_calendario.=''.chr(13); // Day of the week $HTML_calendario.=''.chr(13); for ($i=1;$i<$ds;$i++) $HTML_calendario.=''.chr(13); // Filling firsts days of the week $sm=$ds; // Control leap of week for ($i=1;$i<=$this->dias_meses[$mes]+$swbi;$i++){ $HTML_calendario.=''.chr(13); if ($sm%7==0){ $HTML_calendario.=''.chr(13); $sm=0; } $sm++; } $HTML_calendario.='
'.$this->nombre_mes[$mes][0].'
'.$this->nombre_dia[$i][0].'
'.$i.'
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with the HTML code of months of the year in two columns. ----------------------------------------------------------------------------------------------*/ function Meses(){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal meses for ($i=1;$i<13;$i++){ $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); } $HTML_calendario.='
Months
'.$this->nombre_mes[$i++][0].''.$this->nombre_mes[$i][0].'
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with HTML code of days of the week in a row. ----------------------------------------------------------------------------------------------*/ function Dias(){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal Días for ($i=1;$i<8;$i++){ $HTML_calendario.=''.chr(13); } $HTML_calendario.='
Day
'.$this->nombre_dia[$i][0].'
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with HTML code of the weeks sequence in a row. ----------------------------------------------------------------------------------------------*/ function Semanas(){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal Semenas for ($i=1;$i<7;$i++){ $HTML_calendario.=''.chr(13); } $HTML_calendario.='
Week
'.$this->semanas[$i][0].' 
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with HTML code of the 31 days of a month in 3 rows. ----------------------------------------------------------------------------------------------*/ function DiasMes(){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal Día $HTML_calendario.=''.chr(13); $sd=1; // Control salto de fila for ($i=1;$i<32;$i++){ $HTML_calendario.=''.chr(13); if ($sd%8==0){ $HTML_calendario.=''.chr(13); $sd=0; } $sd++; } $HTML_calendario.='
Day of month
'.$i.'
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with HTML code of labs open-time. ----------------------------------------------------------------------------------------------*/ function Horas(){ $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''; $HTML_calendario.=''; $HTML_calendario.=''; //$HTML_calendario.=''; $HTML_calendario.=''.chr(13); for ($i=1;$i<13;$i++) $HTML_calendario.=''.chr(13); $HTML_calendario.=' '.chr(13); $HTML_calendario.=' '.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.='
Time for action performanceModMin.Seg.
'.$this->numero_horas[$i][0].''; $HTML_calendario.= ''.chr(13); $HTML_calendario.=''; $HTML_calendario.=''.chr(13); $HTML_calendario.='
'.chr(13); return($HTML_calendario); } /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This function returns a string with the HTML code of the lab reservations times. ________________________________________________________________________________________________________*/ function HorasReserva($literal,$nombretabla,$nombreampm,$nombreminuto){ if($literal=="1") $literal="Start of the reserve"; else $literal="End of the reserve"; $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''; $HTML_calendario.=''; $HTML_calendario.=''; $HTML_calendario.=''.chr(13); for ($i=1;$i<13;$i++) $HTML_calendario.=''.chr(13); $HTML_calendario.=' '.chr(13); $HTML_calendario.=' '.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.='
'.$literal.' ModMin.
'.$this->numero_horas[$i][0].''; $HTML_calendario.= ''.chr(13); $HTML_calendario.=''; $HTML_calendario.=''.chr(13); $HTML_calendario.='
'.chr(13); return($HTML_calendario); } /* ------------------------------------------------------------------------------------------- This function returns a string with HTML code of labs open-time. ----------------------------------------------------------------------------------------------*/ function Horas_Completas(){ $maxcolumnas=16; $HTML_calendario=''.chr(13); $HTML_calendario.=''.chr(13); $HTML_calendario.=''.chr(13); // Literal Horas $HTML_calendario.=''.chr(13); $currenthora=0; $currentminutos=0; $currenthorario=$currenthora.":".$currentminutos; for ($i=1;$i<97;$i++){ if($currentminutos==0) $currenthorario.="0"; $HTML_calendario.=''.chr(13); $currentminutos+=15; if($currentminutos==60) { $currenthora++; if($currenthora==24) $currenthora=0; $currentminutos=0; } $currenthorario=$currenthora.":".$currentminutos; if ($i%$maxcolumnas==0) $HTML_calendario.=''.chr(13); } $HTML_calendario.='
Horas
'.$currenthorario.'
'.chr(13); return($HTML_calendario); } } // End of Almanaque class