PHP Classes

PHP Holidays for Family Members Class: Get the holiday dates of the Mother, Father, etc.

Recommend this page to a friend!
  Info   Example   Demos   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 63 All time: 10,431 This week: 660Up
Version License PHP version Categories
fday-class 0.1GNU General Publi...5PHP 5, Time and Date
Description 

Author

This package can get the holiday dates of the mother, father, etc...

It can compute the dates of the holiday's dates of family members like Mothers' Day, Father's Day, Grandmothers' Day, and Grandfather's for a given year.

The class can also check if today is any of those holiday dates.

Innovation Award
PHP Programming Innovation award nominee
April 2023
Number 11
Several types of holidays may be exceptional because they celebrate the lives of unique members of each family. That is the case of Mother's Day, Father's Day, Grandmother's Day, and Grandfather's Day.

The exact date of these holidays may change year after year.

This class can perform calculations to determine the dates of those holidays.

Manuel Lemos
Picture of Pierre FAUQUE
  Performance   Level  
Name: Pierre FAUQUE <contact>
Classes: 18 packages by
Country: France France
Age: 78
All time rank: 15212 in France France
Week rank: 69 Up6 in France France Up
Innovation award
Innovation award
Nominee: 12x

Winner: 1x

Example

<?php
require("class.fday.php");
if(isset(
$_POST["submit"])) { $year = $_POST["year"]; } else { $year = ""; }
$fd = new fday($year);
?><!DOCTYPE html>
<html>

<head>

  <meta name="author" content="Pierre FAUQUE, pierre@fauque.net">
  <title>Test: class.fday.php</title>

  <style type="text/css">
    body { margin-left:2em; margin-top:2em; }
    .c1 { padding-left:6px; padding-right:6px; border:1px solid grey; }
    .c2 { padding-left:6px; padding-right:6px; border:1px solid grey; border-left:0; }
    .c3 { padding-left:6px; padding-right:6px; border:1px solid grey; border-top:0; }
    .c4 { padding-left:6px; padding-right:6px; border:1px solid grey; border-top:0; border-left:0; }
  </style>

  <script language="javascript" type="text/javascript">
  function verif() {
      var n;
      var authorizedchar = "0123456789";
      var year = document.fday.year.value;
      if(year.length != 0 && year.length != 4) {
          alert('The year must be written with four digits');
          document.fday.year.value = "";
          document.fday.year.focus();
          return false;
      }
      for(n=0; n<4; n++) {
          if(authorizedchar.indexOf(year.substring(n,n+1)) < 0) {
              alert('The year must only be written with digits');
              document.fday.year.value = "";
             document.fday.year.focus();
              return false;
          }
      }
      return true;
  }
  </script>

</head>

<body>



<form name="fday" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" onsubmit="return verif()">
Year : <input type="text" name="year" size="4" placeholder="<?php echo date("Y"); ?>">
<input type="submit" name="submit" value="OK">

<?php if(isset($_POST["submit"])) { ?>

<p><?php if(!$year) { echo "<h1>".date("Y")."</h1>"; } else { echo "<h1>$year</h1>"; } ?></p>

<table cellspacing="0">
  <tr><td class="c1">Mother day</td><td class="c2"><?php echo $fd->md; ?></td></tr>
  <tr><td class="c3">Father day</td><td class="c4"><?php echo $fd->fd; ?></td></tr>
  <tr><td class="c3">Grandmother day</td><td class="c4"><?php echo $fd->gmd; ?></td></tr>
  <tr><td class="c3">Grandfather day</td><td class="c4"><?php echo $fd->gfd; ?></td></tr>
</table>

<br/>

<table cellspacing="0">
  <tr>
    <td class="c1">Easter</td>
    <td class="c2"><?php echo $fd->easter; ?></td>
  </tr><tr>
    <td class="c3">Whitsun</td>
    <td class="c4"><?php echo $fd->wsun; ?></td>
  </tr><tr>
    <td class="c3">Today</td>
    <td class="c4"><b><?php echo $fd->today; ?></b></td>
  </tr><tr>
    <td class="c3">Is today the mother day ?</td>
    <td class="c4"><?php if($fd->ismd()) { echo "Yes"; } else { echo "No"; } ?></td>
  </tr><tr>
    <td class="c3">Is today the father day ?</td>
    <td class="c4"><?php if($fd->isfd()) { echo "Yes"; } else { echo "No"; } ?></td>
  </tr><tr>
    <td class="c3">Is today the grandmother day ?</td>
    <td class="c4"><?php if($fd->isgmd()) { echo "Yes"; } else { echo "No"; } ?></td>
  </tr><tr>
    <td class="c3">Is today the grandfather day ?</td>
    <td class="c4"><?php if($fd->isgfd()) { echo "Yes"; } else { echo "No"; } ?></td>
  </tr>
</table>

<?php } ?>
</form>

</body>

</html>


Details

