#
#
#
#
#
#
#
#
#
require "settings.php";
require "core-settings.php";
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "view":
            require_lib("docman");
            $OUTPUT = printPurch($_POST);
            break;
        case "export":
            $OUTPUT = export($_POST);
            break;
        default:
            $OUTPUT = slct();
            break;
    }
} else {
    # Display default output
    $OUTPUT = slct();
}
require "template.php";
# Default view
function slct()
function export($_POST)
{
    $OUT = printPurch($_POST, true);
    $OUT = clean_html($OUT);
    require_lib("xls");
    Stream("Orders Received", $OUT);
}