<?php
// when_is_easter.php
// RJM Programming
// May, 2023

$yr='';
$rs='';
$sval='CAL_EASTER_DEFAULT';
if (isset($_GET['year']) && isset($_GET['cal'])) {
 $yr='' . $_GET['year'];
 switch (str_replace('+',' ',urldecode($_GET['cal']))) {
   case 'CAL_EASTER_DEFAULT':
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_EASTER_DEFAULT));
    break;
    
   case 'CAL_EASTER_ROMAN':
$sval='CAL_EASTER_ROMAN';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_EASTER_ROMAN));
    break;
    
   case 'CAL_EASTER_ALWAYS_GREGORIAN':
$sval='CAL_EASTER_ALWAYS_GREGORIAN';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_EASTER_ALWAYS_GREGORIAN));
    break;
    
   case 'CAL_EASTER_ALWAYS_JULIAN':
$sval='CAL_EASTER_ALWAYS_JULIAN';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_EASTER_ALWAYS_JULIAN));
    break;
    
   case 'CAL_GREGORIAN':
$sval='CAL_GREGORIAN';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_GREGORIAN));
    break;
    
   case 'CAL_JULIAN':
$sval='CAL_JULIAN';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_JULIAN));
    break;
    
   case 'CAL_JEWISH':
$sval='CAL_JEWISH';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_JEWISH));
    break;
    
   case 'CAL_FRENCH':
$sval='CAL_FRENCH';
    $rs=date("M-d-Y", easter_date($_GET['year'], CAL_FRENCH));
    break;
    
   default:
    $rs=date("M-d-Y", easter_date($_GET['year']));
    break;
 }
}

echo "<html>
<body onload=\"if ('" . $yr . "' != '') {   document.getElementById('year').value='" . $yr . "'; } else { var da=new Date();  document.getElementById('year').value='' + da.getFullYear(); } document.getElementById('cal').value='" . $sval . "';\">
<h1>When Is Easter?</h1>
<h3>RJM Programming</h3>
<h4>May, 2023</h4>
<div>" . $rs . "</div><br>
<form meth=GET action=./when_is_easter.php>
<input name=year id=year value=2023 type=number></input>&nbsp;&nbsp;<select id=cal name=cal>
<option value=CAL_EASTER_DEFAULT>
CAL_EASTER_DEFAULT For easter_days(): calculate Easter for years before 1753 according to the Julian calendar, and for later years according to the Gregorian calendar.
</option><option value=CAL_EASTER_ROMAN>
CAL_EASTER_ROMAN For easter_days(): calculate Easter for years before 1583 according to the Julian calendar, and for later years according to the Gregorian calendar.
</option><option value=CAL_EASTER_ALWAYS_GREGORIAN>
CAL_EASTER_ALWAYS_GREGORIAN For easter_days(): calculate Easter according to the proleptic Gregorian calendar.
</option><option value=CAL_EASTER_ALWAYS_JULIAN>
CAL_EASTER_ALWAYS_JULIAN For easter_days(): calculate Easter according to the Julian calendar.
</option><option value=CAL_GREGORIAN>
CAL_GREGORIAN For cal_days_in_month(), cal_from_jd(), cal_info() and cal_to_jd(): use the proleptic Gregorian calendar.
</option><option value=CAL_JULIAN>
CAL_JULIAN For cal_days_in_month(), cal_from_jd(), cal_info() and cal_to_jd(): use the Julian calendar.
</option><option value=CAL_JEWISH>
CAL_JEWISH For cal_days_in_month(), cal_from_jd(), cal_info() and cal_to_jd(): use the Jewish calendar.
</option><option value=CAL_FRENCH>
CAL_FRENCH For cal_days_in_month(), cal_from_jd(), cal_info() and cal_to_jd(): use the French Repuclican calendar.
</option></select><br><br>
<input type=submit value='Tell Me Date of Easter' style='background-color:lightgreen;'></input>
</form>
<iframe id=ffmwhere style=display:none; src=./when_is_easter.php" . $whereffmpeg . "></iframe>
</body>
</html>";

?>