karloncho_20 Posted December 23, 2008 Report Share Posted December 23, 2008 Bueno muchachos aca les dejo en su poder un calendario para que implementen en sus webs saludos! [hide]<html> <head> <title>Calendario</title> <? $anoInicial = '1900'; $anoFinal = '2100'; $funcionTratarFecha = 'document.location = "?dia="+dia+"&mes="+mes+"&ano="+ano;'; ?><script> function tratarFecha(dia,mes,ano){ <?=$funcionTratarFecha?> } </script> <style> .m1 { font-family:MS Sans Serif; font-size:8pt } a { text-decoration:none; color:#000000; } </style> </head> <body> <form><table border="0" cellpadding="5" cellspacing="0" bgcolor="#D4D0C8"> <tr> <td width="100%"> <? $fecha = getdate(time()); if(isset($_GET["dia"]))$dia = $_GET["dia"]; else $dia = $fecha['mday']; if(isset($_GET["mes"]))$mes = $_GET["mes"]; else $mes = $fecha['mon']; if(isset($_GET["ano"]))$ano = $_GET["ano"]; else $ano = $fecha['year']; $fecha = mktime(0,0,0,$mes,$dia,$ano); $fechaInicioMes = mktime(0,0,0,$mes,1,$ano); $fechaInicioMes = date("w",$fechaInicioMes); ?> <select size="1" name="mes" class="m1" onChange="document.location = '?dia=<?=$dia?>&mes=' + document.forms[0].mes.value + '&ano=<?=$ano?>';"> <? $meses = Array ('enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre'); for($i = 1; $i <= 12; $i++){ echo ' <option '; if($mes == $i)echo 'selected '; echo 'value="'.$i.'">'.$meses[$i-1]."\n"; } ?> </select> <select size="1" name="ano" class="m1" onChange="document.location = '?dia=<?=$dia?>&mes=<?=$mes?>&ano=' + document.forms[0].ano.value;"> <? for ($i = $anoInicial; $i <= $anoFinal; $i++){ echo ' <option '; if($ano == $i)echo 'selected '; echo 'value="'.$i.'">'.$i."\n"; } ?> </select><br> <font size="1"> </font><table border="0" cellpadding="2" cellspacing="0" width="100%" class="m1" bgcolor="#FFFFFF" height="100%"> <? $diasSem = Array ('L','M','M','J','V','S','D'); $ultimoDia = date('t',$fecha); $numMes = 0; for ($fila = 0; $fila < 7; $fila++){ echo " <tr>\n"; for ($coln = 0; $coln < 7; $coln++){ $posicion = Array (1,2,3,4,5,6,0); echo ' <td width="14%" height="19"'; if($fila == 0)echo ' bgcolor="#808080"'; if($dia-1 == $numMes)echo ' bgcolor="#0A246A"'; echo " align=\"center\">\n"; echo ' '; if($fila == 0)echo '<font color="#D4D0C8">'.$diasSem[$coln]; elseif(($numMes && $numMes < $ultimoDia) || (!$numMes && $posicion[$coln] == $fechaInicioMes)){ echo '<a href="#" onclick="tratarFecha('.(++$numMes).','.$mes.','.$ano.')">'; if($dia == $numMes)echo '<font color="#FFFFFF">'; echo ($numMes).'</a>'; } echo "</td>\n"; } echo " </tr>\n"; } ?> </table> </td> </tr> </table></form> </body> </html>[/hide] Disfrutenlo modifiquenlo y mejorenlo! Link to comment Share on other sites More sharing options...
shinta_snake Posted December 23, 2008 Report Share Posted December 23, 2008 wena vieja se agradece xD Link to comment Share on other sites More sharing options...
mariofariasa Posted December 23, 2008 Report Share Posted December 23, 2008 amigooo no me funciono, de echo me sale en la pagina cuando la previsualizo: "; ?> '.$meses[$i-1]."\n"; } ?> '.$i."\n"; } ?> \n"; echo ' '; if($fila == 0)echo ''.$diasSem[$coln]; elseif(($numMes && $numMes < $ultimoDia) || (!$numMes && $posicion[$coln] == $fechaInicioMes)){ echo ''; if($dia == $numMes)echo ''; echo ($numMes).''; } echo "\n"; } echo " \n"; } ?> como lo arreglo?? Link to comment Share on other sites More sharing options...
karloncho_20 Posted December 24, 2008 Author Report Share Posted December 24, 2008 no deberia tener problemas a mi me funciona de pelos, y al amigo de mas arriba tambien salduso! Link to comment Share on other sites More sharing options...
keldon Posted December 29, 2008 Report Share Posted December 29, 2008 vale compadre pero no me funco!!! Link to comment Share on other sites More sharing options...
Fitorel Posted December 29, 2008 Report Share Posted December 29, 2008 no pasa na XD Link to comment Share on other sites More sharing options...
decronium Posted January 1, 2009 Report Share Posted January 1, 2009 si funciona, vale socio, se agradece :oky: :magic: :sw: Link to comment Share on other sites More sharing options...
karloncho_20 Posted January 2, 2009 Author Report Share Posted January 2, 2009 recuerden que deben abrir el bloc de notas copiar el codigo y guardarlo como .php y ejecutarlo y eso saludos! Link to comment Share on other sites More sharing options...
Aljacer Posted January 3, 2009 Report Share Posted January 3, 2009 Se agradece....lo probaremos Link to comment Share on other sites More sharing options...
karloncho_20 Posted January 3, 2009 Author Report Share Posted January 3, 2009 Se agradece....lo probaremos no hay de que! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now