Sun, 02 apr 2023 17:30:00 +0100 fday Class: version 0.1 du 16/03/2023 MD5 fday Class: 236BBF070B02D67A392BDA24F90948AB Documentation: included in the class URL du site: http://www.fauque.fr Menu: Divers / T?l?chargements / Classes PHP Twitter: http://twitter.com/fr_phpuser hashtag: #FDAY Author: Pierre FAUQUE, pierre@fauque.net Public PGP key's author: 0xBB599B65F8CC4747 (long key ID) -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1 mQINBEs9tXQBEACuoUiyx3ISCGUxu9DwACKe0jSRhy/fs4spUmVgw/ePNhUuIX8r RoljTWnL04kTNihI8L8PW0kA1IT5SURJ+5OXp0sMXZ9vEnk/TZwRjB+sGQPfWONJ CDldBTX0bw+CUB8URiarlhfbU4+3usJ8SlGQBXaHlWCgRaBDy0x8qADayWnxB3ip O865LyYhh9y+Ru/ECHC/+nFMazlv5ezP6vG4nHZEEgdcr8Q9OoWkr2Qw6Y/fvgH7 j8G/hlaMnhMv9T8K7OTKoyvlrXtw7AvH+xDIT/QEKeiPjb5IDUna8WtDZHCKQTps s6xBypmX41wE4iO1LqlpXB1Va4yya8bsHWovBri2ZhQzIxUU1JFPHgOcmtiNmnGD Y2DnHQchJtC8Zi84kU7EMl+27YghC0ViPXth8O6tySU6UcRCTKhLFkqI4PxWwDex g2mztd0+H2p4XrSV07lteJqnrNDZJHAxCKZywijU7YSfS9c1iau3Iv+26+F430dg JRrEyIV7BX5/BEcPIrrQda5XpqKtxKGomTd/KeT51LpBpMJgmAIgA4AZ3XNUntfN G4NY2ZtEMgI2b7xd8qVEuMZYWyDiVIcJuy3BpJkN+AbEHjyq75oXUps+2aCq9MN+ 9GtP0yPskfZ/BJJyfbjuVtKY6oxR4VV6KPR+Kx4OUDjLQiqEwEp03/hdZwARAQAB tCFQaWVycmUgRkFVUVVFIDxwaWVycmVAZmF1cXVlLm5ldD6JAhwEEwECAAYFAks9 tbsACgkQu1mbZfjMR0cLJhAAkgyo8iTfYt9TNBigtVDci+UVuyvFw20H/VWkS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sMFxqTAJqhqj6 5cARAadjVzIkYVacudYdmZxQM7pdSQ9jyKfFbF8j3lrkoHuuynWlfq8iuut1J24c IK1A75IHClGLQ6CSC+cPXRaAZ42o15W3xrpv9MIKZEMumFuqGx1bZVtbPyO2fF29 HJHQMIPcU/C/8b89ArtjB+wHwRlQU4/yV6E09wbSYGLWANkqb5tFu5MCjwdXzvVK Hf74615xZBmeQlHEeDw6Sr86ipCAamss2Tm23mL5oyW2EliC4aWO++24imK9ABEB AAGJAiUEGAECAA8FAks9tbsCGwwFCQAAAAAACgkQu1mbZfjMR0eIqBAAmxHToHww ewGEJtiQC5vT9aW81MLlsKl7xNlnt9XFVe+b8+cM+IlVgS+tCo0ZynvB71ncEbKH cuI+wTYvJcxL+F0frP4cjKy51pMU0nQKlh8qKlqw+SIRr5HONV4f1ml7cGu+T2c0 3MEcDzYezsB/7DXj15GCJs94gkV3vCVbqXSLq5rlTrH8EL7yETvoP4swmKO3e2+Z UsCaOreDH8JABSGVnlLUh2YoC5VjnGYhPIQp4n3v418lxWi0FTlG0oKH4dBsat+r TYLf/yD1Gzmb8oBB3k5XusXMmpi0MnuoiTWeKWrHRr9IEW5OOZlc4XiAhqbYN7rx r9guaapuok7BrB4LIVswzdv+FYzJ2fsYgguyZduYDbgFDD2MLtxQwgTj6r1MQSjl cA4wzJcc9tt272Fk2+0Hsj6+xkF8uTEZqtyRFG8Lrl8N1v2UPxZ4I05HuclzOWkb eX0w/84yxldMda3gir3wVVPcyx1ku03IXUlwEDP2zla4Gn+DDJShA9OcjtKsPpQ4 twINN1jgsxNeOVWfgP+4aeBNIwGNWm54Sx9SdBS2gxNXOVcvvg1WUPV1LbcnmYpk da9AdRKfbq7srHX9uH9Lxy7PoSpq0AneU8Eu3IYqKKaA6nJQxQ5JPeliQCpfMq/Z SCf1qW/pIWu0HsKsLm1IOXb4xjpEH9QhMpc= =SHbA -----END PGP PUBLIC KEY BLOCK-----

  Demo on the author's websiteExternal page  
  Files folder image Files (3)  
File Role Description
Plain text file class.fday.php Class Main class
Accessible without login Plain text file fday_test.php Example Example of use
Accessible without login Plain text file README.txt Data Infos about class and author

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:63
This week:0
All time:10,431
This week:660Up