#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "../settings.php";
# Display default output
$OUTPUT = printLea();
require "../template.php";
# show invoices
function printLea()
{
    # Set up table to display in
    $printLea = "\n\t\t<h3>Employees on Leave</h3>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t\t<tr>\n\t\t\t\t<th>Employee</th>\n\t\t\t\t<th>Type Of Leave</th>\n\t\t\t\t<th>Start Date</th>\n\t\t\t\t<th>End Date</th>\n\t\t\t\t<th>Approved By</th>\n\t\t\t</tr>";
    # connect to database
    db_connect();
    # Query server
    $i = 0;
    $today = date("Y-m-d");
    $sql = "SELECT * FROM empleave WHERE enddate >= '{$today}' AND approved = 'y' AND div = '" . USER_DIV . "' ORDER BY id DESC";
    $leaRslt = db_exec($sql) or errDie("Unable to retrieve employee leave from database.");
    if (pg_numrows($leaRslt) < 1) {
        $printLea = "<li class='err'>There are no Employees on Leave.</li><br>";
#
#
#
#
#
#
#
#
#
#
require "../settings.php";
require "emp-functions.php";
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "view":
            $OUTPUT = printLea($_POST);
            break;
        default:
            $OUTPUT = slct();
            break;
    }
} else {
    if (isset($_GET["empnum"])) {
        $OUTPUT = slct($_GET);
    } else {
        $OUTPUT = slct();
    }
}
require "../template.php";
function slct()
{