You are on page 1of 3

Altea Nadine Monje

BSIT 2-2

index.php

<!-- Altea Nadine Monje


BSIT 2-2 -->

<?php
// Include the header
include 'header.php';

// Include the calendar


include 'birthmonth.php';

// Include the footer


require 'footer.php';
?>

birthmonth.php

<table border="5">
<?php
$dayName = ["Su","Mo","Tu","We","Th","F","Sa",];
$dayNums = ["", "", "", "", "", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14",
"15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",];
$firstDay = date('w', strtotime("1 September 2023"));
?>
<tr>
<?php
for ($i = 0; $i < 7; $i++)
{
echo "<th style='background-color: #4eaf68; color: #3B2F2F;'>".$dayName[$i]. "</th>";
}
?>
</tr>
<?php
for ($j = 0; $j < 6; $j++) // display 6 rows
{
echo "<tr>";
for ($i = 0; $i < 7; $i++)
{
$day = $j * 7 + $i - $firstDay + 2; // calculate the day of the month
if ($day < 1 || $day > 30) // display empty cell for days outside of September
{
echo "<td></td>";
}
else if ($day == 17)
{
echo "<td style='background-color: orange; color: #3905a0;'>".$day."</td>";
}
else // display regular cell for other days
{
echo "<td style='background-color: #86bdce; color: #f8f9fc;'>".$day."</td>";
}
}
echo "</tr>";
}
?>
</table>

header.php

<title>BirthMonth</title>
</head>
<style>
body {background-color: #a8a8a8;}
h1 {color: #0e0ecc;}
h2 {color: #000000;}
td, th
{
width: 30px;
height: 30px;
}
td
{
text-align: center;
}
</style>
<body>
<div align="center">
<h1 style='font-size: 50px; font-family: "Comic Sans MF", cursive;' >Birth Month</h1>
<h2 style='font-size: 25px; font-family: "Impact", cursive;' >September</h2>

footer.php

<h3 style='font-size: 12px; font-family: "Harrington", cursive;' >Altea Nadine Monje <br> BSIT 2-2 </h3>
OUTPUT

You might also like