fork(1) 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. .calen td {
  13. padding:20px;
  14. }
  15.  
  16. </style>
  17. <body>
  18. <table class="calen">
  19. <?php
  20. $dias = Array( "20" => 5, "19"=>1, "13"=>2, "25"=> 1);
  21.  
  22. $mes_atual = date("m");
  23. $days = date("t");
  24. $atual = date("d");
  25.  
  26. for ($at = 1; $at <= $days; $at++){
  27. if($at%7 == 1){
  28. echo "</tr>";
  29. echo "<tr>";
  30. }
  31. ?>
  32. <td class="calen_td <?=$at==$atual?'atual':''?> <?=isset($dias[$at])?'with_event':''?>" data-dia="<?=$at?>" data-month="<?=$mes_atual?>"><?=$at; ?></td>
  33. <?php
  34. }
  35. ?>
  36. </tr>
  37. </table>
  38. </body>
  39. </html>
Success #stdin #stdout 0s 83904KB
stdin
Standard input is empty
stdout
<html>
<head>
<style>
.with_event {
	background-color:red;
}

.atual {
	background-color:green;
}

.calen td {
	padding:20px;
}

</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</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</td>
				<td class="calen_td  with_event" data-dia="20" data-month="11">20</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</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>
				<td class="calen_td  " data-dia="30" data-month="11">30</td>
		</tr>
</table>
</body>
</html>