fork download
  1. <html>
  2. <head>
  3. <style>
  4. .with_event {
  5. background-color:red;
  6. }
  7.  
  8. .atual {
  9. background-color:green;
  10. }
  11.  
  12. .dias {
  13. background-color:gray;
  14. padding:5px;
  15. font-size:13px;
  16. font-weight:bold;
  17. position:absolute;
  18. top: -5px;
  19. left: 35px;
  20. }
  21.  
  22. .calen td {
  23. padding:20px;
  24. position:relative;
  25. }
  26.  
  27. </style>
  28. <body>
  29. <table class="calen">
  30. <?php
  31. $dias = Array( "20" => 5, "19"=>1, "13"=>2, "25"=> 1);
  32.  
  33.  
  34. $days = date("t");
  35. $atual = date("d");
  36. $mes_atual = date("m");
  37.  
  38. for ($at = 1; $at < $days; $at++){
  39. if($at%7 == 1){
  40. echo "</tr>";
  41. echo "<tr>";
  42. }
  43. ?>
  44. <td class="calen_td <?=$at==$atual?'atual':''?> <?=isset($dias[$at])?'with_event':''?>" data-dia="<?=$at?>" data-month="<?=$mes_atual?>"><?=$at?>
  45. <?php if (isset($dias[$at])&& $dias[$at]>0) { ?>
  46. <span class="dias"><?=$dias[$at]?></span>
  47. <?php } ?>
  48. </td>
  49. <?php
  50. }
  51. ?>
  52. </tr>
  53. </table>
  54. </body>
  55. </html>
Success #stdin #stdout 0s 83904KB
stdin
Standard input is empty
stdout
<html>
<head>
<style>
.with_event {
	background-color:red;
}

.atual {
	background-color:green;
}

.dias {
	background-color:gray;
	padding:5px;
	font-size:13px;
	font-weight:bold;
	position:absolute;
	top: -5px;
    left: 35px;
}

.calen td {
	padding:20px;
	position:relative;
}

</style>
<body>
<table class="calen">
  </tr><tr>		<td class="calen_td  " data-dia="1" data-month="11">1					</td>
				<td class="calen_td  " data-dia="2" data-month="11">2					</td>
				<td class="calen_td  " data-dia="3" data-month="11">3					</td>
				<td class="calen_td atual " data-dia="4" data-month="11">4					</td>
				<td class="calen_td  " data-dia="5" data-month="11">5					</td>
				<td class="calen_td  " data-dia="6" data-month="11">6					</td>
				<td class="calen_td  " data-dia="7" data-month="11">7					</td>
		</tr><tr>		<td class="calen_td  " data-dia="8" data-month="11">8					</td>
				<td class="calen_td  " data-dia="9" data-month="11">9					</td>
				<td class="calen_td  " data-dia="10" data-month="11">10					</td>
				<td class="calen_td  " data-dia="11" data-month="11">11					</td>
				<td class="calen_td  " data-dia="12" data-month="11">12					</td>
				<td class="calen_td  with_event" data-dia="13" data-month="11">13							<span class="dias">2</span>
					</td>
				<td class="calen_td  " data-dia="14" data-month="11">14					</td>
		</tr><tr>		<td class="calen_td  " data-dia="15" data-month="11">15					</td>
				<td class="calen_td  " data-dia="16" data-month="11">16					</td>
				<td class="calen_td  " data-dia="17" data-month="11">17					</td>
				<td class="calen_td  " data-dia="18" data-month="11">18					</td>
				<td class="calen_td  with_event" data-dia="19" data-month="11">19							<span class="dias">1</span>
					</td>
				<td class="calen_td  with_event" data-dia="20" data-month="11">20							<span class="dias">5</span>
					</td>
				<td class="calen_td  " data-dia="21" data-month="11">21					</td>
		</tr><tr>		<td class="calen_td  " data-dia="22" data-month="11">22					</td>
				<td class="calen_td  " data-dia="23" data-month="11">23					</td>
				<td class="calen_td  " data-dia="24" data-month="11">24					</td>
				<td class="calen_td  with_event" data-dia="25" data-month="11">25							<span class="dias">1</span>
					</td>
				<td class="calen_td  " data-dia="26" data-month="11">26					</td>
				<td class="calen_td  " data-dia="27" data-month="11">27					</td>
				<td class="calen_td  " data-dia="28" data-month="11">28					</td>
		</tr><tr>		<td class="calen_td  " data-dia="29" data-month="11">29					</td>
		</tr>
</table>
</body>
</html>