#
#
#
#
#
#
#
#
#
#
# get settings
require "../settings.php";
require "../core-settings.php";
require "../libs/ext.lib.php";
if (isset($_GET["supid"])) {
    $OUTPUT = sel_bank($_GET["supid"]);
} elseif (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "method":
            $OUTPUT = method($_POST);
            break;
        case "alloc":
            $OUTPUT = alloc($_POST);
            break;
        case "confirm":
            $OUTPUT = confirm($_POST);
            break;
        case "write":
            $OUTPUT = write($_POST);
            break;
        default:
            break;
        case "alloc":
            $OUTPUT = alloc($_POST);
            break;
        case "confirm":
            $OUTPUT = confirm($_POST);
            break;
        case "write":
            $OUTPUT = write($_POST);
            break;
        default:
            $OUTPUT = sel_bank();
    }
} else {
    # Display default output
    $OUTPUT = sel_bank();
}
# get templete
require "../template.php";
# Insert details
function sel_cus()
{
    // customers Drop down selections
    db_connect();
    $cust = "<select name='cusid'>";
    $sql = "SELECT cusnum,cusname,surname,currency,fcid FROM customers WHERE location = 'int' AND div = '" . USER_DIV . "' ORDER BY surname,cusname";
    $cusRslt = db_exec($sql);
    $numrows = pg_numrows($cusRslt);
    if (empty($numrows)) {
        return "<li> There are no Debtors in Cubit.";
    }