#
#
#
#
#
#
#
# get settings
require "../settings.php";
require "../core-settings.php";
require "../libs/ext.lib.php";
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "confirm":
            $OUTPUT = confirmAllow($_POST);
            break;
        case "write":
            $OUTPUT = writeAllow($_POST);
            break;
        default:
            $OUTPUT = enterAllow();
    }
} else {
    $OUTPUT = enterAllow();
}
# display output
require "../template.php";
# enter new data
function enterAllow()
{
#
#
#
#
#
#
#
#
# get settings
require "../settings.php";
$OUTPUT = "<li class='err'>Disabled</li>";
require "../template.php";
exit;
# decide what to do
if (isset($_GET["id"])) {
    $OUTPUT = confirmAllow($_GET["id"]);
} elseif (isset($_POST["key"])) {
    $OUTPUT = $_POST["key"] == "rem" ? remAllow($_POST["id"]) : "Invalid use of module.";
} else {
    $OUTPUT = "Invalid use of module.";
}
# display output
require "../template.php";
# confirm new data
function confirmAllow($id)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($id, "num", 1, 20, "Invalid allowance ID.");
    # display errors, if any