#
#
#
#
#
#
#
#
#
# get settings
require "../settings.php";
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "confirm":
            $OUTPUT = confirmLeave($_POST);
            break;
        case "write":
            $OUTPUT = writeLeave($_POST);
            break;
        default:
            if (isset($_GET['id'])) {
                $OUTPUT = enterLeave($_GET);
            } else {
                $OUTPUT = "<li class='err'>Invalid Use of module.</li>";
            }
    }
} else {
    if (isset($_GET['id'])) {
        $OUTPUT = enterLeave($_GET);
    } else {
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "write":
            $OUTPUT = writeLeave($_POST);
            break;
        default:
            if (isset($_GET['id'])) {
                $OUTPUT = confirmLeave($_GET);
            } else {
                $OUTPUT = "<li class=err>Invalid Use of module.";
            }
    }
} else {
    if (isset($_GET['id'])) {
        $OUTPUT = confirmLeave($_GET);
    } else {
        $OUTPUT = "<li class=err>Invalid Use of module.";
    }
}
# display output
require "../template.php";
# return name of month for $monthNo
function getMonth($monthNo)
{
    if ($monthNo > 12 || $monthNo < 1 || !is_int($monthNo)) {
        errDie("Invalid month: {$monthNo}.");
    }
    $arrMonths = array(1 => "January", 2 => "February", 3 => "March", 4 => "April", 5 => "May", 6 => "June", 7 => "July", 8 => "August", 9 => "September", 10 => "October", 11 => "November", 12 => "December");
    return $arrMonths[$monthNo];
}